Function GMP::Column::GetUpperBound(GMP, column)

# GMP::Column::GetUpperBound¶

The function GMP::Column::GetUpperBound returns the upper bound of a column in the generated mathematical program.

GMP::Column::GetUpperBound(
GMP,            ! (input) a generated mathematical program
column          ! (input) a scalar reference or column number
)


## Arguments¶

GMP
An element in AllGeneratedMathematicalPrograms.
column
A scalar reference to an existing column in the matrix or the number of that column in the range $$\{ 0 .. n-1 \}$$ where $$n$$ is the number of columns in the matrix.

## Return Value¶

The upper bound value for the specified column.

Note

• If the column has a unit then the scaled upper bound is returned (without unit).
• This function can be used to retrieve the upper bound after presolving in case the GMP was created by GMP::Instance::CreatePresolved, even if the column was deleted.

## 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 max_wght {
Unit          :  ton;
InitialValue  :  20;
}
Variable x1 {
Range         :  [0, max_wght];
Unit          :  ton;
}


If we want to multiply the upper bound by 1.5 and assign it as the new value by using function GMP::Column::SetUpperBound we can use

ub1 := 1.5 * (GMP::Column::GetUpperBound( 'MP', x1 )) [ton];

GMP::Column::SetUpperBound( 'MP', x1, ub1 );


if ‘ub1’ is a parameter with unit [ton], or we can use

ub2 := 1.5 * GMP::Column::GetUpperBound( 'MP', x1 );

GMP::Column::SetUpperBound( 'MP', x1, ub2 * GMP::Column::GetScale( 'MP', x1 ) );


if ‘ub2’ is a parameter without a unit.