00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00027 #ifndef SEQPP_PMM_LEAF_H
00028 #define SEQPP_PMM_LEAF_H
00029
00030 #include <seqpp/node_base.h>
00031 #include <map>
00032 #include <config.h>
00033 #ifdef HAVE_LIBXML2
00034 #include <libxml/tree.h>
00035 #endif
00036
00037
00044 class pmm_leaf : public node_base {
00045 public:
00047 pmm_leaf(short alphabet_size, node_base * father,
00048 int motif) ;
00049
00051 virtual ~pmm_leaf(){
00052 };
00053
00057 void setLaw(vector<long> & counts, const vector<double>& prior = vector<double>() ) ;
00058
00062 void setLaw(double* counts, const vector<double>& prior = vector<double>() ) ;
00063
00066 void setLaw() ;
00067
00072 inline void setLaw(const vector<double> & proba){ _law = proba ; } ;
00078 inline void setLaw(const short next,const double proba) { _law[next]=proba ;};
00082 inline double tellLaw(const short next) { return _law[next] ; } ;
00086 bool isLeaf() { return true ; } ;
00087
00088 #ifdef HAVE_LIBXML2
00089 virtual void save_r( const Translator & trans,
00090 const vector< vector<short> > & synonymous,
00091 const vector< vector<short> > & list,
00092 xmlNodePtr ,
00093 map< node_base*, status_node > & catalog,
00094 int & current_id, int level );
00095 #endif
00096
00097 virtual void pmm_to_matrix_r( double* mat,
00098 const vector< vector<short> > & synonymous,
00099 const vector< vector<short> > & list,
00100 short extended_phase,
00101 vector< long > & vect_code,
00102 long bound );
00103
00104
00105 protected:
00106 vector<double> _law ;
00107
00108 } ;
00109
00110
00111
00112
00113 #endif