bpp-phyl3 3.0.0
TreeLikelihoodTools.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: The Bio++ Development Group
2//
3// SPDX-License-Identifier: CECILL-2.1
4
5#ifndef BPP_PHYL_LEGACY_LIKELIHOOD_TREELIKELIHOODTOOLS_H
6#define BPP_PHYL_LEGACY_LIKELIHOOD_TREELIKELIHOODTOOLS_H
7
8
9#include "TreeLikelihood.h"
10
11// From the STL:
12#include <vector>
13#include <map>
14
15namespace bpp
16{
21{
22public:
25
26public:
41 static void getAncestralFrequencies(
43 size_t site,
44 std::map<int, std::vector<double>>& frequencies,
45 bool alsoForLeaves = false);
46
60 static void getAncestralFrequencies(
62 std::map<int, std::vector<double>>& frequencies,
63 bool alsoForLeaves = false);
64
65private:
71 static void getAncestralFrequencies_(
73 size_t siteIndex,
74 int parentId,
75 const std::vector<double>& ancestralFrequencies,
76 std::map<int, std::vector<double>>& frequencies,
77 bool alsoForLeaves);
78};
79} // end of namespace bpp.
80#endif // BPP_PHYL_LEGACY_LIKELIHOOD_TREELIKELIHOODTOOLS_H
The TreeLikelihood interface.
Utilitary methods that work with TreeLikelihood objects.
static void getAncestralFrequencies(const TreeLikelihoodInterface &tl, size_t site, std::map< int, std::vector< double > > &frequencies, bool alsoForLeaves=false)
Compute the expected ancestral frequencies of all states at all (inner) nodes according to a Markov p...
static void getAncestralFrequencies_(const TreeLikelihoodInterface &tl, size_t siteIndex, int parentId, const std::vector< double > &ancestralFrequencies, std::map< int, std::vector< double > > &frequencies, bool alsoForLeaves)
Recursive method, for internal use only.
Defines the basic types of data flow nodes.