00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00029 #ifndef SEQPP_SEQUENCE_H
00030 #define SEQPP_SEQUENCE_H
00031
00032 #include <seqpp/PrimarySequence.h>
00033 #include <seqpp/PrimaryCount.h>
00034 #include <seqpp/Coder.h>
00035 #include <set>
00036
00037 #include <gsl/gsl_rng.h>
00038 #include <gsl/gsl_randist.h>
00060 class Sequence : public PrimarySequence, public PrimaryCount
00061 {
00062 protected :
00063
00064 short tell_int_speed( unsigned long pos ) const{
00065 return _obs[pos]%_nmodal;
00066 }
00068 virtual unsigned long tell_max_count() const{
00069 return _length;
00070 }
00071 virtual void compute_count( unsigned long * * extern_count,
00072 short phase,
00073 short initial_phase,
00074 unsigned long beg,
00075 unsigned long end ) const;
00076 public :
00089 Sequence( ifstream & ifile,
00090 short order,
00091 const Translator & transl,
00092 Coder & coder,
00093 const string & name_file = "noname" );
00094
00095
00097
00102 Sequence( short order, unsigned long length,
00103 const Translator & transl );
00104
00106
00111 Sequence( const string & name_file, short order,
00112 const Translator & transl );
00113
00115 Sequence( const Sequence & seq );
00116
00118
00119
00120
00121
00122 Sequence( const Sequence & seq, short order );
00123
00125 virtual ~Sequence();
00126
00127
00129 short tell_int(unsigned long pos) const;
00130
00131
00133 long tell_code( unsigned long pos ) const{
00134 return(_obs[pos]);
00135 }
00136
00138 long & operator() ( unsigned long pos ) const{
00139 return(_obs[pos]);
00140 }
00141
00143 long tell_code() const{
00144 return(_obs[_ipos]);
00145 }
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00161 const long * seq( ) const{
00162 return _obs;
00163 }
00165 const long * get_code( ) const{
00166 return _obs;
00167 }
00168
00169
00170
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189 void simule( const double * m_trans,
00190 const double * v_init,
00191 const gsl_rng * r );
00192
00194
00195
00196
00197
00198 void simule( const double * m_trans,
00199 const gsl_rng * r ){
00200 simule( m_trans, NULL, r );
00201 }
00202
00203
00204
00205
00206
00207
00208
00209
00211 void simule_phased( short phase,
00212 const double ** m_trans,
00213 const double * v_init,
00214 const gsl_rng * r );
00215
00216
00218 void simule( unsigned long position,
00219 double * proba,
00220 const gsl_rng * r );
00221
00222
00223
00224
00225 };
00226
00227 int Multinomial_1_Draw ( int dim,
00228 const double * param, const gsl_rng * r );
00229 int Multinomial_1_Draw ( int dim, const gsl_rng * r );
00230
00231 #endif