MConstrBuilder::MConstrBuilder()

Construct a MConstrBuilder object with the given shape.

Synopsis

MConstrBuilder(const Shape<N> &shp)

Arguments

shp: shape of MConstrBuilder.

MConstrBuilder::Flatten()

Flatten a MConstrBuilder object to a 1-dimensional shape.

Synopsis

MConstrBuilder<1> Flatten()

Return

a MConstrBuilder object collapsed into one dimension.

MConstrBuilder::GetExpr()

Get N-dimensional linear expressions associated with N-dimensional constraints.

Synopsis

const MLinExpr<N> &GetExpr()

Return

MLinExpr object.

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()

Set N-dimensional constraints to its builder object.

Synopsis

void Set(

const MLinExpr<N> &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

template <class T> void Set(

const MLinExpr<N> &expr,

char sense,

const NdArray<T, N> &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

template <int M> void Set(

const MLinExpr<N> &expr,

char sense,

const MVar<M> &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

template <int M> void Set(

const MLinExpr<N> &expr,

char sense,

const MLinExpr<M> &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(const MLinExpr<N> &expr, double range)

Arguments

expr: MLinExpr object.

range: length from lower bound to upper bound of the constraint. Must greater than 0.