# AbcNonLinearCost Class Reference

`#include <AbcNonLinearCost.hpp>`

Collaboration diagram for AbcNonLinearCost:
[legend]

List of all members.

## Public Member Functions
Constructors, destructor
| AbcNonLinearCost ()
| Default constructor.
| AbcNonLinearCost (AbcSimplex *model)
| Constructor from simplex.
| ~AbcNonLinearCost ()
| Destructor.
| AbcNonLinearCost (const AbcNonLinearCost &)
| Default constructor.
AbcNonLinearCost & | operator= (const AbcNonLinearCost &)
| Default constructor.
Actual work in primal
void | checkInfeasibilities (double oldTolerance=0.0)
| Changes infeasible costs and computes number and cost of infeas Puts all non-basic (non free) variables to bounds and all free variables to zero if oldTolerance is non-zero but does not move those <= oldTolerance away.
void | checkInfeasibilities (int numberInArray, const int *index)
| Changes infeasible costs for each variable The indices are row indices and need converting to sequences.
void | checkChanged (int numberInArray, CoinIndexedVector *update)
| Puts back correct infeasible costs for each variable The input indices are row indices and need converting to sequences for costs.
void | goThru (int numberInArray, double multiplier, const int *index, const double *work, double *rhs)
| Goes through one bound for each variable.
void | goBack (int numberInArray, const int *index, double *rhs)
| Takes off last iteration (i.e.
void | goBackAll (const CoinIndexedVector *update)
| Puts back correct infeasible costs for each variable The input indices are row indices and need converting to sequences for costs.
void | zapCosts ()
| Temporary zeroing of feasible costs.
void | refreshCosts (const double *columnCosts)
| Refreshes costs always makes row costs zero.
void | feasibleBounds ()
| Puts feasible bounds into lower and upper.
void | refresh ()
| Refresh - assuming regions OK.
void | refreshFromPerturbed (double tolerance)
| Refresh - from original.
double | setOne (int sequence, double solutionValue)
| Sets bounds and cost for one variable Returns change in cost May need to be inline for speed.
double | setOneBasic (int iRow, double solutionValue)
| Sets bounds and cost for one variable Returns change in cost May need to be inline for speed.
int | setOneOutgoing (int sequence, double &solutionValue)
| Sets bounds and cost for outgoing variable may change value Returns direction.
double | nearest (int iRow, double solutionValue)
| Returns nearest bound.
double | changeInCost (int, double alpha) const
| Returns change in cost - one down if alpha >0.0, up if <0.0 Value is current - new.
double | changeUpInCost (int) const
| Changes infeasible costs and computes number and cost of infeas Puts all non-basic (non free) variables to bounds and all free variables to zero if oldTolerance is non-zero but does not move those <= oldTolerance away.
double | changeDownInCost (int) const
| Changes infeasible costs and computes number and cost of infeas Puts all non-basic (non free) variables to bounds and all free variables to zero if oldTolerance is non-zero but does not move those <= oldTolerance away.
double | changeInCost (int iRow, double alpha, double &rhs)
| This also updates next bound.
Gets and sets
int | numberInfeasibilities () const
| Number of infeasibilities.
double | changeInCost () const
| Change in cost.
double | feasibleCost () const
| Feasible cost.
double | feasibleReportCost () const
| Feasible cost with offset and direction (i.e. for reporting).
double | sumInfeasibilities () const
| Sum of infeasibilities.
double | largestInfeasibility () const
| Largest infeasibility.
double | averageTheta () const
| Average theta.
void | setAverageTheta (double value)
| Number of infeasibilities.
void | setChangeInCost (double value)
| Number of infeasibilities.
Private functions to deal with infeasible regions
unsigned char * | statusArray () const
| For debug.
int | getCurrentStatus (int sequence)
| For debug.
void | validate ()
| For debug.
## Private Attributes
Data members
double | changeCost_
| Change in cost because of infeasibilities.
double | feasibleCost_
| Feasible cost.
double | infeasibilityWeight_
| Current infeasibility weight.
double | largestInfeasibility_
| Largest infeasibility.
double | sumInfeasibilities_
| Sum of infeasibilities.
double | averageTheta_
| Average theta - kept here as only for primal.
int | numberRows_
| Number of rows (mainly for checking and copy).
int | numberColumns_
| Number of columns (mainly for checking and copy).
AbcSimplex * | model_
| Model.
int | numberInfeasibilities_
| Number of infeasibilities found.
unsigned char * | status_
| Contains status at beginning and current.
double * | bound_
| Bound which has been replaced in lower_ or upper_.
double * | cost_
| Feasible cost array.

## Detailed Description

Definition at line 72 of file AbcNonLinearCost.hpp.

## Constructor & Destructor Documentation

AbcNonLinearCost::AbcNonLinearCost | ( |  | ) |

Default constructor.

AbcNonLinearCost::AbcNonLinearCost | ( | AbcSimplex * | model | ) |

Constructor from simplex.

This will just set up wasteful arrays for linear, but later may do dual analysis and even finding duplicate columns .

AbcNonLinearCost::~AbcNonLinearCost | ( |  | ) |

Destructor.

AbcNonLinearCost::AbcNonLinearCost | ( | const AbcNonLinearCost & |  | ) |

Default constructor.

## Member Function Documentation

AbcNonLinearCost& AbcNonLinearCost::operator= | ( | const AbcNonLinearCost & |  | ) |

Default constructor.

void AbcNonLinearCost::checkInfeasibilities | ( | double | oldTolerance = `0.0` | ) |

Changes infeasible costs and computes number and cost of infeas Puts all non-basic (non free) variables to bounds and all free variables to zero if oldTolerance is non-zero

- but does not move those <= oldTolerance away.

void AbcNonLinearCost::checkInfeasibilities | ( | int | numberInArray,
|  | const int * | index |
| ) |  |  |

Changes infeasible costs for each variable The indices are row indices and need converting to sequences.

void AbcNonLinearCost::checkChanged | ( | int | numberInArray,
|  | CoinIndexedVector * | update |
| ) |  |  |

Puts back correct infeasible costs for each variable The input indices are row indices and need converting to sequences for costs.

On input array is empty (but indices exist). On exit just changed costs will be stored as normal CoinIndexedVector

void AbcNonLinearCost::goThru | ( | int | numberInArray,
|  | double | multiplier,
|  | const int * | index,
|  | const double * | work,
|  | double * | rhs |
| ) |  |  |

Goes through one bound for each variable.

If multiplier*work[iRow]>0 goes down, otherwise up. The indices are row indices and need converting to sequences Temporary offsets may be set Rhs entries are increased

void AbcNonLinearCost::goBack | ( | int | numberInArray,
|  | const int * | index,
|  | double * | rhs |
| ) |  |  |

Takes off last iteration (i.e.

offsets closer to 0)

void AbcNonLinearCost::goBackAll | ( | const CoinIndexedVector * | update | ) |

Puts back correct infeasible costs for each variable The input indices are row indices and need converting to sequences for costs.

At the end of this all temporary offsets are zero

void AbcNonLinearCost::zapCosts | ( |  | ) |

Temporary zeroing of feasible costs.

void AbcNonLinearCost::refreshCosts | ( | const double * | columnCosts | ) |

Refreshes costs always makes row costs zero.

void AbcNonLinearCost::feasibleBounds | ( |  | ) |

Puts feasible bounds into lower and upper.

void AbcNonLinearCost::refresh | ( |  | ) |

Refresh - assuming regions OK.

void AbcNonLinearCost::refreshFromPerturbed | ( | double | tolerance | ) |

Refresh - from original.

double AbcNonLinearCost::setOne | ( | int | sequence,
|  | double | solutionValue |
| ) |  |  |

Sets bounds and cost for one variable Returns change in cost May need to be inline for speed.

double AbcNonLinearCost::setOneBasic | ( | int | iRow,
|  | double | solutionValue |
| ) |  |  |

Sets bounds and cost for one variable Returns change in cost May need to be inline for speed.

int AbcNonLinearCost::setOneOutgoing | ( | int | sequence,
|  | double & | solutionValue |
| ) |  |  |

Sets bounds and cost for outgoing variable may change value Returns direction.

double AbcNonLinearCost::nearest | ( | int | iRow,
|  | double | solutionValue |
| ) |  |  |

Returns nearest bound.

double AbcNonLinearCost::changeInCost | ( | int | ,
|  | double | alpha |
| ) |  |  | const`[inline]`

Returns change in cost - one down if alpha >0.0, up if <0.0 Value is current - new.

Definition at line 158 of file AbcNonLinearCost.hpp.

double AbcNonLinearCost::changeUpInCost | ( | int |  | ) | const`[inline]`

Changes infeasible costs and computes number and cost of infeas Puts all non-basic (non free) variables to bounds and all free variables to zero if oldTolerance is non-zero

- but does not move those <= oldTolerance away.

Definition at line 161 of file AbcNonLinearCost.hpp.

double AbcNonLinearCost::changeDownInCost | ( | int |  | ) | const`[inline]`

Changes infeasible costs and computes number and cost of infeas Puts all non-basic (non free) variables to bounds and all free variables to zero if oldTolerance is non-zero

- but does not move those <= oldTolerance away.

Definition at line 164 of file AbcNonLinearCost.hpp.

double AbcNonLinearCost::changeInCost | ( | int | iRow,
|  | double | alpha,
|  | double & | rhs |
| ) |  |  | `[inline]`

This also updates next bound.

Definition at line 168 of file AbcNonLinearCost.hpp.

int AbcNonLinearCost::numberInfeasibilities | ( |  | ) | const`[inline]`

Number of infeasibilities.

Definition at line 207 of file AbcNonLinearCost.hpp.

double AbcNonLinearCost::changeInCost | ( |  | ) | const`[inline]`

Change in cost.

Definition at line 211 of file AbcNonLinearCost.hpp.

double AbcNonLinearCost::feasibleCost | ( |  | ) | const`[inline]`

Feasible cost.

Definition at line 215 of file AbcNonLinearCost.hpp.

double AbcNonLinearCost::feasibleReportCost | ( |  | ) | const

Feasible cost with offset and direction (i.e. for reporting).

double AbcNonLinearCost::sumInfeasibilities | ( |  | ) | const`[inline]`

Sum of infeasibilities.

Definition at line 221 of file AbcNonLinearCost.hpp.

double AbcNonLinearCost::largestInfeasibility | ( |  | ) | const`[inline]`

Largest infeasibility.

Definition at line 225 of file AbcNonLinearCost.hpp.

double AbcNonLinearCost::averageTheta | ( |  | ) | const`[inline]`

Average theta.

Definition at line 229 of file AbcNonLinearCost.hpp.

void AbcNonLinearCost::setAverageTheta | ( | double | value | ) | `[inline]`

Number of infeasibilities.

Definition at line 232 of file AbcNonLinearCost.hpp.

void AbcNonLinearCost::setChangeInCost | ( | double | value | ) | `[inline]`

Number of infeasibilities.

Definition at line 235 of file AbcNonLinearCost.hpp.

unsigned char* AbcNonLinearCost::statusArray | ( |  | ) | const`[inline]`

For debug.

Definition at line 240 of file AbcNonLinearCost.hpp.

int AbcNonLinearCost::getCurrentStatus | ( | int | sequence | ) | `[inline]`

For debug.

Definition at line 243 of file AbcNonLinearCost.hpp.

void AbcNonLinearCost::validate | ( |  | ) |

For debug.

## Member Data Documentation

double AbcNonLinearCost::changeCost_`[private]`

Change in cost because of infeasibilities.

Definition at line 253 of file AbcNonLinearCost.hpp.

double AbcNonLinearCost::feasibleCost_`[private]`

Feasible cost.

Definition at line 255 of file AbcNonLinearCost.hpp.

double AbcNonLinearCost::infeasibilityWeight_`[private]`

Current infeasibility weight.

Definition at line 257 of file AbcNonLinearCost.hpp.

double AbcNonLinearCost::largestInfeasibility_`[private]`

Largest infeasibility.

Definition at line 259 of file AbcNonLinearCost.hpp.

double AbcNonLinearCost::sumInfeasibilities_`[private]`

Sum of infeasibilities.

Definition at line 261 of file AbcNonLinearCost.hpp.

double AbcNonLinearCost::averageTheta_`[private]`

Average theta - kept here as only for primal.

Definition at line 263 of file AbcNonLinearCost.hpp.

int AbcNonLinearCost::numberRows_`[private]`

Number of rows (mainly for checking and copy).

Definition at line 265 of file AbcNonLinearCost.hpp.

int AbcNonLinearCost::numberColumns_`[private]`

Number of columns (mainly for checking and copy).

Definition at line 267 of file AbcNonLinearCost.hpp.

AbcSimplex* AbcNonLinearCost::model_`[private]`

Model.

Definition at line 269 of file AbcNonLinearCost.hpp.

int AbcNonLinearCost::numberInfeasibilities_`[private]`

Number of infeasibilities found.

Definition at line 271 of file AbcNonLinearCost.hpp.

unsigned char* AbcNonLinearCost::status_`[private]`

Contains status at beginning and current.

Definition at line 274 of file AbcNonLinearCost.hpp.

double* AbcNonLinearCost::bound_`[private]`

Bound which has been replaced in lower_ or upper_.

Definition at line 276 of file AbcNonLinearCost.hpp.

double* AbcNonLinearCost::cost_`[private]`

Feasible cost array.

Definition at line 278 of file AbcNonLinearCost.hpp.

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

- /home/coin/svn-release/Alps-1.5.0/Clp/src/AbcNonLinearCost.hpp