# ClpObjective Class Reference

Objective Abstract Base Class. More...

`#include <ClpObjective.hpp>`

Inheritance diagram for ClpObjective:
[legend]

List of all members.

## Public Member Functions
Stuff
virtual double * | gradient (const ClpSimplex *model, const double *solution, double &offset, bool refresh, int includeLinear=2)=0
| Returns gradient.
virtual double | reducedGradient (ClpSimplex *model, double *region, bool useFeasibleCosts)=0
| Returns reduced gradient.Returns an offset (to be added to current one).
virtual double | stepLength (ClpSimplex *model, const double *solution, const double *change, double maximumTheta, double &currentObj, double &predictedObj, double &thetaObj)=0
| Returns step length which gives minimum of objective for solution + theta * change vector up to maximum theta.
virtual double | objectiveValue (const ClpSimplex *model, const double *solution) const =0
| Return objective value (without any ClpModel offset) (model may be NULL).
virtual void | resize (int newNumberColumns)=0
| Resize objective.
virtual void | deleteSome (int numberToDelete, const int *which)=0
| Delete columns in objective.
virtual void | reallyScale (const double *columnScale)=0
| Scale objective.
virtual int | markNonlinear (char *which)
| Given a zeroed array sets nonlinear columns to 1.
virtual void | newXValues ()
| Say we have new primal solution - so may need to recompute.
Constructors and destructors
| ClpObjective ()
| Default Constructor.
| ClpObjective (const ClpObjective &)
| Copy constructor.
ClpObjective & | operator= (const ClpObjective &rhs)
| Assignment operator.
virtual | ~ClpObjective ()
| Destructor.
virtual ClpObjective * | clone () const =0
| Clone.
virtual ClpObjective * | subsetClone (int numberColumns, const int *whichColumns) const
| Subset clone.
Other
int | type () const
| Returns type (above 63 is extra information).
void | setType (int value)
| Sets type (above 63 is extra information).
int | activated () const
| Whether activated.
void | setActivated (int value)
| Set whether activated.
double | nonlinearOffset () const
| Objective offset.
## Protected Attributes
Protected member data
double | offset_
| Value of non-linear part of objective.
int | type_
| Type of objective - linear is 1.
int | activated_
| Whether activated.

## Detailed Description

Objective Abstract Base Class.

Abstract Base Class for describing an objective function

Definition at line 19 of file ClpObjective.hpp.

## Constructor & Destructor Documentation

ClpObjective::ClpObjective | ( |  | ) |

Default Constructor.

ClpObjective::ClpObjective | ( | const ClpObjective & |  | ) |

Copy constructor.

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

Destructor.

## Member Function Documentation

virtual double* ClpObjective::gradient | ( | const ClpSimplex * | model,
|  | const double * | solution,
|  | double & | offset,
|  | bool | refresh,
|  | int | includeLinear = `2` |
| ) |  |  | `[pure virtual]`

Returns gradient.

If Linear then solution may be NULL, also returns an offset (to be added to current one) If refresh is false then uses last solution Uses model for scaling includeLinear 0 - no, 1 as is, 2 as feasible

Implemented in ClpLinearObjective, and ClpQuadraticObjective.

virtual double ClpObjective::reducedGradient | ( | ClpSimplex * | model,
|  | double * | region,
|  | bool | useFeasibleCosts |
| ) |  |  | `[pure virtual]`

Returns reduced gradient.Returns an offset (to be added to current one).

Implemented in ClpLinearObjective, and ClpQuadraticObjective.

virtual double ClpObjective::stepLength | ( | ClpSimplex * | model,
|  | const double * | solution,
|  | const double * | change,
|  | double | maximumTheta,
|  | double & | currentObj,
|  | double & | predictedObj,
|  | double & | thetaObj |
| ) |  |  | `[pure virtual]`

Returns step length which gives minimum of objective for solution + theta * change vector up to maximum theta.

arrays are numberColumns+numberRows Also sets current objective, predicted and at maximumTheta

Implemented in ClpLinearObjective, and ClpQuadraticObjective.

virtual double ClpObjective::objectiveValue | ( | const ClpSimplex * | model,
|  | const double * | solution |
| ) |  |  | const`[pure virtual]`

Return objective value (without any ClpModel offset) (model may be NULL).

Implemented in ClpLinearObjective, and ClpQuadraticObjective.

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

Resize objective.

Implemented in ClpLinearObjective, and ClpQuadraticObjective.

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

Delete columns in objective.

Implemented in ClpLinearObjective, and ClpQuadraticObjective.

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

Scale objective.

Implemented in ClpLinearObjective, and ClpQuadraticObjective.

virtual int ClpObjective::markNonlinear | ( | char * | which | ) | `[virtual]`

Given a zeroed array sets nonlinear columns to 1.

Returns number of nonlinear columns

Reimplemented in ClpQuadraticObjective.

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

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

Definition at line 66 of file ClpObjective.hpp.

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

Assignment operator.

Reimplemented in ClpLinearObjective, and ClpQuadraticObjective.

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

Clone.

Implemented in ClpLinearObjective, and ClpQuadraticObjective.

virtual ClpObjective* ClpObjective::subsetClone | ( | int | numberColumns,
|  | const int * | whichColumns |
| ) |  |  | const`[virtual]`

Subset clone.

Duplicates are allowed and order is as given. Derived classes need not provide this as it may not always make sense

Reimplemented in ClpLinearObjective, and ClpQuadraticObjective.

int ClpObjective::type | ( |  | ) | const`[inline]`

Returns type (above 63 is extra information).

Definition at line 98 of file ClpObjective.hpp.

void ClpObjective::setType | ( | int | value | ) | `[inline]`

Sets type (above 63 is extra information).

Definition at line 102 of file ClpObjective.hpp.

int ClpObjective::activated | ( |  | ) | const`[inline]`

Whether activated.

Definition at line 106 of file ClpObjective.hpp.

void ClpObjective::setActivated | ( | int | value | ) | `[inline]`

Set whether activated.

Definition at line 110 of file ClpObjective.hpp.

double ClpObjective::nonlinearOffset | ( |  | ) | const`[inline]`

Objective offset.

Definition at line 115 of file ClpObjective.hpp.

## Member Data Documentation

double ClpObjective::offset_`[protected]`

Value of non-linear part of objective.

Definition at line 126 of file ClpObjective.hpp.

int ClpObjective::type_`[protected]`

Type of objective - linear is 1.

Definition at line 128 of file ClpObjective.hpp.

int ClpObjective::activated_`[protected]`

Whether activated.

Definition at line 130 of file ClpObjective.hpp.

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

- /home/coin/svn-release/Alps-1.4.8/Clp/src/ClpObjective.hpp