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

MTDMarkov.h

Go to the documentation of this file.
00001 /* seqpp/MTDMarkov.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 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



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


Generated on Thu Aug 4 18:34:04 2005 for seqpp by doxygen 1.3.9.1