bpp-phyl  2.2.0
bpp::BranchLikelihood Class Reference

Compute likelihood for a 4-tree. More...

#include <Bpp/Phyl/Likelihood/NNIHomogeneousTreeLikelihood.h>

+ Inheritance diagram for bpp::BranchLikelihood:
+ Collaboration diagram for bpp::BranchLikelihood:

Public Member Functions

 BranchLikelihood (const std::vector< unsigned int > &weights)
 
 BranchLikelihood (const BranchLikelihood &bl)
 
BranchLikelihoodoperator= (const BranchLikelihood &bl)
 
virtual ~BranchLikelihood ()
 
BranchLikelihoodclone () const
 
void initModel (const SubstitutionModel *model, const DiscreteDistribution *rDist)
 
void initLikelihoods (const VVVdouble *array1, const VVVdouble *array2)
 
void resetLikelihoods ()
 
void setParameters (const ParameterList &parameters) throw (ParameterNotFoundException, ConstraintException)
 
double getValue () const throw (Exception)
 
void fireParameterChanged (const ParameterList &parameters)
 

Protected Member Functions

void computeAllTransitionProbabilities ()
 
void computeLogLikelihood ()
 

Protected Attributes

const VVVdouble * array1_
 
const VVVdouble * array2_
 
const SubstitutionModelmodel_
 
const DiscreteDistribution * rDist_
 
size_t nbStates_
 
size_t nbClasses_
 
VVVdouble pxy_
 
double lnL_
 
std::vector< unsigned int > weights_
 

Detailed Description

Compute likelihood for a 4-tree.

This class is used internally by DRHomogeneousTreeLikelihood to test NNI movements. This function needs:

  • two likelihood arrays corresponding to the conditional likelihoods at top and bottom nodes,
  • a substitution model and a rate distribution, whose parameters will not be estimated but taken "as is", It takes only one parameter, the branch length.

Definition at line 62 of file NNIHomogeneousTreeLikelihood.h.

Constructor & Destructor Documentation

◆ BranchLikelihood() [1/2]

bpp::BranchLikelihood::BranchLikelihood ( const std::vector< unsigned int > &  weights)
inline

Definition at line 76 of file NNIHomogeneousTreeLikelihood.h.

Referenced by clone().

◆ BranchLikelihood() [2/2]

bpp::BranchLikelihood::BranchLikelihood ( const BranchLikelihood bl)
inline

Definition at line 91 of file NNIHomogeneousTreeLikelihood.h.

◆ ~BranchLikelihood()

virtual bpp::BranchLikelihood::~BranchLikelihood ( )
inlinevirtual

Definition at line 119 of file NNIHomogeneousTreeLikelihood.h.

Member Function Documentation

◆ clone()

◆ computeAllTransitionProbabilities()

void BranchLikelihood::computeAllTransitionProbabilities ( )
protected

Definition at line 72 of file NNIHomogeneousTreeLikelihood.cpp.

Referenced by fireParameterChanged().

◆ computeLogLikelihood()

void BranchLikelihood::computeLogLikelihood ( )
protected

Definition at line 93 of file NNIHomogeneousTreeLikelihood.cpp.

Referenced by fireParameterChanged().

◆ fireParameterChanged()

void bpp::BranchLikelihood::fireParameterChanged ( const ParameterList &  parameters)
inline

◆ getValue()

double bpp::BranchLikelihood::getValue ( ) const
throw (Exception
)
inline

Definition at line 148 of file NNIHomogeneousTreeLikelihood.h.

References lnL_.

◆ initLikelihoods()

void bpp::BranchLikelihood::initLikelihoods ( const VVVdouble *  array1,
const VVVdouble *  array2 
)
inline
Warning
No checking on alphabet size or number of rate classes is performed, use with care!

Definition at line 130 of file NNIHomogeneousTreeLikelihood.h.

References array1_, and array2_.

◆ initModel()

void BranchLikelihood::initModel ( const SubstitutionModel model,
const DiscreteDistribution *  rDist 
)

◆ operator=()

BranchLikelihood& bpp::BranchLikelihood::operator= ( const BranchLikelihood bl)
inline

Definition at line 104 of file NNIHomogeneousTreeLikelihood.h.

References array1_, array2_, lnL_, model_, nbClasses_, nbStates_, pxy_, rDist_, and weights_.

◆ resetLikelihoods()

void bpp::BranchLikelihood::resetLikelihoods ( )
inline

Definition at line 136 of file NNIHomogeneousTreeLikelihood.h.

References array1_, and array2_.

◆ setParameters()

void bpp::BranchLikelihood::setParameters ( const ParameterList &  parameters)
throw (ParameterNotFoundException,
ConstraintException
)
inline

Definition at line 142 of file NNIHomogeneousTreeLikelihood.h.

Member Data Documentation

◆ array1_

const VVVdouble* bpp::BranchLikelihood::array1_
protected

Definition at line 67 of file NNIHomogeneousTreeLikelihood.h.

Referenced by initLikelihoods(), operator=(), and resetLikelihoods().

◆ array2_

const VVVdouble * bpp::BranchLikelihood::array2_
protected

Definition at line 67 of file NNIHomogeneousTreeLikelihood.h.

Referenced by initLikelihoods(), operator=(), and resetLikelihoods().

◆ lnL_

double bpp::BranchLikelihood::lnL_
protected

Definition at line 72 of file NNIHomogeneousTreeLikelihood.h.

Referenced by getValue(), and operator=().

◆ model_

const SubstitutionModel* bpp::BranchLikelihood::model_
protected

Definition at line 68 of file NNIHomogeneousTreeLikelihood.h.

Referenced by operator=().

◆ nbClasses_

size_t bpp::BranchLikelihood::nbClasses_
protected

Definition at line 70 of file NNIHomogeneousTreeLikelihood.h.

Referenced by operator=().

◆ nbStates_

size_t bpp::BranchLikelihood::nbStates_
protected

Definition at line 70 of file NNIHomogeneousTreeLikelihood.h.

Referenced by operator=().

◆ pxy_

VVVdouble bpp::BranchLikelihood::pxy_
protected

Definition at line 71 of file NNIHomogeneousTreeLikelihood.h.

Referenced by operator=().

◆ rDist_

const DiscreteDistribution* bpp::BranchLikelihood::rDist_
protected

Definition at line 69 of file NNIHomogeneousTreeLikelihood.h.

Referenced by operator=().

◆ weights_

std::vector<unsigned int> bpp::BranchLikelihood::weights_
protected

Definition at line 73 of file NNIHomogeneousTreeLikelihood.h.

Referenced by operator=().


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