24 #ifndef BlisVariable_h_
25 #define BlisVariable_h_
42 BlisVariable() : objCoef_(0.0), size_(0), indices_(NULL), values_(NULL) {}
48 indices_ =
new int [s];
49 values_ =
new double [s];
50 memcpy(indices_, ind, s *
sizeof(
int));
51 memcpy(values_, val, s *
sizeof(
double));
58 size_(0), indices_(NULL), values_(NULL)
62 double obj,
int s,
const int *ind,
const double *val)
68 indices_ =
new int [s];
69 values_ =
new double [s];
70 memcpy(indices_, ind, s *
sizeof(
int));
71 memcpy(values_, val, s *
sizeof(
double));
75 delete [] indices_; indices_ = NULL;
76 delete [] values_; values_ = NULL;
89 void setData(
int s,
const int *ind,
const double *val) {
91 delete [] indices_; indices_ = NULL;
92 delete [] values_; values_ = NULL;
93 indices_ =
new int [s];
94 values_ =
new double [s];
97 memcpy(indices_, ind,
sizeof(
int) * s);
98 memcpy(values_, val,
sizeof(
double) * s);
123 encoded.
readRep(indices_, size_);
124 encoded.
readRep(values_, size_);
152 throw CoinError(
"Failed to decode Bcps part of var",
160 throw CoinError(
"Failed to decode Blis part of var",
AlpsEncoded & readRep(T &value)
AlpsEncoded & writeRep(const T &value)
virtual AlpsEncoded * encode() const
AlpsReturnStatus encodeBcpsObject(AlpsEncoded *encoded) const
AlpsReturnStatus decodeBcpsObject(AlpsEncoded &encoded)
BlisVariable(double obj, int s, const int *ind, const double *val)
double getObjCoef()
Return data
BlisVariable(double lbh, double ubh, double lbs, double ubs)
BlisVariable(double lbh, double ubh, double lbs, double ubs, double obj, int s, const int *ind, const double *val)
virtual AlpsKnowledge * decode(AlpsEncoded &encoded) const
Decode a variable from an encoded object.
AlpsReturnStatus decodeBlis(AlpsEncoded &encoded)
Unpack Blis part from a encode object.
void setData(int s, const int *ind, const double *val)
Set data
virtual AlpsReturnStatus encode(AlpsEncoded *encoded)
Pack to a encode object.
void setObjCoef(double coef)
AlpsReturnStatus encodeBlis(AlpsEncoded *encoded)
Pack Blis part into an encoded object.