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 BPP_PHYL_MAPPING_REWARDMAPPINGTOOLS_H
6#define BPP_PHYL_MAPPING_REWARDMAPPINGTOOLS_H
7
8
9#include "../Likelihood/DataFlow/LikelihoodCalculationSingleProcess.h"
11#include "Reward.h"
13
14namespace bpp
15{
29{
30public:
33
34public:
48 static std::unique_ptr<ProbabilisticRewardMapping> computeRewardVectors(
50 const std::vector<uint>& edgeIds,
51 Reward& reward,
52 short unresolvedOption = SubstitutionMappingTools::UNRESOLVED_ZERO,
53 bool verbose = true);
54
55
65 static void writeToStream(
66 const ProbabilisticRewardMapping& rewards,
67 const AlignmentDataInterface& sites,
68 std::ostream& out);
69
70
78 static void readFromStream(std::istream& in, ProbabilisticRewardMapping& rewards);
79
87 static double computeSumForBranch(const ProbabilisticRewardMapping& smap, size_t branchIndex);
88
96 static double computeSumForSite(const ProbabilisticRewardMapping& smap, size_t siteIndex);
97};
98} // end of namespace bpp.
99#endif // BPP_PHYL_MAPPING_REWARDMAPPINGTOOLS_H
Data storage class for probabilistic rewards mappings.
Provide methods to compute reward mappings.
static double computeSumForBranch(const ProbabilisticRewardMapping &smap, size_t branchIndex)
Sum all rewards of a given branch (specified by its index).
static void writeToStream(const ProbabilisticRewardMapping &rewards, const AlignmentDataInterface &sites, std::ostream &out)
Write the reward vectors to a stream.
static std::unique_ptr< ProbabilisticRewardMapping > computeRewardVectors(LikelihoodCalculationSingleProcess &rltc, const std::vector< uint > &edgeIds, Reward &reward, short unresolvedOption=SubstitutionMappingTools::UNRESOLVED_ZERO, bool verbose=true)
Compute the reward vectors for a particular dataset using the double-recursive likelihood computation...
static double computeSumForSite(const ProbabilisticRewardMapping &smap, size_t siteIndex)
Sum all rewards on a given site (specified by its index).
static void readFromStream(std::istream &in, ProbabilisticRewardMapping &rewards)
Read the reward vectors from a stream.
The Reward interface.
Definition: Reward.h:36
static const short UNRESOLVED_ZERO
Constants describing how unresolved characters are counted:
Defines the basic types of data flow nodes.