MConstrBuilder.MConstrBuilder()
Construct a MConstrBuilder object with the given shape.
Synopsis
MConstrBuilder(Shape shp)
Arguments
shp
: shape of MConstrBuilder.
MConstrBuilder.Flatten()
Flatten a MConstrBuilder object to a 1-dimensional shape.
Synopsis
MConstrBuilder Flatten()
Return
a MConstrBuilder object collapsed into one dimension.
MConstrBuilder.GetExpr()
Get N-dimensional linear expressions associated with N-dimensional constraints.
Synopsis
MLinExpr GetExpr()
Return
MLinExpr object.
MConstrBuilder.GetND()
Get number of dimensions of MConstrBuilder object.
Synopsis
int GetND()
Return
number of dimensions.
MConstrBuilder.GetRange()
Get range from lower bound to upper bound of N-dimensional range constraints.
Synopsis
double GetRange()
Return
length from lower bound to upper bound of range constraints.
MConstrBuilder.GetSense()
Get sense associated with N-dimensional constraints.
Synopsis
char GetSense()
Return
constraint sense.
MConstrBuilder.Set<T>()
Set N-dimensional constraints to its builder object.
Synopsis
void Set<T>(
MLinExpr expr,
char sense,
NdArray<T> rhs)
Arguments
expr
: MLinExpr object
sense
: constraint sense other than COPT_RANGE.
rhs
: N-dimensional constants at right side of constraints.
MConstrBuilder.Set()
Set N-dimensional constraints to its builder object.
Synopsis
void Set(
MLinExpr expr,
char sense,
double rhs)
Arguments
expr
: MLinExpr object
sense
: constraint sense other than COPT_RANGE.
rhs
: constant of right side of constraints.
MConstrBuilder.Set()
Set N-dimensional constraints to its builder object.
Synopsis
void Set(
MLinExpr expr,
char sense,
MVar rhs)
Arguments
expr
: MLinExpr object
sense
: constraint sense other than COPT_RANGE.
rhs
: MVar object at right side of constraints.
MConstrBuilder.Set()
Set N-dimensional constraints to its builder object.
Synopsis
void Set(
MLinExpr expr,
char sense,
MLinExpr rhs)
Arguments
expr
: MLinExpr object
sense
: constraint sense other than COPT_RANGE.
rhs
: MLinExpr object at right side of constraints.
MConstrBuilder.SetRange()
Set N-dimensional range constraints to its builder object.
Synopsis
void SetRange(MLinExpr expr, double range)
Arguments
expr
: MLinExpr object.
range
: length from lower bound to upper bound of the constraint. Must greater than 0.