Adds a variable to the collection.
Namespace:
Extreme.Mathematics.Optimization
Assembly:
Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.1
public LinearProgramVariable AddVariable(
string name,
double cost,
double lowerBound,
double upperBound
)
Public Function AddVariable (
name As String,
cost As Double,
lowerBound As Double,
upperBound As Double
) As LinearProgramVariable
public:
LinearProgramVariable^ AddVariable(
String^ name,
double cost,
double lowerBound,
double upperBound
)
member AddVariable :
name : string *
cost : float *
lowerBound : float *
upperBound : float -> LinearProgramVariable
Parameters
- name
- Type: SystemString
The name of the variable. - cost
- Type: SystemDouble
The cost associated with the variable. - lowerBound
- Type: SystemDouble
The lower bound for the variable. - upperBound
- Type: SystemDouble
The upper bound for the variable.
Return Value
Type:
LinearProgramVariableThe new
DecisionVariable.
Exception | Condition |
---|
ArgumentException |
The linear program already contains a variable named name.
|
Reference