LinearProgram.AddIntegerVariable Method

Definition

Namespace: Numerics.NET.Optimization
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.3

Overload List

AddIntegerVariable(String) Adds an integer variable to the collection.
AddIntegerVariable(String, Double) Adds a binary variable to the collection.
AddIntegerVariable(String, Int32, Int32) Adds a binary variable to the collection.
AddIntegerVariable(String, Double, Int32, Int32) Adds a binary variable to the collection.

AddIntegerVariable(String, Double)

Adds a binary variable to the collection.
C#
public LinearProgramVariable AddIntegerVariable(
	string name,
	double cost
)

Parameters

name  String
The name of the variable.
cost  Double
The cost associated with the variable.

Return Value

LinearProgramVariable
The new DecisionVariable.

Exceptions

ArgumentException

The linear program already contains a variable named name.

AddIntegerVariable(String, Double, Int32, Int32)

Adds a binary variable to the collection.
C#
public LinearProgramVariable AddIntegerVariable(
	string name,
	double cost,
	int lowerBound,
	int upperBound
)

Parameters

name  String
The name of the variable.
cost  Double
The cost associated with the variable.
lowerBound  Int32
The lower bound for the variable.
upperBound  Int32
The upper bound for the variable.

Return Value

LinearProgramVariable
The new DecisionVariable.

Exceptions

ArgumentException

The linear program already contains a variable named name.

See Also