Go to the documentation of this file.
6 #ifndef AbcNonLinearCost_H
7 #define AbcNonLinearCost_H
9 #include "CoinPragma.hpp"
13 class CoinIndexedVector;
38 #define CLP_BELOW_LOWER 0
39 #define CLP_FEASIBLE 1
40 #define CLP_ABOVE_UPPER 2
42 #ifndef ClpNonLinearCost_H
53 status = static_cast< unsigned char >(status & ~15);
54 status = static_cast< unsigned char >(status | value);
58 status = static_cast< unsigned char >(status & ~(15 << 4));
59 status = static_cast< unsigned char >(status | (value << 4));
67 status = static_cast< unsigned char >(status & ~(15 << 4));
68 status = static_cast< unsigned char >(status | (
CLP_SAME << 4));
108 void checkChanged(
int numberInArray, CoinIndexedVector *update);
115 void goThru(
int numberInArray,
double multiplier,
116 const int *index,
const double *work,
120 void goBack(
int numberInArray,
const int *index,
127 void goBackAll(
const CoinIndexedVector *update);
141 double setOne(
int sequence,
double solutionValue);
145 double setOneBasic(
int iRow,
double solutionValue);
151 double nearest(
int iRow,
double solutionValue);
157 return (alpha > 0.0) ? infeasibilityWeight_ : -infeasibilityWeight_;
161 return -infeasibilityWeight_;
165 return infeasibilityWeight_;
171 double returnValue = 0.0;
172 unsigned char iStatus = status_[sequence];
191 rhs += bound_[sequence] - model_->
upperRegion()[sequence];
196 rhs += model_->
lowerRegion()[sequence] - bound_[sequence];
199 returnValue = fabs(alpha) * infeasibilityWeight_;
209 return numberInfeasibilities_;
219 return feasibleCost_;
226 return sumInfeasibilities_;
231 return largestInfeasibility_;
236 return averageTheta_;
240 averageTheta_ = value;
254 return (status_[sequence] >> 4);
266 double feasibleCost_;
268 double infeasibilityWeight_;
270 double largestInfeasibility_;
272 double sumInfeasibilities_;
274 double averageTheta_;
282 int numberInfeasibilities_;
285 unsigned char *status_;
void goThru(int numberInArray, double multiplier, const int *index, const double *work, double *rhs)
Goes through one bound for each variable.
void setOriginalStatus(unsigned char &status, int value)
double sumInfeasibilities() const
Sum of infeasibilities.
double * upperRegion() const
void setInitialStatus(unsigned char &status)
void checkChanged(int numberInArray, CoinIndexedVector *update)
Puts back correct infeasible costs for each variable The input indices are row indices and need conve...
~AbcNonLinearCost()
Destructor.
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 nearest(int iRow, double solutionValue)
Returns nearest bound.
double changeUpInCost(int) const
void setCurrentStatus(unsigned char &status, int value)
double changeInCost() const
Change in cost.
void checkInfeasibilities(double oldTolerance=0.0)
Changes infeasible costs and computes number and cost of infeas Puts all non-basic (non free) variabl...
void setChangeInCost(double value)
double changeInCost(int, double alpha) const
Returns change in cost - one down if alpha >0.0, up if <0.0 Value is current - new.
void zapCosts()
Temporary zeroing of feasible costs.
int getCurrentStatus(int sequence)
int setOneOutgoing(int sequence, double &solutionValue)
Sets bounds and cost for outgoing variable may change value Returns direction.
int currentStatus(unsigned char status)
void validate()
For debug.
void goBackAll(const CoinIndexedVector *update)
Puts back correct infeasible costs for each variable The input indices are row indices and need conve...
AbcNonLinearCost()
Default constructor.
int * pivotVariable() const
Basic variables pivoting on which rows may be same as toExternal but may be as at invert.
double largestInfeasibility() const
Largest infeasibility.
double feasibleCost() const
Feasible cost.
double * lowerRegion() const
AbcNonLinearCost & operator=(const AbcNonLinearCost &)
double changeDownInCost(int) const
void refresh()
Refresh - assuming regions OK.
double changeInCost(int iRow, double alpha, double &rhs)
This also updates next bound.
void feasibleBounds()
Puts feasible bounds into lower and upper.
void setAverageTheta(double value)
int originalStatus(unsigned char status)
double setOneBasic(int iRow, double solutionValue)
Sets bounds and cost for one variable Returns change in cost May need to be inline for speed.
void setSameStatus(unsigned char &status)
unsigned char * statusArray() const
void refreshFromPerturbed(double tolerance)
Refresh - from original.
int numberInfeasibilities() const
Number of infeasibilities.
void goBack(int numberInArray, const int *index, double *rhs)
Takes off last iteration (i.e.
void refreshCosts(const double *columnCosts)
Refreshes costs always makes row costs zero.
#define CLP_BELOW_LOWER
Trivial class to deal with non linear costs.
double feasibleReportCost() const
Feasible cost with offset and direction (i.e. for reporting)
double averageTheta() const
Average theta.