34 #include "../WTransferable.h"
71 virtual const std::string
getName()
const;
109 size_t merge(
size_t i,
size_t j,
double height );
124 const std::vector< size_t >&
getParents()
const;
131 const std::vector< double >&
getHeights()
const;
142 void reset(
size_t n );
166 return "WDendrogram";
171 return "A Dendrogram as a array with additional heights for each inner node.";
TestSuite for the WDendrogram class.
Hirachical binary tree datastructure with spatial layout information called dendrogram.
virtual const std::string getName() const
Gets the name of this prototype.
void checkAndThrowExceptionIfUsedUninitialized(std::string caller) const
Checks if this instance is initialized.
std::vector< double > m_heights
Stores only for the inner nodes their heights.
std::vector< size_t > m_parents
Stores the parents of leafs as well as of inner nodes.
size_t merge(size_t i, size_t j, double height)
Merges two elements (either inner nodes or leafs) given via the indices i and j.
void reset(size_t n)
Resets the whole dendrogram to the number of elements it should be used for.
static std::shared_ptr< WPrototyped > m_prototype
The prototype as singleton.
static std::shared_ptr< WPrototyped > getPrototype()
Returns a prototype instantiated with the true type of the deriving class.
const std::vector< size_t > & getParents() const
Returns const reference to the internal parents array.
std::string toString() const
Transform this dendrogram into a string, where each leaf or inner node is mapped to a special string.
virtual const std::string getDescription() const
Gets the description for this prototype.
const std::vector< double > & getHeights() const
Const reference to the heights array.
WDendrogram()
Default constructs an empty dendrogram.
Class building the interface for classes that might be transferred using WModuleConnector.