bpp-phyl3 3.0.0
RewardMappingTools.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 _REWARDMAPPINGTOOLS_H_
6#define _REWARDMAPPINGTOOLS_H_
7
9#include "../../Mapping/Reward.h"
10
11#include "../Likelihood/DRTreeLikelihood.h"
12
13namespace bpp
14{
28{
29public:
32
33public:
46 static std::unique_ptr<LegacyProbabilisticRewardMapping> computeRewardVectors(
47 std::shared_ptr<const DRTreeLikelihoodInterface> drtl,
48 const std::vector<int>& nodeIds,
49 std::shared_ptr<Reward> reward,
50 bool verbose = true);
51
52
62 static void writeToStream(
64 const SiteContainerInterface& sites,
65 std::ostream& out);
66
67
75 static void readFromStream(std::istream& in, LegacyProbabilisticRewardMapping& rewards);
76
77
85 static double computeSumForBranch(const LegacyRewardMappingInterface& smap, size_t branchIndex);
86
87
95 static double computeSumForSite(const LegacyRewardMappingInterface& smap, size_t siteIndex);
96};
97} // end of namespace bpp.
98
99#endif // _REWARDMAPPINGTOOLS_H_
Legacy data storage class for probabilistic rewards mappings.
Legacy interface for storing reward mapping data.
Definition: RewardMapping.h:28
Provide methods to compute reward mappings.
static double computeSumForSite(const LegacyRewardMappingInterface &smap, size_t siteIndex)
Sum all substitutions for each type of a given site (specified by its index).
static void readFromStream(std::istream &in, LegacyProbabilisticRewardMapping &rewards)
Read the reward vectors from a stream.
static std::unique_ptr< LegacyProbabilisticRewardMapping > computeRewardVectors(std::shared_ptr< const DRTreeLikelihoodInterface > drtl, const std::vector< int > &nodeIds, std::shared_ptr< Reward > reward, bool verbose=true)
Compute the reward vectors for a particular dataset using the double-recursive likelihood computation...
static void writeToStream(const LegacyProbabilisticRewardMapping &rewards, const SiteContainerInterface &sites, std::ostream &out)
Write the reward vectors to a stream.
static double computeSumForBranch(const LegacyRewardMappingInterface &smap, size_t branchIndex)
Sum all rewards of a given branch (specified by its index).
Defines the basic types of data flow nodes.