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

var_obj.cc

00001 #include<abacus/column.h>
00002 #include<scil/var_obj.h>
00003 #include<scil/cons_obj.h>
00004 #include<scil/column.h>
00005 #include<scil/aba_constraint.h>
00006 #include<scil/aba_variable.h>
00007 
00008 using namespace SCIL;
00009 
00010 int var_obj::genColumn(Active_Inequalities* cons, Column& co)
00011 { 
00012   //cout<<row.size()<<" "<<row.nnz()<<" rowsize\n";
00013   column C;
00014   non_zero_entries(C);
00015 
00016   //cons_obj* i;
00017   //forall_defined(i, IC) { TODO wird von genRow erzeugt
00018   //  C+=cons(i)*IC[i];
00019   //}
00020 
00021   column_entry::list_iterator it;
00022   int j;
00023   co.realloc(C.size());
00024   foreach(it, C) {
00025     j=it->Cons.cons_pointer()->Acons()->index();
00026     if (j!=-1) co.insert(j, it->coeff);
00027   }
00028   co.obj(obj());
00029   co.lBound(lower_bound());
00030   co.uBound(upper_bound());
00031 
00032   cout<<C.size()<<" gencol\n";
00033 
00034   return(C.size());
00035 };
00036 
00037 double var_obj::coeff(ABA_CONSTRAINT* i) {
00038   cons_obj* I=((ABA_Constraint*) i)->Scons();
00039 
00040   // if Map contains constraint i
00041   if( IC.find(I) != IC.end() ) {
00042     return IC[I];
00043   }
00044   return coeff(I);
00045 }
00046 
00047 void var_obj::set(cons_obj* i, double d) {
00048   IC[i]=d;
00049 }
00050 
00051 void var_obj::init(subproblem& S, int nr, Activation a) {
00052   vi=nr; // TODO
00053   Ref_AVar=new ABA_Variable(S, this, a, Local, obj_, lBound_, uBound_, vt);
00054 };
00055 
00056 void var_obj::init(ILP_Problem& IP, int nr, Activation a) {
00057   vi=nr;
00058   Ref_AVar=new ABA_Variable(IP, this, a, Global, obj_, lBound_, uBound_, vt);
00059 };
Generated on Mon Mar 28 22:03:51 2011 for SCIL by  doxygen 1.6.3