00001 #define __cplusplus__ 00002 #ifndef __POSSEFPOTTSMRF__ 00003 #define __POSSEFPOTTSMRF__ 00004 00005 #include<iostream> 00006 #include<istream> 00007 #include<fstream> 00008 #include<string> 00009 #include<vector> 00010 #include<sstream> 00011 #include <cmath> 00012 00013 #include <Conditional_MRF.hpp> 00014 00015 using namespace std; 00016 00026 class Conditional_External_Potts : public Conditional_MRF { 00028 vector<double> Beta ; 00030 vector<double> Alpha; 00031 00032 vector<double> S_mf; 00033 bool precomputed_smf; 00034 00036 void Precompute_Smf(); 00037 00038 public : 00040 Conditional_External_Potts(); 00042 Conditional_External_Potts(vector<uint> const & subk); 00044 Conditional_External_Potts(Neighborhood_System *nhs); 00046 Conditional_External_Potts(Neighborhood_System *nhs, vector<uint> const & subk); 00048 Conditional_External_Potts(Neighborhood_System *nhs, vector<uint> const & subk , 00049 vector<double> const & alph,vector<double> const & bet); 00051 ~Conditional_External_Potts(); 00052 00054 void DeleteAll(); 00055 00057 void Get_Alpha(vector<double> & alpha); 00059 void Get_Beta(vector<double> & beta); 00061 void Set_Alpha(vector<double> const & alpha); 00063 void Set_Beta(vector<double> const & beta); 00064 00066 double H(uint i, uint l, uint k, vector<uint> const & Z); 00068 double Hmf(uint i, uint l, uint k); 00069 00071 void ReadFromFile(string filename); 00073 void WriteToFile(string filename); 00074 00076 void Read_Params(istream & is); 00078 void Write_Params(ostream & os); 00079 00081 uint Degrees_Of_Freedom(); 00082 00084 void Info(); 00085 00086 }; 00087 00088 #endif