4 #ifndef ClpNonLinearCost_H
5 #define ClpNonLinearCost_H
8 #include "CoinPragma.hpp"
11 class CoinIndexedVector;
36 #define CLP_BELOW_LOWER 0
37 #define CLP_FEASIBLE 1
38 #define CLP_ABOVE_UPPER 2
50 status =
static_cast<unsigned char>(status & ~15);
51 status =
static_cast<unsigned char>(status | value);
55 status =
static_cast<unsigned char>(status & ~(15 << 4));
56 status =
static_cast<unsigned char>(status | (value << 4));
64 status =
static_cast<unsigned char>(status & ~(15 << 4));
65 status =
static_cast<unsigned char>(status | (
CLP_SAME << 4));
70 #define CLP_METHOD1 ((method_&1)!=0)
71 #define CLP_METHOD2 ((method_&2)!=0)
73 #define CLP_METHOD1 (false)
74 #define CLP_METHOD2 (true)
97 const double *
lower,
const double *
cost);
124 void checkChanged(
int numberInArray, CoinIndexedVector * update);
131 void goThru(
int numberInArray,
double multiplier,
132 const int * index,
const double * work,
136 void goBack(
int numberInArray,
const int * index,
143 void goBackAll(
const CoinIndexedVector * update);
153 double setOne(
int sequence,
double solutionValue);
156 void setOne(
int sequence,
double solutionValue,
double lowerValue,
double upperValue,
157 double costValue = 0.0);
163 double nearest(
int sequence,
double solutionValue);
168 double returnValue = 0.0;
172 returnValue =
cost_[iRange] -
cost_[iRange-1];
174 returnValue = cost_[iRange] - cost_[iRange+1];
182 double returnValue = 0.0;
186 returnValue =
cost_[iRange] -
cost_[iRange+1];
188 returnValue = -1.0e100;
196 double returnValue = 0.0;
200 returnValue =
cost_[iRange] -
cost_[iRange-1];
202 returnValue = 1.0e100;
211 double returnValue = 0.0;
213 double saveRhs = rhs;
218 assert(iRange - 1 >=
start_[sequence]);
221 returnValue = alpha * (
cost_[iRange] -
cost_[iRange-1]);
223 assert(iRange + 1 <
start_[sequence+1] - 1);
226 returnValue = alpha * (
cost_[iRange] -
cost_[iRange+1]);
231 double saveRhs1 = rhs;
234 unsigned char iStatus =
status_[sequence];
262 assert(saveRhs1 == rhs);
269 inline double lower(
int sequence)
const {
273 inline double upper(
int sequence)
const {
277 inline double cost(
int sequence)
const {
335 value &= ~(1 << bit);