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

qboolfunction.h

00001 #ifndef QBOOLFUNCTION_H
00002 #define QBOOLFUNCTION_H
00003 
00004 #include <boost/graph/adjacency_list.hpp>
00005 #include <boost/graph/adjacency_matrix.hpp>
00006 #include <boost/graph/graph_traits.hpp>
00007 #include <scil/core/boolfunction.h>
00008 #include <scil/core/qelement.h>
00009 
00010 namespace SCIL {
00011 
00012 using namespace boost;
00013 
00014 template <typename Graph>
00015 class qboolfunction : public qelement<Graph> {
00016       private:
00017          boolfunction* bf;
00018          //factors are used for seperation-graph calculation
00019          //factor1: -0 op 0 + 0 op 1 + 1 op 0 - 1 op 1
00020          double factor1;
00021          //factor2: -0 op 0 - 0 op 1 + 1 op 0 + 1 op 1
00022          double factor2;
00023          //factor2: -0 op 0 + 0 op 1 - 1 op 0 + 1 op 1
00024          double factor3;
00025 
00026          //calculates factor1 to factor3
00027          void cal_factors();
00028 
00029       public:
00030          //the trivial default constructor, everything undefined
00031          qboolfunction() : bf(NULL){
00032             this->l = NULL;
00033             this->r = NULL;
00034             this->maximal = true;
00035             this->basic = false;
00036             this->sg_node = NULL;
00037             this->checkGraphConcepts();
00038          }
00039 
00040          //construct a qboolfunction from a boolfunction
00041          qboolfunction(boolfunction* _bf)
00042             : bf(_bf) {
00043             this->l = NULL;
00044             this->r = NULL;
00045             this->maximal = true;
00046             this->basic = false;
00047             this->sg_node = NULL;
00048             this->checkGraphConcepts();
00049             cal_factors();
00050             }
00051 
00052 
00053          //return the boolfunction itself
00054          boolfunction* getBoolfunction() const {
00055             return bf;
00056          }
00057 
00058          //set the boolfunction
00059          void setBoolfunction(boolfunction* _bf) {
00060             bf = _bf;
00061             cal_factors();
00062             return;
00063          }
00064 
00065          row get_linVar();
00066 
00067          //the linear transformations
00068          virtual row trans();
00069          virtual row transLeft();
00070          virtual row transRight();
00071 
00072          void linearize(ILP_Problem& IP);
00073 
00074 
00075          //output the variables making up the boolfunction (if BOOL_INST_DEBUG)
00076          virtual void printName();
00077    };
00078 
00079 }
00080 
00081 #include "../../../src/core/qboolfunction.cc"
00082 #endif
00083 
Generated on Mon Mar 28 22:03:49 2011 for SCIL by  doxygen 1.6.3