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
00019
00020 double factor1;
00021
00022 double factor2;
00023
00024 double factor3;
00025
00026
00027 void cal_factors();
00028
00029 public:
00030
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
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
00054 boolfunction* getBoolfunction() const {
00055 return bf;
00056 }
00057
00058
00059 void setBoolfunction(boolfunction* _bf) {
00060 bf = _bf;
00061 cal_factors();
00062 return;
00063 }
00064
00065 row get_linVar();
00066
00067
00068 virtual row trans();
00069 virtual row transLeft();
00070 virtual row transRight();
00071
00072 void linearize(ILP_Problem& IP);
00073
00074
00075
00076 virtual void printName();
00077 };
00078
00079 }
00080
00081 #include "../../../src/core/qboolfunction.cc"
00082 #endif
00083