bpp-phyl  2.1.0
Bpp/Phyl/Model/Protein/LLG08_EX2.h
Go to the documentation of this file.
00001 //
00002 // File: LLG08_EX2.h
00003 // Created by: Laurent Gueguen
00004 // Created on: mardi 12 octobre 2010, à 09h 42
00005 //
00006 
00007 /*
00008    Copyright or © or Copr. CNRS, (November 16, 2004)
00009 
00010    This software is a computer program whose purpose is to provide classes
00011    for phylogenetic data analysis.
00012 
00013    This software is governed by the CeCILL  license under French law and
00014    abiding by the rules of distribution of free software.  You can  use,
00015    modify and/ or redistribute the software under the terms of the CeCILL
00016    license as circulated by CEA, CNRS and INRIA at the following URL
00017    "http://www.cecill.info".
00018 
00019    As a counterpart to the access to the source code and  rights to copy,
00020    modify and redistribute granted by the license, users are provided only
00021    with a limited warranty  and the software's author,  the holder of the
00022    economic rights,  and the successive licensors  have only  limited
00023    liability.
00024 
00025    In this respect, the user's attention is drawn to the risks associated
00026    with loading,  using,  modifying and/or developing or reproducing the
00027    software by the user in light of its specific status of free software,
00028    that may mean  that it is complicated to manipulate,  and  that  also
00029    therefore means  that it is reserved for developers  and  experienced
00030    professionals having in-depth computer knowledge. Users are therefore
00031    encouraged to load and test the software's suitability as regards their
00032    requirements in conditions enabling the security of their systems and/or
00033    data to be ensured and,  more generally, to use and operate it in the
00034    same conditions as regards security.
00035 
00036    The fact that you are presently reading this means that you have had
00037    knowledge of the CeCILL license and that you accept its terms.
00038  */
00039 
00040 #ifndef _LLG08_EX2_H_
00041 #define _LLG08_EX2_H_
00042 
00043 #include "../MixtureOfSubstitutionModels.h"
00044 #include "ProteinSubstitutionModel.h"
00045 #include "../AbstractSubstitutionModel.h"
00046 #include "../AbstractBiblioMixedSubstitutionModel.h"
00047 
00048 using namespace std;
00049 
00050 namespace bpp
00051 {
00074 class LLG08_EX2 :
00075   public AbstractBiblioMixedSubstitutionModel
00076 {
00077 public:
00078   class EmbeddedModel :
00079     public virtual ProteinSubstitutionModel,
00080     public AbstractReversibleSubstitutionModel
00081   {
00082 private:
00083     double proportion_;
00084     string name_;
00085 
00086 public:
00087     EmbeddedModel(const ProteicAlphabet* alpha, string name);
00088     ~EmbeddedModel(){}
00089     EmbeddedModel* clone() const { return new EmbeddedModel(*this); }
00090     string getName() const { return name_;}
00091     double getProportion() const { return proportion_;}
00092   };
00093 
00094 private:
00095   std::auto_ptr<MixtureOfSubstitutionModels> pmixmodel_;
00096 
00097 public:
00105   LLG08_EX2(const ProteicAlphabet* alpha);
00106 
00107   ~LLG08_EX2();
00108 
00109   LLG08_EX2* clone() const { return new LLG08_EX2(*this); }
00110 
00111   LLG08_EX2(const LLG08_EX2&);
00112 
00113   LLG08_EX2& operator=(const LLG08_EX2&);
00114 
00115   const SubstitutionModel& getModel() const { return *pmixmodel_.get(); }
00116 
00117   const MixedSubstitutionModel& getMixedModel() const { return *pmixmodel_.get(); }
00118 
00119   std::string getName() const { return "LLG08_EX2"; }
00120   
00121 private:
00122   SubstitutionModel& getModel() { return *pmixmodel_.get(); }
00123 
00124   MixedSubstitutionModel& getMixedModel() { return *pmixmodel_.get(); }
00125 
00126 };
00127 } // end of namespace bpp.
00128 
00129 #endif  // _LLG08_EX2_H_
00130 
 All Classes Namespaces Files Functions Variables Typedefs Friends