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 class CouenneProblem;
00019
00020
00021 class CouenneRecordBestSol {
00022
00023 public:
00024
00025
00026 int cardInitDom;
00027
00028 bool *initIsInt;
00029
00030 std::vector<int> listInt;
00031
00032 CouNumber *initDomLb;
00033
00034 CouNumber *initDomUb;
00035
00036
00037 bool hasSol;
00038
00039 int cardSol;
00040
00041 double *sol;
00042
00043 double val;
00044
00045 double maxViol;
00046
00047
00048 int cardModSol;
00049 double *modSol;
00050 double modSolVal;
00051 double modSolMaxViol;
00052
00053 public:
00055 CouenneRecordBestSol();
00056
00058 CouenneRecordBestSol(const CouenneRecordBestSol &other);
00059
00061 ~CouenneRecordBestSol();
00062
00063 inline int getCardInitDom() const {return cardInitDom;};
00064 inline bool *getInitIsInt() const {return initIsInt;};
00065 inline std::vector<int> getListInt() const {return listInt;};
00066
00067 void setInitIsInt(const bool *givenIsInt, const int givenCard);
00068 inline CouNumber *getInitDomLb() const {return initDomLb;};
00069 void setInitDomLb(const CouNumber *givenLb, const int givenCard);
00070 inline CouNumber *getInitDomUb() const {return initDomUb;};
00071 void setInitDomUb(const CouNumber *givenUb, const int givenCard);
00072
00073 void setHasSol(const bool givenHasSol);
00074 inline bool getHasSol() const {return hasSol;};
00075 void setSol(const double *givenSol, const int givenCard,
00076 const double givenMaxViol);
00077 inline int getCardSol() const {return cardSol;};
00078 void setCardSol(const int givenCard);
00079 inline double *getSol() const {return sol;};
00080 inline double getMaxViol() const {return maxViol;};
00081 void setVal(const double givenVal);
00082 inline double getVal() {return val;};
00083
00084
00085
00086 void update(const double *givenSol, const int givenCard,
00087 const double givenVal, const double givenMaxViol);
00088
00089
00090
00091 void update();
00092
00093
00094
00095
00096 int compareAndSave(const double *solA, const double solAVal,
00097 const double solAMaxViol,
00098 const bool solAIsFeas,
00099 const double *solB, const double solBVal,
00100 const double solBMaxViol,
00101 const bool solBIsFeas,
00102 const int cardSol,
00103 const double precision);
00104
00105 inline int getCardModSol() const {return cardModSol;};
00106 double *getModSol(const int expectedCard);
00107 inline double getModSolVal() const {return modSolVal;};
00108 inline double getModSolMaxViol() const {return modSolMaxViol;};
00109
00110
00111
00112 void setModSol(const double *givenModSol, const int givenModCard,
00113 const double givenModVal, const double givenModMaxViol);
00114
00115
00116 void printSol(FILE *fsol) const;
00117 };
00118
00119 }
00120
00121 #endif