- Procedure GMP::Row::SetTypeRaw(GMP, rowSet, type)
GMP::Row::SetTypeRaw
The procedure GMP::Row::SetTypeRaw
changes the types of a group of rows
in a generated mathematical program.
GMP::Row::SetTypeRaw(
GMP, ! (input) a generated mathematical program
rowSet, ! (input) a subset of Integers
type ! (input) an element parameter in AllRowTypes
)
Arguments
- GMP
An element in
AllGeneratedMathematicalPrograms
.- rowSet
A subset of the set
Integers
, representing a set of row numbers.- type
An element parameter in
AllRowTypes
, defined over the binding domain.
Return Value
The procedure returns 1 on success, or 0 otherwise.
Example
Assume that MP
is a mathematical program. To use
GMP::Row::SetTypeRaw
we declare the following identifiers
(in ams format):
ElementParameter myGMP {
Range: AllGeneratedMathematicalPrograms;
}
Set ConstraintSet {
SubsetOf: AllConstraints;
}
Set RowSet {
SubsetOf: Integers;
Index: rr;
}
ElementParameter RowType {
IndexDomain: rr;
Range: AllRowTypes;
}
To change the constraint c(i)
in a less-than-or-equal-to constraint we can use:
myGMP := GMP::Instance::Generate( MP );
ConstraintSet := { 'c' };
RowSet := GMP::Instance::GetRowNumbers( myGMP, ConstraintSet );
RowType(rr) := '<=';
GMP::Row::SetTypeRaw( myGMP, RowSet, RowType );
See also
The routines
GMP::Instance::Generate
,GMP::Row::GetType
andGMP::Row::SetType
.