bpp-phyl3
3.0.0
|
Methods useful for analytical substitution count and rewards using the eigen decomposition method. More...
#include <Bpp/Phyl/Mapping/DecompositionMethods.h>
Public Member Functions | |
DecompositionMethods (std::shared_ptr< const SubstitutionModelInterface > model, std::shared_ptr< const SubstitutionRegisterInterface > reg) | |
DecompositionMethods (std::shared_ptr< const SubstitutionRegisterInterface > reg) | |
DecompositionMethods (std::shared_ptr< const SubstitutionModelInterface > model) | |
DecompositionMethods (const StateMapInterface &stateMap) | |
DecompositionMethods (const DecompositionMethods &dm) | |
DecompositionMethods & | operator= (const DecompositionMethods &dm) |
DecompositionMethods * | clone () const |
virtual | ~DecompositionMethods () |
void | setSubstitutionModel (std::shared_ptr< const SubstitutionModelInterface > model) |
Set the substitution model. More... | |
Protected Member Functions | |
void | initStates_ () |
void | initBMatrices_ () |
void | computeProducts_ () |
void | computeExpectations (RowMatrix< double > &mapping, double length) const |
void | computeExpectations (std::vector< RowMatrix< double >> &mappings, double length) const |
void | jFunction_ (const std::vector< double > &lambda, double t, RowMatrix< double > &result) const |
Compute the integral part of the computation. More... | |
void | jFunction_ (const std::vector< double > &lambda, const std::vector< double > &ilambda, double t, RowMatrix< double > &result, RowMatrix< double > &iresult) const |
Compute the integral part of the computation, in complex numbers. More... | |
Protected Attributes | |
std::shared_ptr< const SubstitutionModelInterface > | model_ |
size_t | nbStates_ |
size_t | nbTypes_ |
RowMatrix< double > | jMat_ |
RowMatrix< double > | jIMat_ |
ColMatrix< double > | rightEigenVectors_ |
Real and imaginary eigenvectors, for non-reversible computation. More... | |
ColMatrix< double > | rightIEigenVectors_ |
RowMatrix< double > | leftEigenVectors_ |
RowMatrix< double > | leftIEigenVectors_ |
std::vector< RowMatrix< double > > | bMatrices_ |
computation matrices More... | |
std::vector< RowMatrix< double > > | insideProducts_ |
std::vector< RowMatrix< double > > | insideIProducts_ |
Methods useful for analytical substitution count and rewards using the eigen decomposition method.
The code is adapted from the original R code by Paula Tataru and Asger Hobolth.
Definition at line 26 of file DecompositionMethods.h.
DecompositionMethods::DecompositionMethods | ( | std::shared_ptr< const SubstitutionModelInterface > | model, |
std::shared_ptr< const SubstitutionRegisterInterface > | reg | ||
) |
Definition at line 17 of file DecompositionMethods.cpp.
References initBMatrices_(), and setSubstitutionModel().
Referenced by clone().
DecompositionMethods::DecompositionMethods | ( | std::shared_ptr< const SubstitutionRegisterInterface > | reg | ) |
Definition at line 37 of file DecompositionMethods.cpp.
References initBMatrices_().
DecompositionMethods::DecompositionMethods | ( | std::shared_ptr< const SubstitutionModelInterface > | model | ) |
Definition at line 73 of file DecompositionMethods.cpp.
References setSubstitutionModel().
DecompositionMethods::DecompositionMethods | ( | const StateMapInterface & | stateMap | ) |
Definition at line 55 of file DecompositionMethods.cpp.
References initBMatrices_().
|
inline |
Definition at line 57 of file DecompositionMethods.h.
|
inlinevirtual |
Definition at line 93 of file DecompositionMethods.h.
|
inline |
Definition at line 91 of file DecompositionMethods.h.
References DecompositionMethods().
|
protected |
Definition at line 166 of file DecompositionMethods.cpp.
References bpp::MatrixTools::hadamardMult(), insideIProducts_, insideProducts_, jFunction_(), jIMat_, jMat_, leftEigenVectors_, leftIEigenVectors_, model_, bpp::MatrixTools::mult(), nbStates_, rightEigenVectors_, and rightIEigenVectors_.
Referenced by bpp::DecompositionSubstitutionCount::computeCounts_(), and bpp::DecompositionReward::computeRewards_().
|
protected |
Definition at line 196 of file DecompositionMethods.cpp.
References bpp::MatrixTools::hadamardMult(), insideIProducts_, insideProducts_, jFunction_(), jIMat_, jMat_, leftEigenVectors_, leftIEigenVectors_, model_, bpp::MatrixTools::mult(), nbStates_, nbTypes_, rightEigenVectors_, and rightIEigenVectors_.
|
protected |
Definition at line 91 of file DecompositionMethods.cpp.
References bMatrices_, insideIProducts_, insideProducts_, leftEigenVectors_, leftIEigenVectors_, model_, bpp::MatrixTools::mult(), nbStates_, nbTypes_, rightEigenVectors_, and rightIEigenVectors_.
Referenced by bpp::DecompositionReward::alphabetIndexHasChanged(), bpp::DecompositionReward::DecompositionReward(), bpp::DecompositionSubstitutionCount::DecompositionSubstitutionCount(), bpp::DecompositionSubstitutionCount::distancesHaveChanged(), bpp::DecompositionReward::setSubstitutionModel(), bpp::DecompositionSubstitutionCount::setSubstitutionModel(), and bpp::DecompositionSubstitutionCount::substitutionRegisterHasChanged().
|
protected |
Definition at line 306 of file DecompositionMethods.cpp.
References bMatrices_, insideProducts_, nbStates_, and nbTypes_.
Referenced by DecompositionMethods(), bpp::DecompositionReward::DecompositionReward(), bpp::DecompositionSubstitutionCount::DecompositionSubstitutionCount(), initStates_(), setSubstitutionModel(), and bpp::DecompositionSubstitutionCount::substitutionRegisterHasChanged().
|
protected |
Definition at line 233 of file DecompositionMethods.cpp.
References initBMatrices_(), jMat_, nbStates_, and RowMatrix< double >::resize().
Referenced by bpp::DecompositionSubstitutionCount::substitutionRegisterHasChanged().
|
protected |
Compute the integral part of the computation, in complex numbers.
Definition at line 135 of file DecompositionMethods.cpp.
References bpp::abs(), bpp::VectorTools::cos(), bpp::VectorTools::exp(), nbStates_, bpp::VectorTools::sin(), and bpp::NumConstants::TINY().
|
protected |
Compute the integral part of the computation.
Definition at line 117 of file DecompositionMethods.cpp.
References bpp::abs(), bpp::VectorTools::exp(), nbStates_, and bpp::NumConstants::TINY().
Referenced by computeExpectations().
|
inline |
Definition at line 72 of file DecompositionMethods.h.
References bMatrices_, insideIProducts_, insideProducts_, jIMat_, jMat_, leftEigenVectors_, leftIEigenVectors_, model_, nbStates_, nbTypes_, rightEigenVectors_, and rightIEigenVectors_.
Referenced by bpp::DecompositionReward::operator=(), and bpp::DecompositionSubstitutionCount::operator=().
void DecompositionMethods::setSubstitutionModel | ( | std::shared_ptr< const SubstitutionModelInterface > | model | ) |
Set the substitution model.
model | A pointer toward the substitution model to use. |
Definition at line 241 of file DecompositionMethods.cpp.
References bpp::ColMatrix< class >::col(), bpp::VectorTools::fill(), bpp::ColMatrix< class >::getCol(), bpp::ColMatrix< class >::getNumberOfRows(), RowMatrix< double >::getRow(), initBMatrices_(), insideIProducts_, jIMat_, jMat_, leftEigenVectors_, leftIEigenVectors_, model_, nbStates_, nbTypes_, bpp::ColMatrix< class >::resize(), RowMatrix< double >::resize(), rightEigenVectors_, rightIEigenVectors_, and RowMatrix< double >::row().
Referenced by DecompositionMethods(), bpp::DecompositionReward::setSubstitutionModel(), and bpp::DecompositionSubstitutionCount::setSubstitutionModel().
|
protected |
computation matrices
Definition at line 44 of file DecompositionMethods.h.
Referenced by computeProducts_(), bpp::DecompositionReward::fillBMatrice_(), bpp::DecompositionSubstitutionCount::fillBMatrices_(), initBMatrices_(), operator=(), and bpp::DecompositionSubstitutionCount::setDistanceBMatrices_().
|
protected |
Definition at line 44 of file DecompositionMethods.h.
Referenced by computeExpectations(), computeProducts_(), operator=(), and setSubstitutionModel().
|
protected |
Definition at line 44 of file DecompositionMethods.h.
Referenced by computeExpectations(), computeProducts_(), initBMatrices_(), and operator=().
|
protected |
Definition at line 32 of file DecompositionMethods.h.
Referenced by computeExpectations(), operator=(), and setSubstitutionModel().
|
mutableprotected |
Definition at line 32 of file DecompositionMethods.h.
Referenced by computeExpectations(), initStates_(), operator=(), and setSubstitutionModel().
|
protected |
Definition at line 39 of file DecompositionMethods.h.
Referenced by computeExpectations(), computeProducts_(), operator=(), and setSubstitutionModel().
|
protected |
Definition at line 39 of file DecompositionMethods.h.
Referenced by computeExpectations(), computeProducts_(), operator=(), and setSubstitutionModel().
|
protected |
Definition at line 29 of file DecompositionMethods.h.
Referenced by bpp::DecompositionReward::alphabetIndexHasChanged(), bpp::DecompositionSubstitutionCount::computeCounts_(), computeExpectations(), computeProducts_(), bpp::DecompositionReward::computeRewards_(), bpp::DecompositionSubstitutionCount::distancesHaveChanged(), bpp::DecompositionReward::fillBMatrice_(), bpp::DecompositionSubstitutionCount::fillBMatrices_(), bpp::DecompositionSubstitutionCount::getAllNumbersOfSubstitutions(), bpp::DecompositionReward::getAllRewards(), bpp::DecompositionSubstitutionCount::getNumberOfSubstitutions(), bpp::DecompositionSubstitutionCount::getNumberOfSubstitutionsPerType(), operator=(), bpp::DecompositionSubstitutionCount::setDistanceBMatrices_(), setSubstitutionModel(), bpp::DecompositionSubstitutionCount::storeAllNumbersOfSubstitutions(), bpp::DecompositionReward::storeAllRewards(), bpp::DecompositionSubstitutionCount::substitutionRegisterHasChanged(), and bpp::DecompositionSubstitutionCount::weightsHaveChanged().
|
protected |
Definition at line 30 of file DecompositionMethods.h.
Referenced by bpp::DecompositionSubstitutionCount::computeCounts_(), computeExpectations(), computeProducts_(), bpp::DecompositionReward::computeRewards_(), bpp::DecompositionReward::fillBMatrice_(), bpp::DecompositionSubstitutionCount::fillBMatrices_(), initBMatrices_(), bpp::DecompositionSubstitutionCount::initCounts_(), bpp::DecompositionReward::initRewards_(), initStates_(), jFunction_(), operator=(), bpp::DecompositionSubstitutionCount::setDistanceBMatrices_(), setSubstitutionModel(), bpp::DecompositionSubstitutionCount::storeAllNumbersOfSubstitutions(), and bpp::DecompositionReward::storeAllRewards().
|
protected |
Definition at line 31 of file DecompositionMethods.h.
Referenced by bpp::DecompositionSubstitutionCount::computeCounts_(), computeExpectations(), computeProducts_(), initBMatrices_(), operator=(), and setSubstitutionModel().
|
protected |
Real and imaginary eigenvectors, for non-reversible computation.
Definition at line 38 of file DecompositionMethods.h.
Referenced by computeExpectations(), computeProducts_(), operator=(), and setSubstitutionModel().
|
protected |
Definition at line 38 of file DecompositionMethods.h.
Referenced by computeExpectations(), computeProducts_(), operator=(), and setSubstitutionModel().