Procedure GMP::Row::SetRightHandSideRaw(GMP, rowSet, value)

GMP::Row::SetRightHandSideRaw

The procedure GMP::Row::SetRightHandSideRaw changes the right-hand-sides of a group of rows in a generated mathematical program.

GMP::Row::SetRightHandSideRaw(
     GMP,            ! (input) a generated mathematical program
     rowSet,         ! (input) a subset of Integers
     value           ! (input) a parameter
     )

Arguments

GMP

An element in AllGeneratedMathematicalPrograms.

rowSet

A subset of the set Integers, representing a set of row numbers.

value

A parameter defining a new right-hand-side for each row in rowSet.

Return Value

The procedure returns 1 on success, and 0 otherwise.

Note

If the constraint has a unit then value should have the same unit. If value has no unit then you should multiply it by the row scale, as returned by the function GMP::Row::GetScale. See GMP::Row::SetRightHandSide for an example with units.

Example

Assume that ‘MP’ is a mathematical program. To use GMP::Row::SetRightHandSideRaw we declare the following identifiers (in ams format):

ElementParameter myGMP {
    Range: AllGeneratedMathematicalPrograms;
}
Set ConstraintSet {
    SubsetOf: AllConstraints;
}
Set RowSet {
    SubsetOf: Integers;
    Index: rr;
}
Parameter RHS {
    IndexDomain: rr;
}

To change the right-hand-side values of the constraint c(i) we can use:

myGMP := GMP::Instance::Generate( MP );

ConstraintSet := { 'c' };
RowSet := GMP::Instance::GetRowNumbers( myGMP, ConstraintSet );

RHS(rr) := 5.0;

GMP::Row::SetRightHandSideRaw( myGMP, RowSet, RHS );