CouenneRecordBestSol.hpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef RECBESTSOL_H
00011 #define RECBESTSOL_H
00012
00013 #include "CouenneTypes.hpp"
00014
00015
00016 namespace Couenne {
00017
00018
00019 class CouenneRecordBestSol {
00020
00021 public:
00022
00023
00024 int cardInitDom;
00025
00026 bool *initIsInt;
00027
00028 std::vector<int> listInt;
00029
00030 CouNumber *initDomLb;
00031
00032 CouNumber *initDomUb;
00033
00034
00035 bool hasSol;
00036
00037 int cardSol;
00038
00039 double *sol;
00040
00041 double val;
00042
00043 double maxViol;
00044
00045
00046 int cardModSol;
00047 double *modSol;
00048 double modSolVal;
00049 double modSolMaxViol;
00050
00051 public:
00053 CouenneRecordBestSol();
00054
00056 CouenneRecordBestSol(const CouenneRecordBestSol &other);
00057
00059 ~CouenneRecordBestSol();
00060
00061 inline int getCardInitDom() const {return cardInitDom;};
00062 inline bool *getInitIsInt() const {return initIsInt;};
00063 inline std::vector<int> getListInt() const {return listInt;};
00064
00065 void setInitIsInt(const bool *givenIsInt, const int givenCard);
00066 inline CouNumber *getInitDomLb() const {return initDomLb;};
00067 void setInitDomLb(const CouNumber *givenLb, const int givenCard);
00068 inline CouNumber *getInitDomUb() const {return initDomUb;};
00069 void setInitDomUb(const CouNumber *givenUb, const int givenCard);
00070
00071 void setHasSol(const bool givenHasSol);
00072 inline bool getHasSol() const {return hasSol;};
00073 void setSol(const double *givenSol, const int givenCard,
00074 const double givenMaxViol);
00075 inline int getCardSol() const {return cardSol;};
00076 void setCardSol(const int givenCard);
00077 inline double *getSol() const {return sol;};
00078 inline double getMaxViol() const {return maxViol;};
00079 void setVal(const double givenVal);
00080 inline double getVal() {return val;};
00081
00082
00083
00084 void update(const double *givenSol, const int givenCard,
00085 const double givenVal, const double givenMaxViol);
00086
00087
00088
00089 void update();
00090
00091
00092
00093
00094 int compareAndSave(const double *solA, const double solAVal,
00095 const double solAMaxViol,
00096 const bool solAIsFeas,
00097 const double *solB, const double solBVal,
00098 const double solBMaxViol,
00099 const bool solBIsFeas,
00100 const int cardSol,
00101 const double precision);
00102
00103 inline int getCardModSol() const {return cardModSol;}
00104 double *getModSol(const int expectedCard);
00105 inline double getModSolVal() const {return modSolVal;}
00106 inline double getModSolMaxViol() const {return modSolMaxViol;}
00107
00108
00109
00110 void setModSol(const double *givenModSol, const int givenModCard,
00111 const double givenModVal, const double givenModMaxViol);
00112
00113
00114 void printSol(FILE *fsol) const;
00115 };
00116
00117 }
00118
00119 #endif