6 #ifndef AbcNonLinearCost_H
7 #define AbcNonLinearCost_H
39 #define CLP_BELOW_LOWER 0
40 #define CLP_FEASIBLE 1
41 #define CLP_ABOVE_UPPER 2
43 #ifndef ClpNonLinearCost_H
54 status =
static_cast<unsigned char>(status & ~15);
55 status =
static_cast<unsigned char>(status | value);
59 status =
static_cast<unsigned char>(status & ~(15 << 4));
60 status =
static_cast<unsigned char>(status | (value << 4));
68 status =
static_cast<unsigned char>(status & ~(15 << 4));
69 status =
static_cast<unsigned char>(status | (
CLP_SAME << 4));
118 void goThru(
int numberInArray,
double multiplier,
119 const int * index,
const double * work,
123 void goBack(
int numberInArray,
const int * index,
144 double setOne(
int sequence,
double solutionValue);
148 double setOneBasic(
int iRow,
double solutionValue);
154 double nearest(
int iRow,
double solutionValue);
170 double returnValue = 0.0;
171 unsigned char iStatus =
status_[sequence];
244 {
return (
status_[sequence] >> 4);}
double infeasibilityWeight_
Current infeasibility weight.
double sumInfeasibilities() const
Sum of infeasibilities.
void checkInfeasibilities(double oldTolerance=0.0)
Changes infeasible costs and computes number and cost of infeas Puts all non-basic (non free) variabl...
AbcNonLinearCost()
Default constructor.
void goBack(int numberInArray, const int *index, double *rhs)
Takes off last iteration (i.e.
double largestInfeasibility_
Largest infeasibility.
void refreshFromPerturbed(double tolerance)
Refresh - from original.
void checkChanged(int numberInArray, CoinIndexedVector *update)
Puts back correct infeasible costs for each variable The input indices are row indices and need conve...
AbcNonLinearCost & operator=(const AbcNonLinearCost &)
Default constructor.
void goBackAll(const CoinIndexedVector *update)
Puts back correct infeasible costs for each variable The input indices are row indices and need conve...
double nearest(int iRow, double solutionValue)
Returns nearest bound.
AbcSimplex * model_
Model.
void setCurrentStatus(unsigned char &status, int value)
void goThru(int numberInArray, double multiplier, const int *index, const double *work, double *rhs)
Goes through one bound for each variable.
double changeCost_
Change in cost because of infeasibilities.
double averageTheta_
Average theta - kept here as only for primal.
int numberColumns_
Number of columns (mainly for checking and copy)
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 setOne(int sequence, double solutionValue)
Sets bounds and cost for one variable Returns change in cost May need to be inline for speed...
double feasibleCost_
Feasible cost.
int numberInfeasibilities() const
Number of infeasibilities.
double changeInCost(int iRow, double alpha, double &rhs)
This also updates next bound.
void setOriginalStatus(unsigned char &status, int value)
unsigned char * status_
Contains status at beginning and current.
double feasibleReportCost() const
Feasible cost with offset and direction (i.e. for reporting)
#define CLP_BELOW_LOWER
Trivial class to deal with non linear costs.
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) variabl...
int getCurrentStatus(int sequence)
For debug.
void setAverageTheta(double value)
Number of infeasibilities.
double largestInfeasibility() const
Largest infeasibility.
const double COIN_DBL_MAX
void setInitialStatus(unsigned char &status)
int originalStatus(unsigned char status)
double changeInCost() const
Change in cost.
double feasibleCost() const
Feasible cost.
void setSameStatus(unsigned char &status)
void setChangeInCost(double value)
Number of infeasibilities.
double changeDownInCost(int) const
Changes infeasible costs and computes number and cost of infeas Puts all non-basic (non free) variabl...
~AbcNonLinearCost()
Destructor.
double * upperRegion() const
Return region.
void validate()
For debug.
int numberInfeasibilities_
Number of infeasibilities found.
void feasibleBounds()
Puts feasible bounds into lower and upper.
double * cost_
Feasible cost array.
int * pivotVariable() const
Basic variables pivoting on which rows may be same as toExternal but may be as at invert...
double averageTheta() const
Average theta.
void refreshCosts(const double *columnCosts)
Refreshes costs always makes row costs zero.
unsigned char * statusArray() const
For debug.
double * bound_
Bound which has been replaced in lower_ or upper_.
double * lowerRegion() const
Return region.
void refresh()
Refresh - assuming regions OK.
double sumInfeasibilities_
Sum of infeasibilities.
int currentStatus(unsigned char status)
int numberRows_
Number of rows (mainly for checking and copy)
void zapCosts()
Temporary zeroing of feasible costs.