35 #ifndef SHARK_MODELS_CLUSTERING_HIERARCHICALCLUSTERING_H 36 #define SHARK_MODELS_CLUSTERING_HIERARCHICALCLUSTERING_H 58 template <
class InputT>
75 SHARK_CHECK(tree,
"[HierarchicalClustering] Tree must not be NULL");
80 {
return "HierarchicalClustering"; }
91 BatchOutputType memberships(numPatterns);
92 for(std::size_t i = 0; i != numPatterns; ++i){
96 if (tree->
isLeft(
get(patterns,i))){
100 memberships(i) += unsigned((tree->
left()->
nodes() + 1) / 2);
101 tree = tree->
right();