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