Procedure GMP::Row::SetRightHandSideMulti(GMP, binding, row, value)

GMP::Row::SetRightHandSideMulti

The procedure GMP::Row::SetRightHandSideMulti changes the right-hand-sides of a group of rows, belonging to a constraint, in a generated mathematical program.

GMP::Row::SetRightHandSideMulti(
     GMP,            ! (input) a generated mathematical program
     binding,        ! (input) an index binding
     row,            ! (input) a constraint expression
     value           ! (input) a numerical expression
     )

Arguments

GMP

An element in AllGeneratedMathematicalPrograms.

binding

An index binding that specifies and possibly limits the scope of indices.

row

A constraint that, combined with the binding domain, specifies the rows.

value

The new right-hand-side for each row, defined over the binding domain.

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

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

for (i) do
    GMP::Row::SetRightHandSide( myGMP, c(i), rhs(i) );
endfor;

It is more efficient to use:

GMP::Row::SetRightHandSideMulti( myGMP, i, c(i), rhs(i) );

If we only want to set the right-hand-side values of those c(i) for which dom(i) is unequal to zero, then we use:

GMP::Row::SetRightHandSideMulti( myGMP, i | dom(i), c(i), rhs(i) );