00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00028 #ifndef SEQPP_PMM_NODE_H
00029 #define SEQPP_PMM_NODE_H
00030
00031 #include <map>
00032 #include <set>
00033 #include <seqpp/node_base.h>
00034
00035
00043 class pmm_node : public node_base {
00044 public:
00046 pmm_node(short alphabet_size,node_base * father,int motif) ;
00048 virtual ~pmm_node(){
00049
00050 };
00051
00057 inline void setSon(const vector<short> & part_motif, node_base * son) ;
00058
00060 inline void setSon( node_base * son) ;
00061
00067 inline void setSon(short index, node_base * son) {
00068 _sons[index] = son ;
00069 } ;
00070
00071
00073 inline node_base * tellSon(short index) {
00074 return (_sons[index]) ;
00075 } ;
00076
00078 inline vector<node_base *> & tellSons() {
00079 return (_sons) ;} ;
00080
00082 bool isLeaf() { return false ; } ;
00083
00084 #ifdef HAVE_LIBXML2
00085 virtual void save_r( const Translator & trans,
00086 const vector< vector<short> > & synonymous,
00087 const vector< vector<short> > & list,
00088 xmlNodePtr ,
00089 map< node_base*, status_node > & catalog,
00090 int & current_id, int level );
00091 #endif
00092
00093 virtual void pmm_to_matrix_r( double* mat,
00094 const vector< vector<short> > & synonymous,
00095 const vector< vector<short> > & list,
00096 short extended_size,
00097 vector< long > & vect_code,
00098 long bound );
00099
00100
00101 private:
00102 vector<node_base *> _sons ;
00103 };
00104
00105
00106 void pmm_node::setSon(const vector<short> & part_motif, node_base * son )
00107 {
00108 int s = part_motif.size();
00109 for (int i = 0 ; i < s ; i++ )
00110 _sons[part_motif[i]] = son ;
00111 };
00112
00113 void pmm_node::setSon( node_base * son )
00114 {
00115 for (int i = 0 ; i < _alphabet_size ; i++ )
00116 _sons[i] = son;
00117 };
00118
00119 #endif