ToPS
MaximumDependenceDecomposition.hpp
00001 /*
00002  *       InhomogeneousMarkovChain.hpp
00003  *
00004  *       Copyright 2011 Andre Yoshiaki Kashiwabara <akashiwabara@usp.br>
00005  *                      Ígor Bonadio <ibonadio@ime.usp.br>
00006  *                      Vitor Onuchic <vitoronuchic@gmail.com>
00007  *                      Alan Mitchell Durham <aland@usp.br>
00008  *
00009  *       This program is free software; you can redistribute it and/or modify
00010  *       it under the terms of the GNU  General Public License as published by
00011  *       the Free Software Foundation; either version 3 of the License, or
00012  *       (at your option) any later version.
00013  *
00014  *       This program is distributed in the hope that it will be useful,
00015  *       but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  *       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  *       GNU General Public License for more details.
00018  *
00019  *       You should have received a copy of the GNU General Public License
00020  *       along with this program; if not, write to the Free Software
00021  *       Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
00022  *       MA 02110-1301, USA.
00023  */
00024 
00025 #ifndef MAXIMUM_DEPENDENCE_DECOMPOSITION_HPP
00026 #define MAXIMUM_DEPENDENCE_DECOMPOSITION_HPP
00027 
00028 #include "crossplatform.hpp"
00029 #include "InhomogeneousMarkovChain.hpp"
00030 #include "ContextTree.hpp"
00031 #include "ProbabilisticModel.hpp"
00032 #include <boost/shared_ptr.hpp>
00033 
00034 namespace tops {
00035   
00036   
00038   class DLLEXPORT MaximumDependenceDecomposition : public ProbabilisticModel
00039   {
00040   public:
00041     MaximumDependenceDecomposition(){
00042     }
00043     virtual std::string model_name() const {
00044       return "MaximumDependenceDecomposition";
00045     }
00046 
00048     virtual double evaluate(const Sequence & s, unsigned int begin, unsigned int end) const;
00049     virtual void initialize(const ProbabilisticModelParameters & p)  ;
00050     virtual ProbabilisticModelParameters parameters() const;
00051     virtual Sequence & choose(Sequence & h, int size) const;
00052     virtual std::string str() const;
00053   private:
00054     int _max_size;
00055     std::map <std::string,ProbabilisticModelPtr> _submodels;
00056     std::map <std::string,int> _consensus;
00057     std::map <std::string,int> _positions;
00058     ProbabilisticModelParameters _parameters;
00059   };
00060 
00061   typedef boost::shared_ptr <MaximumDependenceDecomposition> MaximumDependenceDecompositionPtr;
00062 
00063 }
00064 
00065 
00066 #endif