Optimization Problem

template<typename Alloc>
class 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

inline BasicProblem()

Constructs an empty optimization problem.

inline int num_vars() const

Returns the number of variables.

inline int num_objs() const

Returns the number of objectives.

inline int num_algebraic_cons() const

Returns the number of algebraic constraints.

inline int num_logical_cons() const

Returns the number of logical constraints.

inline int num_common_exprs() const

Returns the number of common expressions.

inline 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()) {
  ...
}

inline 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()) {
  ...
}

inline 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()) {
  ...
}

inline 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

inline iterator begin() const

Returns an iterator to the first element in the range.

inline 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>