bpp-phyl3  3.0.0
bpp::LikelihoodCalculationOnABranch Class Reference

#include <Bpp/Phyl/Likelihood/DataFlow/LikelihoodCalculationOnABranch.h>

+ Inheritance diagram for bpp::LikelihoodCalculationOnABranch:
+ Collaboration diagram for bpp::LikelihoodCalculationOnABranch:

Classes

class  RateCategoryEdge
 

Public Member Functions

 LikelihoodCalculationOnABranch (Context &context, LikelihoodCalculationSingleProcess &likcalsp, uint edgeId)
 
void setModel (std::shared_ptr< ConfiguredModel > model)
 
 LikelihoodCalculationOnABranch (const LikelihoodCalculationOnABranch &lik)
 
LikelihoodCalculationOnABranchclone () const
 
const StateMapInterfacestateMap () const
 
std::shared_ptr< const StateMapInterfacegetStateMap () const
 
std::shared_ptr< const AlphabetgetAlphabet () const
 
size_t getRootArrayPosition (size_t currentPosition) const
 
const PatternTypegetRootArrayPositions () const
 
ValueRef< RowLikexpandVector (ValueRef< RowLik > vector)
 
ValueRef< MatrixLikexpandMatrix (ValueRef< MatrixLik > matrix)
 
unsigned int getWeight (size_t pos) const
 
std::shared_ptr< SiteWeightsgetRootWeights ()
 
RowLik getSiteLikelihoodsForAClass (size_t nCat, bool shrunk=false)
 Get site likelihoods for a rate category. More...
 
AllRatesSiteLikelihoods getSiteLikelihoodsForAllClasses (bool shrunk=false)
 Output array (Classes X Sites) of likelihoods for all sites & classes. More...
 
size_t getNumberOfDistinctSites () const
 
size_t getNumberOfSites () const
 
std::shared_ptr< ConfiguredModelgetModel ()
 
SiteLikelihoodsRef getSiteLikelihoods (bool shrunk=false)
 
void setSiteLikelihoods (SiteLikelihoodsRef ll, bool shrunk=false)
 
DataLik getLikelihoodForASite (size_t pos, bool shrunk=false)
 
DataLik getLogLikelihoodForASite (size_t pos, bool shrunk=false)
 
VDataLik getLikelihoodPerSite ()
 Get the likelihood for each site. More...
 
ValueRef< DataLikgetLikelihoodNode ()
 
virtual bool isInitialized () const
 
const ContextgetContext () const
 
void setLikelihoodNode (ValueRef< DataLik > ll)
 
void setNamespace (const std::string &prefix)
 
bool hasIndependentParameter (const std::string &name) const
 
const ParameterListgetIndependentParameters () const
 
size_t getNumberOfIndependentParameters () const
 
void aliasParameters (const std::string &p1, const std::string &p2)
 
void aliasParameters (std::map< std::string, std::string > &unparsedParams, bool verbose)
 
void unaliasParameters (const std::string &p1, const std::string &p2)
 
ParameterList getAliasedParameters (const ParameterList &pl) const
 
ParameterList getFromParameters (const ParameterList &pl) const
 
virtual std::vector< std::string > getAlias (const std::string &name) const
 
virtual std::map< std::string, std::string > getAliases () const
 
std::string getFrom (const std::string &name) const
 
bool hasParameter (const std::string &name) const override
 
const ParameterListgetParameters () const override
 
const Parameterparameter (const std::string &name) const override
 
const std::shared_ptr< Parameter > & getParameter (const std::string &name) const
 
double getParameterValue (const std::string &name) const override
 
void setAllParametersValues (const ParameterList &parameters) override
 
void setParameterValue (const std::string &name, double value) override
 
void setParametersValues (const ParameterList &parameters) override
 
bool matchParametersValues (const ParameterList &parameters) override
 
void removeConstraint (const std::string &name) override
 
void setConstraint (const std::string &name, std::shared_ptr< ConstraintInterface > constraint) override
 
size_t getNumberOfParameters () const override
 
std::string getNamespace () const override
 
std::string getParameterNameWithoutNamespace (const std::string &name) const override
 
virtual void fireParameterChanged (const ParameterList &parameters)
 

Protected Member Functions

ContextgetContext_ ()
 
ValueRef< DataLikgetLikelihoodNode_ ()
 
const std::shared_ptr< Parameter > & getParameter (size_t i) const
 
std::shared_ptr< Parameter > & getParameter (size_t i)
 
void addParameter_ (Parameter *parameter)
 
void addParameters_ (const ParameterList &parameters)
 
void shareParameter_ (const std::shared_ptr< Parameter > &parameter)
 
void shareParameters_ (const ParameterList &parameters)
 
void includeParameters_ (const ParameterList &parameters)
 
void deleteParameter_ (size_t index)
 
void deleteParameter_ (std::string &name)
 
void deleteParameters_ (const std::vector< std::string > &names)
 
void resetParameters_ ()
 
ParametergetParameter_ (const std::string &name)
 
ParametergetParameter_ (size_t index)
 
const ParametergetParameter_ (size_t index) const
 
ParametergetParameterWithNamespace_ (const std::string &name)
 
const ParametergetParameterWithNamespace_ (const std::string &name) const
 
ParameterListgetParameters_ () override
 

Protected Attributes

SiteLikelihoodsRef siteLikelihoods_
 
SiteLikelihoodsRef patternedSiteLikelihoods_
 
ValueRef< DataLiklikelihood_
 

Private Member Functions

void makeLikelihoods ()
 
std::shared_ptr< SiteLikelihoodsgetSiteLikelihoods_ (size_t nCat)
 
void cleanAllLikelihoods ()
 

Private Attributes

size_t numberOfSites_
 
MatrixDimension likelihoodMatrixDim_
 
std::shared_ptr< ConfiguredModelmodel_
 
ValueRef< PatternTyperootPatternLinks_
 
std::shared_ptr< SiteWeightsrootWeights_
 The frequency of each site. More...
 
ValueRef< Eigen::RowVectorXd > catProb_
 
std::vector< RateCategoryEdgevRateCatEdges_
 
Contextcontext_
 
ParameterList independentParameters_
 
std::map< std::string, std::shared_ptr< AliasParameterListener > > aliasListenersRegister_
 
ParameterList parameters_
 
std::string prefix_
 

Detailed Description

Definition at line 70 of file LikelihoodCalculationOnABranch.h.

Constructor & Destructor Documentation

◆ LikelihoodCalculationOnABranch() [1/2]

LikelihoodCalculationOnABranch::LikelihoodCalculationOnABranch ( Context context,
LikelihoodCalculationSingleProcess likcalsp,
uint  edgeId 
)

◆ LikelihoodCalculationOnABranch() [2/2]

LikelihoodCalculationOnABranch::LikelihoodCalculationOnABranch ( const LikelihoodCalculationOnABranch lik)

Definition at line 53 of file LikelihoodCalculationOnABranch.cpp.

Member Function Documentation

◆ cleanAllLikelihoods()

void LikelihoodCalculationOnABranch::cleanAllLikelihoods ( )
privatevirtual

◆ clone()

LikelihoodCalculationOnABranch* bpp::LikelihoodCalculationOnABranch::clone ( ) const
inlinevirtual

Reimplemented from bpp::AlignedLikelihoodCalculation.

Definition at line 168 of file LikelihoodCalculationOnABranch.h.

◆ expandMatrix()

ValueRef<MatrixLik> bpp::LikelihoodCalculationOnABranch::expandMatrix ( ValueRef< MatrixLik matrix)
inline

◆ expandVector()

ValueRef<RowLik> bpp::LikelihoodCalculationOnABranch::expandVector ( ValueRef< RowLik vector)
inline

◆ getAlphabet()

std::shared_ptr<const Alphabet> bpp::LikelihoodCalculationOnABranch::getAlphabet ( ) const
inline

◆ getContext()

const Context& bpp::LikelihoodCalculation::getContext ( ) const
inlineinherited

Definition at line 76 of file LikelihoodCalculation.h.

References bpp::LikelihoodCalculation::context_.

◆ getContext_()

◆ getLikelihoodForASite()

◆ getLikelihoodNode()

ValueRef<DataLik> bpp::LikelihoodCalculation::getLikelihoodNode ( )
inlineinherited

◆ getLikelihoodNode_()

◆ getLikelihoodPerSite()

VDataLik bpp::AlignedLikelihoodCalculation::getLikelihoodPerSite ( )
inlineinherited

Get the likelihood for each site.

Returns
A vector with all site likelihoods.

Definition at line 221 of file LikelihoodCalculation.h.

References bpp::copyEigenToBpp(), and bpp::AlignedLikelihoodCalculation::getSiteLikelihoods().

◆ getLogLikelihoodForASite()

DataLik bpp::AlignedLikelihoodCalculation::getLogLikelihoodForASite ( size_t  pos,
bool  shrunk = false 
)
inlineinherited

◆ getModel()

std::shared_ptr<ConfiguredModel> bpp::LikelihoodCalculationOnABranch::getModel ( )
inline

Definition at line 286 of file LikelihoodCalculationOnABranch.h.

References model_.

Referenced by makeLikelihoods().

◆ getNumberOfDistinctSites()

size_t bpp::LikelihoodCalculationOnABranch::getNumberOfDistinctSites ( ) const
inline

◆ getNumberOfSites()

size_t bpp::LikelihoodCalculationOnABranch::getNumberOfSites ( ) const
inline

◆ getRootArrayPosition()

size_t bpp::LikelihoodCalculationOnABranch::getRootArrayPosition ( size_t  currentPosition) const
inline

Definition at line 202 of file LikelihoodCalculationOnABranch.h.

References rootPatternLinks_.

◆ getRootArrayPositions()

const PatternType& bpp::LikelihoodCalculationOnABranch::getRootArrayPositions ( ) const
inline

Definition at line 207 of file LikelihoodCalculationOnABranch.h.

References rootPatternLinks_.

◆ getRootWeights()

std::shared_ptr<SiteWeights> bpp::LikelihoodCalculationOnABranch::getRootWeights ( )
inline

Definition at line 247 of file LikelihoodCalculationOnABranch.h.

References rootWeights_.

◆ getSiteLikelihoods()

◆ getSiteLikelihoods_()

std::shared_ptr<SiteLikelihoods> bpp::LikelihoodCalculationOnABranch::getSiteLikelihoods_ ( size_t  nCat)
private

◆ getSiteLikelihoodsForAClass()

RowLik LikelihoodCalculationOnABranch::getSiteLikelihoodsForAClass ( size_t  nCat,
bool  shrunk = false 
)

Get site likelihoods for a rate category.

Parameters
nCat: index of the rate category
shrunk: if returns on shrunked data (default: false)

Definition at line 64 of file LikelihoodCalculationOnABranch.cpp.

References expandVector(), and vRateCatEdges_.

Referenced by getSiteLikelihoodsForAllClasses().

◆ getSiteLikelihoodsForAllClasses()

AllRatesSiteLikelihoods LikelihoodCalculationOnABranch::getSiteLikelihoodsForAllClasses ( bool  shrunk = false)

Output array (Classes X Sites) of likelihoods for all sites & classes.

Parameters
shrunk: if returns on shrunked data (default: false)

Definition at line 72 of file LikelihoodCalculationOnABranch.cpp.

References getNumberOfDistinctSites(), getSiteLikelihoodsForAClass(), numberOfSites_, and vRateCatEdges_.

◆ getStateMap()

std::shared_ptr<const StateMapInterface> bpp::LikelihoodCalculationOnABranch::getStateMap ( ) const
inline

Definition at line 178 of file LikelihoodCalculationOnABranch.h.

References model_.

◆ getWeight()

unsigned int bpp::LikelihoodCalculationOnABranch::getWeight ( size_t  pos) const
inline

Definition at line 242 of file LikelihoodCalculationOnABranch.h.

References rootWeights_.

◆ isInitialized()

◆ makeLikelihoods()

◆ setLikelihoodNode()

void bpp::LikelihoodCalculation::setLikelihoodNode ( ValueRef< DataLik ll)
inlineinherited

◆ setModel()

void bpp::LikelihoodCalculationOnABranch::setModel ( std::shared_ptr< ConfiguredModel model)
inline

◆ setSiteLikelihoods()

◆ stateMap()

const StateMapInterface& bpp::LikelihoodCalculationOnABranch::stateMap ( ) const
inline

Definition at line 173 of file LikelihoodCalculationOnABranch.h.

References model_.

Referenced by getAlphabet(), and makeLikelihoods().

Member Data Documentation

◆ catProb_

ValueRef<Eigen::RowVectorXd> bpp::LikelihoodCalculationOnABranch::catProb_
private

Definition at line 148 of file LikelihoodCalculationOnABranch.h.

Referenced by makeLikelihoods().

◆ context_

Context& bpp::LikelihoodCalculation::context_
privateinherited

◆ likelihood_

◆ likelihoodMatrixDim_

MatrixDimension bpp::LikelihoodCalculationOnABranch::likelihoodMatrixDim_
private

Definition at line 111 of file LikelihoodCalculationOnABranch.h.

Referenced by getNumberOfDistinctSites(), and makeLikelihoods().

◆ model_

std::shared_ptr<ConfiguredModel> bpp::LikelihoodCalculationOnABranch::model_
private

◆ numberOfSites_

size_t bpp::LikelihoodCalculationOnABranch::numberOfSites_
private

◆ patternedSiteLikelihoods_

◆ rootPatternLinks_

ValueRef<PatternType> bpp::LikelihoodCalculationOnABranch::rootPatternLinks_
private

◆ rootWeights_

std::shared_ptr<SiteWeights> bpp::LikelihoodCalculationOnABranch::rootWeights_
private

The frequency of each site.

Definition at line 141 of file LikelihoodCalculationOnABranch.h.

Referenced by cleanAllLikelihoods(), getRootWeights(), getWeight(), and makeLikelihoods().

◆ siteLikelihoods_

◆ vRateCatEdges_

std::vector<RateCategoryEdge> bpp::LikelihoodCalculationOnABranch::vRateCatEdges_
private

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