Version 4.0.0
Main Page | Class Hierarchy | Class List | File List | Class Members | Related Pages

pmm_node.h

00001 /* seqpp/pmm_node.h
00002  *
00003  * Copyright (C) 2003 Laboratoire Statistique & Génome
00004  *
00005  * This program is free software; you can redistribute it and/or modify
00006  * it under the terms of the GNU General Public License as published by
00007  * the Free Software Foundation; either version 2 of the License, or (at
00008  * your option) any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful, but
00011  * WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
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     //cout<<"pmm_node destroy"<<endl;
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



Download seq++ 4.0.0
Download previous versions
Statistique & Genome Home


Generated on Sun Apr 3 14:16:10 2005 for seqpp by doxygen 1.3.9.1