bpp-phyl3  3.0.0
ProbabilisticSubstitutionMapping.cpp
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: The Bio++ Development Group
2 //
3 // SPDX-License-Identifier: CECILL-2.1
4 
6 
7 using namespace bpp;
8 
10 {
12  for (size_t i = 0; i < getNumberOfSites(); i++)
13  {
14  mapping_[i].resize(getNumberOfBranches());
15  for (size_t j = 0; j < getNumberOfBranches(); j++)
16  {
17  mapping_[i][j].resize(1);
18  }
19  }
20 }
21 
23 {
25  mapping_.resize(numberOfSites);
26  for (size_t i = 0; i < numberOfSites; i++)
27  {
28  mapping_[i].resize(getNumberOfBranches());
29  for (size_t j = 0; j < getNumberOfBranches(); j++)
30  {
31  mapping_[i][j].resize(getNumberOfSubstitutionTypes());
32  }
33  }
34 }
size_t getNumberOfSites() const override
Definition: Mapping.h:158
void setTree(const Tree &tree)
Definition: Mapping.h:138
virtual void setNumberOfSites(size_t numberOfSites)
Definition: Mapping.h:164
const TreeTemplate< Node > & tree() const override
Definition: Mapping.h:132
size_t getNumberOfBranches() const override
Definition: Mapping.h:160
virtual void setNumberOfSites(size_t numberOfSites) override
std::vector< std::vector< std::vector< double > > > mapping_
Substitution numbers storage.
virtual void setTree(const Tree &tree)
(Re)-set the phylogenetic tree associated to this mapping.
Interface for phylogenetic tree objects.
Definition: Tree.h:115
Defines the basic types of data flow nodes.