- Procedure GMP::Column::SetLowerBound(GMP, column, value)
GMP::Column::SetLowerBound
The procedure GMP::Column::SetLowerBound
changes the lower bound of
a column in a generated mathematical program.
GMP::Column::SetLowerBound(
GMP, ! (input) a generated mathematical program
column, ! (input) a scalar reference or column number
value ! (input) a numerical expression
)
Arguments
- GMP
An element in
AllGeneratedMathematicalPrograms
.- column
A scalar reference to an existing column in the matrix or an element in the set
Integers
in the range \(\{ 0 .. n-1 \}\) where \(n\) is the number of columns in the matrix.- value
The new value assigned to the lower bound of the column.
Return Value
The procedure returns 1 on success, and 0 otherwise.
Note
Use
GMP::Column::SetLowerBoundMulti
orGMP::Column::SetLowerBoundRaw
if the lower bounds of many columns have to be set, because that will be more efficient.If the column has a unit then value should have the same unit. If value has no unit then you should multiply it by the column scale, as returned by the function
GMP::Column::GetScale
.
Example
Assume that ‘x1’ is a variable in mathematical program ‘MP’ with a unit as defined by:
Quantity SI_Mass { BaseUnit : kg; Conversions : ton -> kg : # -> # * 1000; } Parameter min_wght { Unit : ton; InitialValue : 20; } Variable x1 { Range : [min_wght, inf); Unit : ton; }Then if we run the following code
GMP::Column::SetLowerBound( 'MP', x1, 20 [ton] ); lb1 := GMP::Column::GetLowerBound( 'MP', x1 ); display lb1; GMP::Column::SetLowerBound( 'MP', x1, 30 ); lb2 := GMP::Column::GetLowerBound( 'MP', x1 ); display lb2; GMP::Column::SetLowerBound( 'MP', x1, 40 * GMP::Column::GetScale( 'MP', x1 ) ); lb3 := GMP::Column::GetLowerBound( 'MP', x1 ); display lb3;(where ‘lb1’, ‘lb2’ and ‘lb3’ are parameters without a unit) we get the following results:
lb1 := 20 ; lb2 := 0.030 ; lb3 := 40 ;