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

Partition.h

Go to the documentation of this file.
00001 /* Partition.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 
00028 #ifndef PARTITION_H
00029 #define PARTITION_H
00030 
00031 #include <seqpp/Partition_box.h>
00032 #include <seqpp/Translator.h>
00033 #include <list>
00034 #include <set>
00035 #include <map>
00036 
00072 class Partition : public Partition_box< vector< short > > 
00073 {
00074  private : 
00076   vector< vector< short > > _list_possib;
00077 
00079   vector< vector<short> >  _synonymous;
00080 
00081   void default_synonymous(){
00082     for (int i=0; i<_size; i++){
00083       vector<short> tmp;
00084       tmp.push_back( i );
00085       _synonymous.push_back( tmp );
00086     }
00087   }
00088 
00090   vector< short > _tmpvpart;
00091   vector< short > _tmpv;
00092   set< short > _tmpset;
00093   set< short >::const_iterator _tmpiter;
00094   map< vector<short> , int > _tmpvecmap;
00095   
00096   void list_possible_elements_r( short numbound,         
00097                  list< short > & ,
00098                  list< short >::iterator & it );
00099 
00100 
00102   virtual void processing( short numfalse, const vector<short> & vec );
00103 
00105   void init_tmpvecmap();
00107   void free_tmpvecmap(){
00108     _tmpvecmap.clear();
00109   }
00110 
00111  public :
00112 
00114 
00117   Partition( short alphabet_size );
00118   
00120 
00141   Partition( const Translator & alphabet,
00142              const string & pfile );
00143   
00145   virtual ~Partition()
00146   {};
00147   
00149   const vector< vector< short > > & list_possible_elements( );
00150 
00152   long tell_nbposs() const{
00153     return _list_possib.size();
00154   }
00155 
00157   const vector< vector<short> > & get_synonymous() const{
00158     return _synonymous;
00159   }
00160 
00162   short  tell_size() const{
00163     return _size;
00164   }
00165 };
00166 #endif//PARTITION_H



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