43 #include <Bpp/Clonable.h> 46 #include "../TreeTemplate.h" 60 public virtual Clonable
67 #ifndef NO_VIRTUAL_COV 81 virtual bool isEmpty()
const = 0;
134 std::auto_ptr<const TreeTemplate<Node> >
tree_;
172 #ifndef NO_VIRTUAL_COV 184 if (
isEmpty())
throw Exception(
"AbstractSubstitutionMapping::getSitePosition. No tree is assigned to this map yet.");
198 if (
isEmpty())
throw Exception(
"AbstractMapping::getSitePosition. No tree is assigned to this map yet.");
204 if (
isEmpty())
throw Exception(
"AbstractMapping::setSitePosition. No tree is assigned to this map yet.");
218 for (
size_t i = 0; i < numberOfSites; i++)
226 brLen[i] =
nodes_[i]->getDistanceToFather();
233 if(
nodes_[i]->getId() == nodeId)
return i;
Mapping * clone() const =0
const TreeTemplate< Node > & getTree() const
virtual const Node * getNode(size_t nodeIndex) const
AbstractMapping & operator=(const AbstractMapping &absm)
std::auto_ptr< const TreeTemplate< Node > > tree_
AbstractMapping(const Tree &tree)
virtual size_t getNodeIndex(int nodeId) const =0
int getSitePosition(size_t index) const
std::vector< const Node * > nodes_
size_t getNumberOfBranches() const
General interface for storing mapping data.
virtual std::vector< double > getBranchLengths() const
void setTree(const Tree &tree)
The phylogenetic tree class.
Interface for phylogenetic tree objects.
virtual size_t getNumberOfBranches() const =0
virtual int getSitePosition(size_t index) const =0
virtual void setSitePosition(size_t index, int position)=0
Set the position of a given site.
virtual void setNumberOfSites(size_t numberOfSites)
Exception thrown when something is wrong with a particular node.
void setSitePosition(size_t index, int position)
Set the position of a given site.
virtual bool isEmpty() const =0
The phylogenetic node class.
virtual std::vector< double > getBranchLengths() const =0
virtual ~AbstractMapping()
std::vector< int > sitesPositions_
virtual const Tree & getTree() const =0
AbstractMapping * clone() const =0
AbstractMapping(const AbstractMapping &absm)
virtual size_t getNodeIndex(int nodeId) const
virtual size_t getNumberOfSites() const =0
size_t getNumberOfSites() const
Partial implementation of the mapping interface.