- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# ClpConstraint Class Reference

Constraint Abstract Base Class. More...

`#include <ClpConstraint.hpp>`

Inheritance diagram for ClpConstraint:

[legend]
List of all members.

## Public Member Functions
Stuff
virtual int | gradient (const ClpSimplex *model, const double *solution, double *gradient, double &functionValue, double &offset, bool useScaling=false, bool refresh=true) const =0
| Fills gradient.
virtual double | functionValue (const ClpSimplex *model, const double *solution, bool useScaling=false, bool refresh=true) const
| Constraint function value.
virtual void | resize (int newNumberColumns)=0
| Resize constraint.
virtual void | deleteSome (int numberToDelete, const int *which)=0
| Delete columns in constraint.
virtual void | reallyScale (const double *columnScale)=0
| Scale constraint.
virtual int | markNonlinear (char *which) const =0
| Given a zeroed array sets nonlinear columns to 1.
virtual int | markNonzero (char *which) const =0
| Given a zeroed array sets possible nonzero coefficients to 1.
Constructors and destructors
| ClpConstraint ()
| Default Constructor.
| ClpConstraint (const ClpConstraint &)
| Copy constructor.
ClpConstraint & | operator= (const ClpConstraint &rhs)
| Assignment operator.
virtual | ~ClpConstraint ()
| Destructor.
virtual ClpConstraint * | clone () const =0
| Clone.
Other
int | type ()
| Returns type, 0 linear, 1 nonlinear.
int | rowNumber () const
| Row number (-1 is objective).
virtual int | numberCoefficients () const =0
| Number of possible coefficients in gradient.
double | functionValue () const
| Stored constraint function value.
double | offset () const
| Constraint offset.
virtual void | newXValues ()
| Say we have new primal solution - so may need to recompute.
## Protected Attributes
Protected member data
double * | lastGradient_
| Gradient at last evaluation.
double | functionValue_
| Value of non-linear part of constraint.
double | offset_
| Value of offset for constraint.
int | type_
| Type of constraint - linear is 1.
int | rowNumber_
| Row number (-1 is objective).

## Detailed Description

Constraint Abstract Base Class.

Abstract Base Class for describing a constraint or objective function

Definition at line 16 of file ClpConstraint.hpp.

## Constructor & Destructor Documentation

ClpConstraint::ClpConstraint | ( |  | ) |

Default Constructor.

ClpConstraint::ClpConstraint | ( | const ClpConstraint & |  | ) |

Copy constructor.

virtual ClpConstraint::~ClpConstraint | ( |  | ) | `[virtual]`

Destructor.

## Member Function Documentation

virtual int ClpConstraint::gradient | ( | const ClpSimplex * | model,
|  | const double * | solution,
|  | double * | gradient,
|  | double & | functionValue,
|  | double & | offset,
|  | bool | useScaling = `false`,
|  | bool | refresh = `true` |
| ) |  |  | const`[pure virtual]`

Fills gradient.

If Linear then solution may be NULL, also returns true value of function and offset so we can use x not deltaX in constraint If refresh is false then uses last solution Uses model for scaling Returns non-zero if gradient undefined at current solution

Implemented in ClpConstraintLinear, and ClpConstraintQuadratic.

virtual double ClpConstraint::functionValue | ( | const ClpSimplex * | model,
|  | const double * | solution,
|  | bool | useScaling = `false`,
|  | bool | refresh = `true` |
| ) |  |  | const`[virtual]`

Constraint function value.

virtual void ClpConstraint::resize | ( | int | newNumberColumns | ) | `[pure virtual]`

Resize constraint.

Implemented in ClpConstraintLinear, and ClpConstraintQuadratic.

virtual void ClpConstraint::deleteSome | ( | int | numberToDelete,
|  | const int * | which |
| ) |  |  | `[pure virtual]`

Delete columns in constraint.

Implemented in ClpConstraintLinear, and ClpConstraintQuadratic.

virtual void ClpConstraint::reallyScale | ( | const double * | columnScale | ) | `[pure virtual]`

Scale constraint.

Implemented in ClpConstraintLinear, and ClpConstraintQuadratic.

virtual int ClpConstraint::markNonlinear | ( | char * | which | ) | const`[pure virtual]`

Given a zeroed array sets nonlinear columns to 1.

Returns number of nonlinear columns

Implemented in ClpConstraintLinear, and ClpConstraintQuadratic.

virtual int ClpConstraint::markNonzero | ( | char * | which | ) | const`[pure virtual]`

Given a zeroed array sets possible nonzero coefficients to 1.

Returns number of nonzeros

Implemented in ClpConstraintLinear, and ClpConstraintQuadratic.

ClpConstraint& ClpConstraint::operator= | ( | const ClpConstraint & | rhs | ) |

Assignment operator.

virtual ClpConstraint* ClpConstraint::clone | ( |  | ) | const`[pure virtual]`

Clone.

Implemented in ClpConstraintLinear, and ClpConstraintQuadratic.

int ClpConstraint::type | ( |  | ) | `[inline]`

Returns type, 0 linear, 1 nonlinear.

Definition at line 80 of file ClpConstraint.hpp.

References type_.

int ClpConstraint::rowNumber | ( |  | ) | const`[inline]`

Row number (-1 is objective).

Definition at line 83 of file ClpConstraint.hpp.

References rowNumber_.

virtual int ClpConstraint::numberCoefficients | ( |  | ) | const`[pure virtual]`

Number of possible coefficients in gradient.

Implemented in ClpConstraintLinear, and ClpConstraintQuadratic.

double ClpConstraint::functionValue | ( |  | ) | const`[inline]`

Stored constraint function value.

Definition at line 90 of file ClpConstraint.hpp.

References functionValue_.

double ClpConstraint::offset | ( |  | ) | const`[inline]`

Constraint offset.

Definition at line 94 of file ClpConstraint.hpp.

References offset_.

virtual void ClpConstraint::newXValues | ( |  | ) | `[inline, virtual]`

Say we have new primal solution - so may need to recompute.

Definition at line 97 of file ClpConstraint.hpp.

## Member Data Documentation

double* ClpConstraint::lastGradient_`[mutable, protected]`

Gradient at last evaluation.

Definition at line 106 of file ClpConstraint.hpp.

double ClpConstraint::functionValue_`[mutable, protected]`

Value of non-linear part of constraint.

Definition at line 108 of file ClpConstraint.hpp.

Referenced by functionValue().

double ClpConstraint::offset_`[mutable, protected]`

Value of offset for constraint.

Definition at line 110 of file ClpConstraint.hpp.

Referenced by offset().

int ClpConstraint::type_`[protected]`

Type of constraint - linear is 1.

Definition at line 112 of file ClpConstraint.hpp.

Referenced by type().

int ClpConstraint::rowNumber_`[protected]`

Row number (-1 is objective).

Definition at line 114 of file ClpConstraint.hpp.

Referenced by rowNumber().

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

- /home/coin/SVN-release/Osi-0.98.1/Clp/src/ClpConstraint.hpp