00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00028 #ifndef SEQPP_MTDMARKOV_H
00029 #define SEQPP_MTDMARKOV_H
00030
00031 #include <seqpp/Markov.h>
00032 #include <seqpp/mtd_core.h>
00033
00045 class MTDMarkov : public Markov
00046 {
00047 protected :
00049 mtd_core * _mtdcore;
00050
00051 public:
00053
00061 template< class TSeq >
00062 MTDMarkov( const TSeq & tseq, short mkv_order,
00063 short nbseed = NBSEED, int nbiter_max = NBITERMAX, double eps = EPS,
00064 bool log = false )
00065 : Markov( tseq.tell_alphabet_size(), tseq.tell_order(), phase )
00066 {
00067 tseq.count_p_occurencies( );
00068 estimate( tseq.get_p_count(), true, mkv_order,
00069 nbseed, nbiter_max, eps );
00070 }
00071
00073
00083 MTDMarkov( unsigned long * * count,
00084 short size,
00085 short mtd_order, short mkv_order,
00086 short nbseed = NBSEED, int nbiter_max = NBITERMAX, double eps = EPS,
00087 bool log = false )
00088 : Markov( size, mtd_order )
00089 {
00090 estimate( count, false, mkv_order,
00091 nbseed, nbiter_max, eps );
00092 }
00093
00095 void estimate( unsigned long * * count, bool decal_required,
00096 short mkv_order,
00097 short nbseed, int nbiter_max, double eps,
00098 bool log )
00099 {
00100 _mtdcore = new mtd_core( _size, _order, mkv_order );
00101 _nb_param = _mtdcore->nb_params();
00102 _mtdcore->estimate( count[i], decal_required,
00103 nbseed, nbiter_max, eps, log );
00104 _mtdcore->mtd_to_matrix( _Pi );
00105
00106 delete _mtdcore;
00107 }
00108
00110 ~MTDMarkov(){}
00111 };
00112 #endif