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

aba_constraint.cc

00001 #include <scil/aba_constraint.h>
00002 #include <scil/cons_obj.h>
00003 #include <scil/subproblem.h>
00004 #include <scil/ilp_problem.h>
00005 
00006 using namespace SCIL;
00007 
00008 double ABA_Constraint::coeff(ABA_VARIABLE* v) {
00009   //  cout<<"coeff called\n";
00010   return Ref_cons->coeff(v);
00011 }
00012 
00013 int ABA_Constraint::genRow(Active_Variables* var, Row& row) {
00014   return Ref_cons->genRow(var, row);
00015 }
00016 
00017 double ABA_Constraint::rhs() {
00018   return Ref_cons->rhs();
00019 };
00020 
00021 ABA_CSENSE* ABA_Constraint::sense() {
00022   cons_sense s=Ref_cons->sense();
00023   if (s==Equal) return new ABA_CSENSE(master_, ABA_CSENSE::Equal);
00024   if (s==Greater) return new ABA_CSENSE(master_, ABA_CSENSE::Greater);
00025   return new ABA_CSENSE(master_, ABA_CSENSE::Less);
00026 };
00027 
00028 ABA_Constraint::ABA_Constraint(subproblem& S_, cons_obj* Ref_cons_,
00029                                Activation g, Validity v, Liftability l, 
00030                                int n)
00031   : ABA_CONSTRAINT(S_.master(), &S_, ABA_CSENSE::Equal, 0,
00032                    (g==Dynamic), (v==Local), (l==Liftable)),
00033   Ref_cons(Ref_cons_), ii(n)
00034 { };
00035 
00036 ABA_Constraint::ABA_Constraint(ILP_Problem& IP_, cons_obj* Ref_cons_,
00037                                Activation a_, Validity v_, Liftability l_, 
00038                                int n)
00039   : ABA_CONSTRAINT(&IP_, 0, ABA_CSENSE::Equal, 0,
00040                    (a_==Dynamic), (v_==Local), (l_==Liftable)),
00041   Ref_cons(Ref_cons_), ii(n)
00042 { };
00043 
00044 ABA_Constraint::~ABA_Constraint() {
00045   if(Ref_cons!=0) {
00046     Ref_cons->Ref_Acons=0;
00047     delete Ref_cons;
00048   }
00049 };
Generated on Mon Mar 28 22:03:47 2011 for SCIL by  doxygen 1.6.3