# Couenne::CouenneConstraint Class Reference

Class to represent nonlinear constraints. More...

`#include <CouenneProblemElem.hpp>`

Inheritance diagram for Couenne::CouenneConstraint:

List of all members.

## Public Member Functions
| CouenneConstraint (expression *body=NULL, expression *lb=NULL, expression *ub=NULL)
| Constructor.
virtual | ~CouenneConstraint ()
| Destructor.
| CouenneConstraint (const CouenneConstraint &c, Domain *d=NULL)
| Copy constructor.
virtual CouenneConstraint * | clone (Domain *d=NULL) const
| Cloning method.
virtual expression * | Lb () const
| Expression of lower bound.
virtual expression * | Ub () const
| Expression of upper bound.
virtual expression * | Body () const
| Expression of body of constraint.
virtual expression * | Body (expression *newBody)
| Set body of constraint.
virtual exprAux * | standardize (CouenneProblem *)
| decompose body of constraint through auxiliary variables
virtual void | print (std::ostream &=std::cout)
| print constraint
## Protected Attributes
expression * | body_
| Body of constraint.
expression * | lb_
| Lower bound (expression).
expression * | ub_
| Upper bound (expression).

## Detailed Description

Class to represent nonlinear constraints.

It consists of an expression as the body and two range expressions as lower- and upper bounds.

A general constraint is defined as lb_ <= body_ <= ub_, where all three components are expressions, depending on variables, auxiliaries and bounds. If the constraint is 2 <= exp (x1+x2) <= 4, then:

body_ = exp (x1+x2), that is,

new exprExp (new exprSum (new exprVar (1), new exprVar (2))

while lb_ = new exprConst (2.) and ub_ = new exprConst (4.).

Definition at line 39 of file CouenneProblemElem.hpp.

## Constructor & Destructor Documentation

Couenne::CouenneConstraint::CouenneConstraint | ( | expression * | body = `NULL`,
|  | expression * | lb = `NULL`,
|  | expression * | ub = `NULL` |
| ) |  |  | `[inline]`

Constructor.

Definition at line 50 of file CouenneProblemElem.hpp.

References COUENNE_INFINITY, lb_, and ub_.

Referenced by clone().

virtual Couenne::CouenneConstraint::~CouenneConstraint | ( |  | ) | `[inline, virtual]`

Destructor.

Definition at line 67 of file CouenneProblemElem.hpp.

References body_, lb_, and ub_.

Couenne::CouenneConstraint::CouenneConstraint | ( | const CouenneConstraint & | c,
|  | Domain * | d = `NULL` |
| ) |  |  | `[inline]`

Copy constructor.

Definition at line 74 of file CouenneProblemElem.hpp.

## Member Function Documentation

virtual CouenneConstraint* Couenne::CouenneConstraint::clone | ( | Domain * | d = `NULL` | ) | const`[inline, virtual]`

Cloning method.

Reimplemented in Couenne::CouennePSDcon.

Definition at line 80 of file CouenneProblemElem.hpp.

References CouenneConstraint().

virtual expression* Couenne::CouenneConstraint::Lb | ( |  | ) | const`[inline, virtual]`

Expression of lower bound.

Definition at line 84 of file CouenneProblemElem.hpp.

References lb_.

virtual expression* Couenne::CouenneConstraint::Ub | ( |  | ) | const`[inline, virtual]`

Expression of upper bound.

Definition at line 85 of file CouenneProblemElem.hpp.

References ub_.

virtual expression* Couenne::CouenneConstraint::Body | ( |  | ) | const`[inline, virtual]`

Expression of body of constraint.

Definition at line 86 of file CouenneProblemElem.hpp.

References body_.

virtual expression* Couenne::CouenneConstraint::Body | ( | expression * | newBody | ) | `[inline, virtual]`

Set body of constraint.

Definition at line 89 of file CouenneProblemElem.hpp.

References body_.

virtual exprAux* Couenne::CouenneConstraint::standardize | ( | CouenneProblem * |  | ) | `[virtual]`

decompose body of constraint through auxiliary variables

Reimplemented in Couenne::CouennePSDcon.

virtual void Couenne::CouenneConstraint::print | ( | std::ostream & | = `std::cout` | ) | `[virtual]`

print constraint

Reimplemented in Couenne::CouennePSDcon.

## Member Data Documentation

expression* Couenne::CouenneConstraint::body_`[protected]`

Body of constraint.

Definition at line 43 of file CouenneProblemElem.hpp.

Referenced by Body(), and ~CouenneConstraint().

expression* Couenne::CouenneConstraint::lb_`[protected]`

Lower bound (expression).

Definition at line 44 of file CouenneProblemElem.hpp.

Referenced by CouenneConstraint(), Lb(), and ~CouenneConstraint().

expression* Couenne::CouenneConstraint::ub_`[protected]`

Upper bound (expression).

Definition at line 45 of file CouenneProblemElem.hpp.

Referenced by CouenneConstraint(), Ub(), and ~CouenneConstraint().

The documentation for this class was generated from the following file:

- CouenneProblemElem.hpp

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines