00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
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