Skip to content

Latest commit

 

History

History
72 lines (48 loc) · 2.18 KB

File metadata and controls

72 lines (48 loc) · 2.18 KB

GMP::Instance::GetRowNumbers

The function :aimmsGMP::Instance::GetRowNumbers returns a subset of the row numbers of a generated mathematical program. It returns the row numbers that are generated for a set of constraints.

GMP::Instance::GetRowNumbers(
     GMP,                  ! (input) a generated mathematical program
     constraintSet        ! (input) a set of constraints
     )

Arguments

GMP

An element in the set :aimmsAllGeneratedMathematicalPrograms.

constraintSet

A subset of the set :aimmsAllConstraints.

Return Value

The function returns a subset of the row numbers as a subset of the set :aimmsIntegers.

Example

Assume we have generated a mathematical program and we want to change the right hand side of the constraints c1(i) and c2(j,k) into 100. This can be done as follows:

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

for (i) do
    GMP::Row::SetUpperBound( myGMP, c1(i), 100 );
endfor;

for (j,k) do
    GMP::Row::SetRightHandSide( myGMP, c2(j,k), 100 );
endfor;

Using the function :aimmsGMP::Instance::GetRowNumbers this can also be coded as follows. Here RowNrs is a subset of :aimmsIntegers with index r, and Cons a subset of :aimmsAllConstraints.

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

Cons := { 'c1', 'c2' };

RowNrs := GMP::Instance::GetRowNumbers( myGMP, Cons );

for (r) do
    GMP::Row::SetRightHandSide( myGMP, r, 100 );
endfor;

The functions :aimmsGMP::Instance::Generate, :aimmsGMP::Instance::GetColumnNumbers, :aimmsGMP::Instance::GetNumberOfRows, :aimmsGMP::Instance::GetObjectiveColumnNumber and :aimmsGMP::Instance::GetObjectiveRowNumber.