Constraints

class Constraint

An object for constraint expressions that represent equality constraints or inequality constraints.

Public Functions

Constraint()

Creates an empty constraint object.

bool is_inequality() const
Returns:

true if this is an inequality constraint

bool is_equality() const
Returns:

true if this is an equality constraint

bool is_feasible() const
Returns:

true if the constraint is feasible

Expression lower() const
Returns:

the expression for the constraint lower bound

Expression body() const
Returns:

the expression for the constraint body

Expression upper() const
Returns:

the expression for the constraint upper bound

Constraint &name(const std::string &name)

Set the constraint name

std::string name() const
Returns:

the constraint name

size_t id() const
Returns:

the unique integer constraint ID

std::list<std::string> to_list() const
Returns:

a list representation of the constraint