LinearProgram.AddVariable Method

Definition

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

Overload List

AddVariable(String) Adds a variable to the collection.
AddVariable(String, Double) Adds a variable to the collection.
AddVariable(String, Double, Double) Adds a variable to the collection.
AddVariable(String, Double, Double, Double) Adds a variable to the collection.

AddVariable(String, Double)

Adds a variable to the collection.
C#
public LinearProgramVariable AddVariable(
	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.

Remarks

The lower bound for the variable is zero. It has no upper bound.

Exceptions

ArgumentException

The linear program already contains a variable named name.

AddVariable(String, Double, Double, Double)

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

Parameters

name  String
The name of the variable.
cost  Double
The cost associated with the variable.
lowerBound  Double
The lower bound for the variable.
upperBound  Double
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