Optimization Problem

template<typename Alloc>
class mp::BasicProblem : public ExprFactory, public SuffixManager

An optimization problem.

Public Types

typedef Range<Variable> VarRange

A range of variables.

typedef Range<Objective> ObjRange

A range of objectives.

typedef Range<AlgebraicCon> AlgebraicConRange

A range of algebraic constraints.

typedef Range<LogicalCon> LogicalConRange

A range of logical constraints.

Public Functions

BasicProblem()

Constructs an empty optimization problem.

int num_vars() const

Returns the number of variables.

int num_objs() const

Returns the number of objectives.

int num_algebraic_cons() const

Returns the number of algebraic constraints.

int num_logical_cons() const

Returns the number of logical constraints.

int num_common_exprs() const

Returns the number of common expressions.

VarRange vars() const

Returns a range representing all variables in this optimization problem. It can be used for iterating over variables:

for (auto var: problem.vars()) {
  ...
}

ObjRange objs() const

Returns a range representing all objectives in this optimization problem. It can be used for iterating over objectives:

for (auto obj: problem.objs()) {
  ...
}

AlgebraicConRange algebraic_cons() const

Returns a range representing all algebraic constraints in this optimization problem. It can be used for iterating over algebraic constraints:

for (auto con: problem.algebraic_cons()) {
  ...
}

LogicalConRange logical_cons() const

Returns a range representing all logical constraints in this optimization problem. It can be used for iterating over logical constraints:

for (auto con: problem.logical_cons()) {
  ...
}

template<typename Item>
class BasicCommonExpr : private Item
template<typename Item>
class BasicLogicalCon : private Item
class LinearExprBuilder
class MutAlgebraicCon : public mp::BasicProblem<MutProblemItem>::BasicAlgebraicCon
class MutCommonExpr : public mp::BasicProblem<Alloc>::BasicCommonExpr<MutProblemItem>
class MutLogicalCon : public mp::BasicProblem<Alloc>::BasicLogicalCon<MutProblemItem>
class MutObjective : public mp::BasicProblem<MutProblemItem>::BasicObjective
class MutVariable : public mp::BasicProblem<MutProblemItem>::BasicVariable
template<typename T>
class Range

A pair of iterators to problem elements.

Public Functions

iterator begin() const

Returns an iterator to the first element in the range.

iterator end() const

Returns an iterator to the element following the last element in the range.

An attempt to access this element will result in assertion failure if assertions are enabled and undefined behavior otherwise.

class iterator : public std::iterator<std::forward_iterator_tag, T>