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
)
- GMP
An element in the set :aimms
AllGeneratedMathematicalPrograms
.- constraintSet
A subset of the set :aimms
AllConstraints
.
The function returns a subset of the row numbers as a subset of the set :aimms
Integers
.
Assume we have generated a mathematical program and we want to change the right hand side of the constraints
c1(i)
andc2(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 :aimms
GMP::Instance::GetRowNumbers
this can also be coded as follows. HereRowNrs
is a subset of :aimmsIntegers
with indexr
, andCons
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
.