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

cons_obj.h

00001 #ifndef SCIL_CONS_OBJ_H
00002 #define SCIL_CONS_OBJ_H
00003 
00004 #include <scil/global.h>
00005 #include <scil/solution.h>
00006 #include <scil/subproblem.h>
00007 #include <tr1/unordered_map>
00008 #undef set
00009 
00010 namespace SCIL {
00011 
00012 class var_obj;
00013 class row;
00014 
00015 class ABA_Constraint;
00016 
00017 class ILP_Problem;
00018 class subproblem;
00019 class ABA_Constraint;
00020 
00023 
00024 class cons_obj
00025 {
00026   friend class ILP_Problem;
00027   friend class subproblem;
00028   friend class ABA_Constraint;
00029 
00030 private:
00031   double rhs_;
00032   cons_sense sense_;
00033   ABA_Constraint *Ref_Acons;
00034   //Type of quadratic reformulation; default value: CHECK
00035   quadRefStatus qrStatus;
00036   Activation Act;
00037 
00038 public:
00039 
00040   //CHANGE map: forall_defined is not implemented for maps anymore
00041   //           we have to you use a h_array instead
00042   //leda::map < var_obj *, double >CM;
00043   tr1::unordered_map < var_obj *, double >CM;
00044 
00047   cons_obj (cons_sense s, double rhs);
00048 
00051   cons_obj ();
00052 
00053   void init (subproblem & S_, int n, Activation a, Validity v = Global);
00054 
00055   void init (ILP_Problem & IP, int n, Activation a, Validity v = Global);
00056 
00057   virtual double coeff (var_obj * v) {
00058     return 0;
00059   };
00060  
00061   
00062 
00063   void set_sense (cons_sense s);
00064 
00065   void set_rhs (double r);
00066    
00067   Activation get_Act();
00068 
00069   ABA_Constraint *Acons ();
00070 
00071   virtual double rhs ();
00072 
00073   virtual cons_sense sense ();
00074 
00075   virtual double coeff (ABA_VARIABLE * v);
00076 
00079   bool violated (subproblem & S);
00080 
00081   double violation (subproblem & S);
00082 
00083   double violation (solution & S);
00084 
00085   double slack(subproblem& S);
00086 
00087   void set (var_obj * v, double d);
00088 
00092   virtual void non_zero_entries (row & r)
00093   {
00094   };
00095 
00096   virtual int genRow (Active_Variables * var, Row & row);
00097 
00098   inline void set_qrStatus(quadRefStatus qr){
00099      qrStatus = qr;
00100   }
00101 
00102   inline quadRefStatus get_qrStatus(){
00103      return qrStatus;
00104   }
00105 
00106   virtual ~cons_obj ();
00107 };
00108 
00109 }
00110 
00111 #endif
Generated on Mon Mar 28 22:03:47 2011 for SCIL by  doxygen 1.6.3