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

aba_variable.cc

00001 #include <scil/global.h>
00002 #include <scil/aba_variable.h>
00003 #include <scil/subproblem.h>
00004 #include <scil/ilp_problem.h>
00005 #include <scil/var_obj.h>
00006 
00007 using namespace SCIL;
00008 
00009 ABA_Variable::ABA_Variable(subproblem& S_, var_obj* vr,
00010                    Activation a, Validity v,
00011                    double obj, double lBound, double uBound,
00012                    Vartype vt)
00013   : ABA_VARIABLE(S_.master(), &S_, (a==Dynamic), (v==Global), obj, lBound, 
00014                  uBound, 
00015                  (vt==Vartype_Integer ? ABA_VARTYPE::Integer : 
00016                                         ABA_VARTYPE::Continuous))
00017 {
00018    if( vt==Vartype_Integer && lBound == 0 && uBound == 1 )
00019       type_ = ABA_VARTYPE::Binary;
00020    else if (vt==Vartype_Binary)
00021       type_ = ABA_VARTYPE::Binary;
00022 
00023   Ref_Var=vr;
00024 };
00025 
00026 ABA_Variable::ABA_Variable(ILP_Problem& IP_, var_obj* vr,
00027                            Activation a, Validity v,
00028                            double obj, double lBound, double uBound,
00029                            Vartype vt)
00030   : ABA_VARIABLE(&IP_, 0, (a==Dynamic), (v==Global), obj, lBound, uBound, 
00031                  (vt==Vartype_Integer ? ABA_VARTYPE::Integer : 
00032                   ABA_VARTYPE::Continuous))
00033 {
00034    if( vt==Vartype_Integer && lBound == 0 && uBound == 1 )
00035       type_ = ABA_VARTYPE::Binary;
00036    else if (vt==Vartype_Binary)
00037       type_ = ABA_VARTYPE::Binary;
00038 
00039   Ref_Var=vr;
00040 };
00041 
00042 double ABA_Variable::coeff(ABA_CONSTRAINT* c) {
00043   // cout<<"coeff called\n";
00044   return SVar()->coeff(c);
00045 };
00046 
00047 var_obj* ABA_Variable::SVar() {
00048   return Ref_Var;
00049 };
00050 
00051 int ABA_Variable::genColumn(Active_Inequalities* var, Column& col) {
00052   return Ref_Var->genColumn(var, col);
00053 }
00054 
00055 ABA_Variable::~ABA_Variable() {
00056   delete Ref_Var;
00057 };
Generated on Mon Mar 28 22:03:47 2011 for SCIL by  doxygen 1.6.3