00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef BlisConstraint_h_
00025 #define BlisConstraint_h_
00026
00027 #include "BcpsObject.h"
00028
00029 class OsiRowCut;
00030
00031
00032
00033 class BlisConstraint : public BcpsConstraint {
00034
00035 protected:
00037 int size_;
00039 int *indices_;
00041 double *values_;
00042
00043 public:
00044
00046 BlisConstraint();
00047
00049 BlisConstraint(int s, const int *ind, const double *val);
00050
00052 BlisConstraint(double lbh, double ubh, double lbs, double ubs);
00053
00055 BlisConstraint(double lbh, double ubh, double lbs, double ubs,
00056 int size, const int *ind, const double *val);
00058 virtual ~BlisConstraint();
00059
00061 BlisConstraint(const BlisConstraint & rhs);
00062
00065 int getSize() const { return size_; }
00066 int* getIndices() const { return indices_; }
00067 double* getValues() const { return values_; }
00072 void setData(int s, const int *ind, const double *val) {
00073 if (size_ < s) {
00074 delete [] indices_;
00075 delete [] values_;
00076 indices_ = new int [s];
00077 values_ = new double [s];
00078 }
00079 size_ = s;
00080 memcpy(indices_, ind, sizeof(int) * s);
00081 memcpy(values_, val, sizeof(double) * s);
00082 }
00085 protected:
00086
00088 AlpsReturnStatus encodeBlis(AlpsEncoded *encoded);
00089
00091 AlpsReturnStatus decodeBlis(AlpsEncoded &encoded);
00092
00093 public:
00094
00096 OsiRowCut *createOsiRowCut();
00097
00099 virtual void hashing(BcpsModel *model=NULL);
00100
00102 double violation(const double *lpSolution);
00103
00104 using AlpsKnowledge::encode ;
00106 virtual AlpsReturnStatus encode(AlpsEncoded *encoded);
00107
00109 virtual AlpsKnowledge* decode(AlpsEncoded& encoded) const;
00110 };
00111
00112
00113
00114 #endif