Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

/home/mistis/jblanche/DEV/NEM/include/External_Field_Potts.hpp

00001 #define __cplusplus__
00002 #ifndef __EFPOTTSMRF__
00003 #define __EFPOTTSMRF__
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 <MRF.hpp>
00014 
00015 using namespace std;
00016 
00026 class External_Field_Potts : public MRF {
00028   double Beta ; 
00030   vector<double> V;
00031 
00032   vector<double> S_mf;
00033   bool precomputed_smf;
00034 
00036   void Precompute_Smf();
00037 
00038 public :
00040   External_Field_Potts();
00042   External_Field_Potts(Neighborhood_System *nhs, uint k );
00044   External_Field_Potts(Neighborhood_System *nhs, uint k , 
00045                        vector<double> const &  V1,double bet);
00047   ~External_Field_Potts();
00048   
00050   void DeleteAll();
00051 
00053   void Get_V(vector<double> & v);
00055   double Get_Beta();
00056   
00057 
00059   void Gradient(vector<double> const &  tik, vector<double> & Q);
00060   
00062   double H(uint i, uint k, vector<uint>  const &  Z);
00064   double Hmf(uint i, uint k);
00065   
00067   void ReadFromFile(string filename);
00069   void WriteToFile(string filename);
00070 
00072   void Gradient(vector<uint> const &  Z, vector<double> & Q);
00074   void Gradient_update(vector<double> const &   Q);
00076   void Init_Gradient_Descent();
00078   void Finalize_Gradient_Descent();
00079   
00081   void Read_Params(istream & is);
00083   void Write_Params(ostream & os);
00084 
00086   uint Degrees_Of_Freedom();
00087   
00089   void Info();
00090   
00091 };
00092 
00093 #endif

Generated on Thu Oct 27 17:58:43 2005 for NEM by doxygen1.2.18