bpp-phyl  2.2.0
CoalaCore.h
Go to the documentation of this file.
1 //
2 // File: CoalaCore.h
3 // Created by: Mathieu Groussin
4 // Modified on: Sun Mar 13 12:00:00 2011
5 //
6 
7 /*
8  Copyright or � or Copr. Bio++ Development Team, (November 16, 2004)
9  PCA
10  This software is a computer program whose purpose is to provide classes
11  for phylogenetic data analysis.
12 
13  This software is governed by the CeCILL license under French law and
14  abiding by the rules of distribution of free software. You can use,
15  modify and/ or redistribute the software under the terms of the CeCILL
16  license as circulated by CEA, CNRS and INRIA at the following URL
17  "http://www.cecill.info".
18 
19  As a counterpart to the access to the source code and rights to copy,
20  modify and redistribute granted by the license, users are provided only
21  with a limited warranty and the software's author, the holder of the
22  economic rights, and the successive licensors have only limited
23  liability.
24 
25  In this respect, the user's attention is drawn to the risks associated
26  with loading, using, modifying and/or developing or reproducing the
27  software by the user in light of its specific status of free software,
28  that may mean that it is complicated to manipulate, and that also
29  therefore means that it is reserved for developers and experienced
30  professionals having in-depth computer knowledge. Users are therefore
31  encouraged to load and test the software's suitability as regards their
32  requirements in conditions enabling the security of their systems and/or
33  data to be ensured and, more generally, to use and operate it in the
34  same conditions as regards security.
35 
36  The fact that you are presently reading this means that you have had
37  knowledge of the CeCILL license and that you accept its terms.
38  */
39 
40 
41 #ifndef _COALACORE_H_
42 #define _COALACORE_H_
43 
44 // From Core:
45 #include <Bpp/Numeric/Matrix/Matrix.h>
46 
47 #include <Bpp/Numeric/ParameterList.h>
48 // From SeqLib:
49 #include <Bpp/Seq/Alphabet/ProteicAlphabet.h>
50 #include <Bpp/Seq/Container/SequenceContainer.h>
51 
52 
53 namespace bpp
54 {
66 class CoalaCore
67 {
68 protected:
69  bool init_;
70  size_t nbrOfAxes_;
71  std::string exch_;
72  RowMatrix<double> P_;
73  RowMatrix<double> R_;
74  std::vector<double> colWeights_;
75  std::map<std::string, std::string> paramValues_;
76 
77 public:
78  CoalaCore(size_t nbAxes = 0, const std::string& exch = "LG08");
79 
80  virtual ~CoalaCore() {}
81 
82  CoalaCore* clone() const { return new CoalaCore(*this); }
83 
84 public:
85  size_t getNbrOfAxes() const { return nbrOfAxes_; }
86  const RowMatrix<double>& getTppalAxesMatrix() const { return P_; }
87  const RowMatrix<double>& getRowCoordinates() const { return R_; }
88  const std::vector<double>& getColumnWeights() const { return colWeights_; }
89  void setParamValues(const std::map<std::string, std::string>& valuesSettings) { paramValues_ = valuesSettings; }
90 
91 protected:
92  ParameterList computeCOA(const SequenceContainer& data, bool param = true);
93 
94  std::vector<double> prodMatrixVector(RowMatrix<double>& P, std::vector<double>& V);
95 };
96 
97 } // end of namespace bpp.
98 
99 #endif // _COALACORE_H_
100 
std::string exch_
Definition: CoalaCore.h:71
RowMatrix< double > P_
Definition: CoalaCore.h:72
size_t getNbrOfAxes() const
Definition: CoalaCore.h:85
std::vector< double > colWeights_
Definition: CoalaCore.h:74
RowMatrix< double > R_
Definition: CoalaCore.h:73
const std::vector< double > & getColumnWeights() const
Definition: CoalaCore.h:88
std::vector< double > prodMatrixVector(RowMatrix< double > &P, std::vector< double > &V)
Definition: CoalaCore.cpp:176
CoalaCore(size_t nbAxes=0, const std::string &exch="LG08")
Definition: CoalaCore.cpp:65
const RowMatrix< double > & getTppalAxesMatrix() const
Definition: CoalaCore.h:86
ParameterList computeCOA(const SequenceContainer &data, bool param=true)
Definition: CoalaCore.cpp:77
virtual ~CoalaCore()
Definition: CoalaCore.h:80
CoalaCore * clone() const
Definition: CoalaCore.h:82
void setParamValues(const std::map< std::string, std::string > &valuesSettings)
Definition: CoalaCore.h:89
This class is the core class inherited by the Coala class. COaLA is a branch-heterogeneous amino-acid...
Definition: CoalaCore.h:66
size_t nbrOfAxes_
Definition: CoalaCore.h:70
std::map< std::string, std::string > paramValues_
Definition: CoalaCore.h:75
const RowMatrix< double > & getRowCoordinates() const
Definition: CoalaCore.h:87