bpp-phyl3  3.0.0
bpp::DecompositionMethods Class Reference

Methods useful for analytical substitution count and rewards using the eigen decomposition method. More...

#include <Bpp/Phyl/Mapping/DecompositionMethods.h>

+ Inheritance diagram for bpp::DecompositionMethods:
+ Collaboration diagram for bpp::DecompositionMethods:

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)
 
DecompositionMethodsoperator= (const DecompositionMethods &dm)
 
DecompositionMethodsclone () 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 SubstitutionModelInterfacemodel_
 
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_
 

Detailed Description

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.

Author
Julien Dutheil, Laurent Guéguen

Definition at line 26 of file DecompositionMethods.h.

Constructor & Destructor Documentation

◆ DecompositionMethods() [1/5]

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() [2/5]

DecompositionMethods::DecompositionMethods ( std::shared_ptr< const SubstitutionRegisterInterface reg)

Definition at line 37 of file DecompositionMethods.cpp.

References initBMatrices_().

◆ DecompositionMethods() [3/5]

DecompositionMethods::DecompositionMethods ( std::shared_ptr< const SubstitutionModelInterface model)

Definition at line 73 of file DecompositionMethods.cpp.

References setSubstitutionModel().

◆ DecompositionMethods() [4/5]

DecompositionMethods::DecompositionMethods ( const StateMapInterface stateMap)

Definition at line 55 of file DecompositionMethods.cpp.

References initBMatrices_().

◆ DecompositionMethods() [5/5]

bpp::DecompositionMethods::DecompositionMethods ( const DecompositionMethods dm)
inline

Definition at line 57 of file DecompositionMethods.h.

◆ ~DecompositionMethods()

virtual bpp::DecompositionMethods::~DecompositionMethods ( )
inlinevirtual

Definition at line 93 of file DecompositionMethods.h.

Member Function Documentation

◆ clone()

DecompositionMethods* bpp::DecompositionMethods::clone ( ) const
inline

Definition at line 91 of file DecompositionMethods.h.

References DecompositionMethods().

◆ computeExpectations() [1/2]

◆ computeExpectations() [2/2]

void DecompositionMethods::computeExpectations ( std::vector< RowMatrix< double >> &  mappings,
double  length 
) const
protected

◆ computeProducts_()

◆ initBMatrices_()

◆ initStates_()

void DecompositionMethods::initStates_ ( )
protected

◆ jFunction_() [1/2]

void DecompositionMethods::jFunction_ ( const std::vector< double > &  lambda,
const std::vector< double > &  ilambda,
double  t,
RowMatrix< double > &  result,
RowMatrix< double > &  iresult 
) const
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().

◆ jFunction_() [2/2]

void DecompositionMethods::jFunction_ ( const std::vector< double > &  lambda,
double  t,
RowMatrix< double > &  result 
) const
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().

◆ operator=()

◆ setSubstitutionModel()

Member Data Documentation

◆ bMatrices_

◆ insideIProducts_

std::vector< RowMatrix<double> > bpp::DecompositionMethods::insideIProducts_
protected

◆ insideProducts_

std::vector< RowMatrix<double> > bpp::DecompositionMethods::insideProducts_
protected

◆ jIMat_

RowMatrix<double> bpp::DecompositionMethods::jIMat_
protected

Definition at line 32 of file DecompositionMethods.h.

Referenced by computeExpectations(), operator=(), and setSubstitutionModel().

◆ jMat_

RowMatrix<double> bpp::DecompositionMethods::jMat_
mutableprotected

◆ leftEigenVectors_

RowMatrix<double> bpp::DecompositionMethods::leftEigenVectors_
protected

◆ leftIEigenVectors_

RowMatrix<double> bpp::DecompositionMethods::leftIEigenVectors_
protected

◆ model_

◆ nbStates_

◆ nbTypes_

size_t bpp::DecompositionMethods::nbTypes_
protected

◆ rightEigenVectors_

ColMatrix<double> bpp::DecompositionMethods::rightEigenVectors_
protected

Real and imaginary eigenvectors, for non-reversible computation.

Definition at line 38 of file DecompositionMethods.h.

Referenced by computeExpectations(), computeProducts_(), operator=(), and setSubstitutionModel().

◆ rightIEigenVectors_

ColMatrix<double> bpp::DecompositionMethods::rightIEigenVectors_
protected

The documentation for this class was generated from the following files: