5 #ifndef _LEGACY_MAPPING_H_
6 #define _LEGACY_MAPPING_H_
10 #include "../../Tree/Tree.h"
11 #include "../../Tree/TreeTemplate.h"
89 std::unique_ptr<const TreeTemplate<Node>>
tree_;
134 if (
isEmpty())
throw Exception(
"LegacyAbstractSubstitutionMapping::getSitePosition. No tree is assigned to this map yet.");
148 if (
isEmpty())
throw Exception(
"LegacyAbstractMapping::getSitePosition. No tree is assigned to this map yet.");
154 if (
isEmpty())
throw Exception(
"LegacyAbstractMapping::setSitePosition. No tree is assigned to this map yet.");
168 for (
size_t i = 0; i < numberOfSites; i++)
179 brLen[i] =
nodes_[i]->getDistanceToFather();
188 if (
nodes_[i]->getId() == nodeId)
return i; }
Partial implementation of the mapping interface.
size_t getNumberOfSites() const override
std::vector< const Node * > nodes_
std::vector< int > sitesPositions_
void setTree(const Tree &tree)
int getSitePosition(size_t index) const override
std::unique_ptr< const TreeTemplate< Node > > tree_
bool isEmpty() const override
void setSitePosition(size_t index, int position) override
Set the position of a given site.
virtual void setNumberOfSites(size_t numberOfSites)
const TreeTemplate< Node > & tree() const override
virtual size_t getNodeIndex(int nodeId) const override
LegacyAbstractMapping * clone() const override=0
size_t getNumberOfBranches() const override
LegacyAbstractMapping(const Tree &tree)
LegacyAbstractMapping(const LegacyAbstractMapping &absm)
virtual std::vector< double > getBranchLengths() const override
virtual const Node * getNode(size_t nodeIndex) const
virtual ~LegacyAbstractMapping()
LegacyAbstractMapping & operator=(const LegacyAbstractMapping &absm)
General interface for storing mapping data.
virtual ~LegacyMappingInterface()
virtual bool isEmpty() const =0
virtual int getSitePosition(size_t index) const =0
virtual size_t getNodeIndex(int nodeId) const =0
virtual size_t getNumberOfBranches() const =0
virtual std::vector< double > getBranchLengths() const =0
LegacyMappingInterface * clone() const override=0
virtual const Tree & tree() const =0
virtual size_t getNumberOfSites() const =0
virtual void setSitePosition(size_t index, int position)=0
Set the position of a given site.
Exception thrown when something is wrong with a particular node.
The phylogenetic node class.
The phylogenetic tree class.
Interface for phylogenetic tree objects.
std::string toString(T t)
Defines the basic types of data flow nodes.