#include <ClpNonLinearCost.hpp>
Public Member Functions | |
Constructors, destructor | |
ClpNonLinearCost () | |
Default constructor. | |
ClpNonLinearCost (ClpSimplex *model) | |
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 &) | |
Default constructor. | |
ClpNonLinearCost & | operator= (const ClpNonLinearCost &) |
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. | |
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 |
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 sequence) 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 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) |
Number of infeasibilities. | |
void | setChangeInCost (double value) |
Number of infeasibilities. | |
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) |
Private Attributes | |
Data members | |
double | changeCost_ |
Change in cost because of infeasibilities. | |
double | feasibleCost_ |
Feasible cost. | |
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). | |
int * | start_ |
Starts for each entry (columns then rows). | |
int * | whichRange_ |
Range for each entry (columns then rows). | |
int * | offset_ |
Temporary range offset for each entry (columns then rows). | |
double * | lower_ |
Lower bound for each range (upper bound is next lower). | |
double * | cost_ |
Cost for each range. | |
ClpSimplex * | model_ |
Model. | |
unsigned int * | infeasible_ |
Change in cost because of infeasibilities. | |
int | numberInfeasibilities_ |
Number of infeasibilities found. | |
bool | convex_ |
If all non-linear costs convex. | |
bool | bothWays_ |
If we should look both ways for djs. |
I don't make any explicit assumptions about convexity but I am sure I do make implicit ones.
One interesting idea for normal LP's will be to allow non-basic variables to come into basis as infeasible i.e. if variable at lower bound has very large positive reduced cost (when problem is infeasible) could it reduce overall problem infeasibility more by bringing it into basis below its lower bound.
Another feature would be to automatically discover when problems are convex piecewise linear and re-formulate to use non-linear. I did some work on this many years ago on "grade" problems, but while it improved primal interior point algorithms were much better for that particular problem.
Definition at line 30 of file ClpNonLinearCost.hpp.
|
Default constructor.
|
|
Constructor from simplex. This will just set up wasteful arrays for linear, but later may do dual analysis and even finding duplicate columns . |
|
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.
|
|
Destructor.
|
|
Default constructor.
|
|
Default constructor.
|
|
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.
|
|
Changes infeasible costs for each variable The indices are row indices and need converting to sequences.
|
|
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 |
|
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 |
|
Takes off last iteration (i.e. offsets closer to 0) |
|
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 |
|
Temporary zeroing of feasible costs.
|
|
Sets bounds and cost for one variable Returns change in cost May need to be inline for speed.
|
|
Sets bounds and infeasible cost and true cost for one variable This is for gub and column generation etc.
|
|
Sets bounds and cost for outgoing variable may change value Returns direction.
|
|
Returns nearest bound.
|
|
Returns change in cost - one down if alpha >0.0, up if <0.0 Value is current - new.
Definition at line 117 of file ClpNonLinearCost.hpp. References cost_, offset_, and whichRange_. |
|
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 125 of file ClpNonLinearCost.hpp. References cost_, infeasible(), offset_, start_, and whichRange_. |
|
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 133 of file ClpNonLinearCost.hpp. References cost_, infeasible(), offset_, start_, and whichRange_. |
|
This also updates next bound.
Definition at line 142 of file ClpNonLinearCost.hpp. References cost_, lower_, offset_, start_, and whichRange_. |
|
Returns current lower bound.
Definition at line 158 of file ClpNonLinearCost.hpp. References lower_, offset_, and whichRange_. |
|
Returns current upper bound.
Definition at line 161 of file ClpNonLinearCost.hpp. References lower_, offset_, and whichRange_. |
|
Returns current cost.
Definition at line 164 of file ClpNonLinearCost.hpp. References cost_, offset_, and whichRange_. |
|
Number of infeasibilities.
Definition at line 172 of file ClpNonLinearCost.hpp. References numberInfeasibilities_. |
|
Change in cost.
Definition at line 175 of file ClpNonLinearCost.hpp. References changeCost_. |
|
Feasible cost.
Definition at line 178 of file ClpNonLinearCost.hpp. References feasibleCost_. |
|
Feasible cost with offset and direction (i.e. for reporting).
|
|
Sum of infeasibilities.
Definition at line 183 of file ClpNonLinearCost.hpp. References sumInfeasibilities_. |
|
Largest infeasibility.
Definition at line 186 of file ClpNonLinearCost.hpp. References largestInfeasibility_. |
|
Average theta.
Definition at line 189 of file ClpNonLinearCost.hpp. References averageTheta_. |
|
Number of infeasibilities.
Definition at line 191 of file ClpNonLinearCost.hpp. References averageTheta_. |
|
Number of infeasibilities.
Definition at line 193 of file ClpNonLinearCost.hpp. References changeCost_. |
|
See if may want to look both ways.
Definition at line 196 of file ClpNonLinearCost.hpp. References bothWays_. |
|
Definition at line 200 of file ClpNonLinearCost.hpp. References infeasible_. Referenced by changeDownInCost(), and changeUpInCost(). |
|
Definition at line 203 of file ClpNonLinearCost.hpp. References infeasible_. |
|
Change in cost because of infeasibilities.
Definition at line 217 of file ClpNonLinearCost.hpp. Referenced by changeInCost(), and setChangeInCost(). |
|
Feasible cost.
Definition at line 219 of file ClpNonLinearCost.hpp. Referenced by feasibleCost(). |
|
Largest infeasibility.
Definition at line 221 of file ClpNonLinearCost.hpp. Referenced by largestInfeasibility(). |
|
Sum of infeasibilities.
Definition at line 223 of file ClpNonLinearCost.hpp. Referenced by sumInfeasibilities(). |
|
Average theta - kept here as only for primal.
Definition at line 225 of file ClpNonLinearCost.hpp. Referenced by averageTheta(), and setAverageTheta(). |
|
Number of rows (mainly for checking and copy).
Definition at line 227 of file ClpNonLinearCost.hpp. |
|
Number of columns (mainly for checking and copy).
Definition at line 229 of file ClpNonLinearCost.hpp. |
|
Starts for each entry (columns then rows).
Definition at line 231 of file ClpNonLinearCost.hpp. Referenced by changeDownInCost(), changeInCost(), and changeUpInCost(). |
|
Range for each entry (columns then rows).
Definition at line 233 of file ClpNonLinearCost.hpp. Referenced by changeDownInCost(), changeInCost(), changeUpInCost(), cost(), lower(), and upper(). |
|
Temporary range offset for each entry (columns then rows).
Definition at line 235 of file ClpNonLinearCost.hpp. Referenced by changeDownInCost(), changeInCost(), changeUpInCost(), cost(), lower(), and upper(). |
|
Lower bound for each range (upper bound is next lower). For various reasons there is always an infeasible range at bottom - even if lower bound is - infinity Definition at line 239 of file ClpNonLinearCost.hpp. Referenced by changeInCost(), lower(), and upper(). |
|
Cost for each range.
Definition at line 241 of file ClpNonLinearCost.hpp. Referenced by changeDownInCost(), changeInCost(), changeUpInCost(), and cost(). |
|
Model.
Definition at line 243 of file ClpNonLinearCost.hpp. |
|
Change in cost because of infeasibilities.
Definition at line 245 of file ClpNonLinearCost.hpp. Referenced by infeasible(), and setInfeasible(). |
|
Number of infeasibilities found.
Definition at line 247 of file ClpNonLinearCost.hpp. Referenced by numberInfeasibilities(). |
|
If all non-linear costs convex.
Definition at line 249 of file ClpNonLinearCost.hpp. |
|
If we should look both ways for djs.
Definition at line 251 of file ClpNonLinearCost.hpp. Referenced by lookBothWays(). |