00001 /* 00002 * BMatchingProblem.h 00003 * 00004 * Created on: Dec 1, 2010 00005 * Author: bert 00006 * 00007 * Objects of this class represent a b-matching 00008 * problem, which stores the problem parameters 00009 * and the solution, once it is found. 00010 */ 00011 00012 00013 #ifndef BMATCHINGPROBLEM_H_ 00014 #define BMATCHINGPROBLEM_H_ 00015 00016 #ifdef _MEX_HACK // force matlab display to print to console after cout 00017 #include "mex.h" 00018 #endif 00019 #include "SparseMatrix.h" 00020 #include "WeightOracle.h" 00021 #include "BeliefPropagator.h" 00022 00027 class BMatchingProblem { 00028 public: 00029 BMatchingProblem(); 00037 BMatchingProblem(WeightOracle * wo, int size, int * b, bool verbose); 00038 virtual ~BMatchingProblem(); 00039 00044 void setWeightOracle(WeightOracle * wo); 00045 00050 void setSize(int n); 00051 00056 void setB(int b); 00057 00062 void setB(int * degrees); 00063 00071 void setB(int *br, int *bc, int rows, int cols); 00072 00077 void setMaxIter(int i); 00078 00083 WeightOracle * getWeightOracle(); 00084 00089 int getSize(); 00090 00094 SparseMatrix<bool> * solve(); 00095 00100 int * getSolutionRows(); 00101 00106 int * getSolutionCols(); 00107 00112 int getIters(); 00113 00114 private: 00115 WeightOracle * weightOracle; 00116 int size; 00117 int * b; 00118 bool deleteB; 00119 bool verbose; 00120 BeliefPropagator * bp; 00121 SparseMatrix<bool> * solution; 00122 }; 00123 00124 #endif /* BMATCHINGPROBLEM_H_ */