Main Page   Class Hierarchy   Compound List   File List   Contact   Download   Symbolic Constraints   Examples  

solution.h

00001 #ifndef SCIL_SOLUTION_H
00002 #define SCIL_SOLUTION_H
00003 
00004 #include<scil/subproblem.h>
00005 #include<tr1/unordered_map>
00006 
00007 namespace SCIL {
00008 
00010 class solution {
00011 private:
00012   tr1::unordered_map<void*, double> S;
00013   subproblem* sp;
00014   bool _has_os;
00015 
00016 public:
00018   solution() : sp(NULL), _has_os(false) {     // if v is no key in S:  S[v] creates new pair (v,0) in S
00019   };                                            // S[v] returns S.end()
00020 
00021   bool has_os() {
00022      return _has_os;
00023   }
00024 
00026   void set_zero() {
00027      S.clear();
00028   }
00029 
00031   void save_solution(subproblem& s); 
00032 
00034   void round_to_integer(var v);
00035 
00037   double value(var v);
00038 
00040   double value(row& r);
00041 
00043   void set_value(var v, double d) {
00044     S[v.var_pointer()]=d;
00045   };
00046 
00047   subproblem* originating_subproblem();
00048 };
00049 
00050 }
00051 
00052 #endif
Generated on Mon Mar 28 22:03:49 2011 for SCIL by  doxygen 1.6.3