Clp trunk
ClpNonLinearCost Class Reference

#include <ClpNonLinearCost.hpp>

Collaboration diagram for ClpNonLinearCost:

List of all members.

Public Member Functions

Constructors, destructor
 ClpNonLinearCost ()
 Default constructor.
 ClpNonLinearCost (ClpSimplex *model, int method=1)
 Constructor from simplex.
 ClpNonLinearCost (ClpSimplex *model, const int *starts, const double *lower, const double *cost)
 Constructor from simplex and list of non-linearities (columns only) First lower of each column has to match real lower Last lower has to be <= upper (if == then cost ignored) This could obviously be changed to make more user friendly.
 ~ClpNonLinearCost ()
 Destructor.
 ClpNonLinearCost (const ClpNonLinearCost &)
ClpNonLinearCostoperator= (const ClpNonLinearCost &)
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.
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.
double setOne (int sequence, double solutionValue)
 Sets bounds and cost for one variable Returns change in cost May need to be inline for speed.
void setOne (int sequence, double solutionValue, double lowerValue, double upperValue, double costValue=0.0)
 Sets bounds and infeasible cost and true cost for one variable This is for gub and column generation etc.
int setOneOutgoing (int sequence, double &solutionValue)
 Sets bounds and cost for outgoing variable may change value Returns direction.
double nearest (int sequence, double solutionValue)
 Returns nearest bound.
double changeInCost (int sequence, double alpha) const
 Returns change in cost - one down if alpha >0.0, up if <0.0 Value is current - new.
double changeUpInCost (int sequence) const
double changeDownInCost (int sequence) const
double changeInCost (int sequence, double alpha, double &rhs)
 This also updates next bound.
double lower (int sequence) const
 Returns current lower bound.
double upper (int sequence) const
 Returns current upper bound.
double cost (int sequence) const
 Returns current cost.
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)
void setChangeInCost (double value)
void setMethod (int value)
bool lookBothWays () const
 See if may want to look both ways.
Private functions to deal with infeasible regions
bool infeasible (int i) const
void setInfeasible (int i, bool trueFalse)
unsigned char * statusArray () const
void validate ()
 For debug.

Detailed Description

Definition at line 78 of file ClpNonLinearCost.hpp.


Constructor & Destructor Documentation

ClpNonLinearCost::ClpNonLinearCost ( )

Default constructor.

ClpNonLinearCost::ClpNonLinearCost ( ClpSimplex model,
int  method = 1 
)

Constructor from simplex.

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

ClpNonLinearCost::ClpNonLinearCost ( ClpSimplex model,
const int *  starts,
const double *  lower,
const double *  cost 
)

Constructor from simplex and list of non-linearities (columns only) First lower of each column has to match real lower Last lower has to be <= upper (if == then cost ignored) This could obviously be changed to make more user friendly.

ClpNonLinearCost::~ClpNonLinearCost ( )

Destructor.

ClpNonLinearCost::ClpNonLinearCost ( const ClpNonLinearCost )

Member Function Documentation

ClpNonLinearCost& ClpNonLinearCost::operator= ( const ClpNonLinearCost )
void ClpNonLinearCost::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 ClpNonLinearCost::checkInfeasibilities ( int  numberInArray,
const int *  index 
)

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

void ClpNonLinearCost::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 ClpNonLinearCost::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 ClpNonLinearCost::goBack ( int  numberInArray,
const int *  index,
double *  rhs 
)

Takes off last iteration (i.e.

offsets closer to 0)

void ClpNonLinearCost::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 ClpNonLinearCost::zapCosts ( )

Temporary zeroing of feasible costs.

void ClpNonLinearCost::refreshCosts ( const double *  columnCosts)

Refreshes costs always makes row costs zero.

void ClpNonLinearCost::feasibleBounds ( )

Puts feasible bounds into lower and upper.

double ClpNonLinearCost::setOne ( int  sequence,
double  solutionValue 
)

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

void ClpNonLinearCost::setOne ( int  sequence,
double  solutionValue,
double  lowerValue,
double  upperValue,
double  costValue = 0.0 
)

Sets bounds and infeasible cost and true cost for one variable This is for gub and column generation etc.

int ClpNonLinearCost::setOneOutgoing ( int  sequence,
double &  solutionValue 
)

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

double ClpNonLinearCost::nearest ( int  sequence,
double  solutionValue 
)

Returns nearest bound.

double ClpNonLinearCost::changeInCost ( int  sequence,
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 169 of file ClpNonLinearCost.hpp.

double ClpNonLinearCost::changeUpInCost ( int  sequence) const [inline]

Definition at line 183 of file ClpNonLinearCost.hpp.

double ClpNonLinearCost::changeDownInCost ( int  sequence) const [inline]

Definition at line 197 of file ClpNonLinearCost.hpp.

double ClpNonLinearCost::changeInCost ( int  sequence,
double  alpha,
double &  rhs 
) [inline]

This also updates next bound.

Definition at line 212 of file ClpNonLinearCost.hpp.

double ClpNonLinearCost::lower ( int  sequence) const [inline]

Returns current lower bound.

Definition at line 271 of file ClpNonLinearCost.hpp.

double ClpNonLinearCost::upper ( int  sequence) const [inline]

Returns current upper bound.

Definition at line 275 of file ClpNonLinearCost.hpp.

double ClpNonLinearCost::cost ( int  sequence) const [inline]

Returns current cost.

Definition at line 279 of file ClpNonLinearCost.hpp.

int ClpNonLinearCost::numberInfeasibilities ( ) const [inline]

Number of infeasibilities.

Definition at line 288 of file ClpNonLinearCost.hpp.

double ClpNonLinearCost::changeInCost ( ) const [inline]

Change in cost.

Definition at line 292 of file ClpNonLinearCost.hpp.

double ClpNonLinearCost::feasibleCost ( ) const [inline]

Feasible cost.

Definition at line 296 of file ClpNonLinearCost.hpp.

double ClpNonLinearCost::feasibleReportCost ( ) const

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

double ClpNonLinearCost::sumInfeasibilities ( ) const [inline]

Sum of infeasibilities.

Definition at line 302 of file ClpNonLinearCost.hpp.

double ClpNonLinearCost::largestInfeasibility ( ) const [inline]

Largest infeasibility.

Definition at line 306 of file ClpNonLinearCost.hpp.

double ClpNonLinearCost::averageTheta ( ) const [inline]

Average theta.

Definition at line 310 of file ClpNonLinearCost.hpp.

void ClpNonLinearCost::setAverageTheta ( double  value) [inline]

Definition at line 313 of file ClpNonLinearCost.hpp.

void ClpNonLinearCost::setChangeInCost ( double  value) [inline]

Definition at line 316 of file ClpNonLinearCost.hpp.

void ClpNonLinearCost::setMethod ( int  value) [inline]

Definition at line 319 of file ClpNonLinearCost.hpp.

bool ClpNonLinearCost::lookBothWays ( ) const [inline]

See if may want to look both ways.

Definition at line 323 of file ClpNonLinearCost.hpp.

bool ClpNonLinearCost::infeasible ( int  i) const [inline]

Definition at line 328 of file ClpNonLinearCost.hpp.

void ClpNonLinearCost::setInfeasible ( int  i,
bool  trueFalse 
) [inline]

Definition at line 331 of file ClpNonLinearCost.hpp.

unsigned char* ClpNonLinearCost::statusArray ( ) const [inline]

Definition at line 339 of file ClpNonLinearCost.hpp.

void ClpNonLinearCost::validate ( )

For debug.


The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines