22 using namespace shogun;
24 #ifndef DOXYGEN_SHOULD_SKIP_THIS
32 #endif // DOXYGEN_SHOULD_SKIP_THIS
36 table_size(0), pairs(NULL), merge_distance(NULL)
42 table_size(0), pairs(NULL), merge_distance(NULL)
72 const int32_t num_pairs=num*(num-1)/2;
83 pairs=SG_MALLOC(int32_t, 2*num);
86 pair* index=SG_MALLOC(pair, num_pairs);
90 for (int32_t i=0; i<num; i++)
92 for (int32_t j=i+1; j<num; j++)
102 CMath::qsort_index<float64_t,pair>(distances, index, (num-1)*num/2);
107 for (; l<num && (num-l)>=
merges && k<num_pairs-1; l++)
109 while (k<num_pairs-1)
113 int32_t i=index[k].idx1;
114 int32_t j=index[k].idx2;
136 for (int32_t m=0; m<num; m++)
141 #ifdef DEBUG_HIERARCHICAL
142 SG_PRINT(
"l=%04i i=%04i j=%04i c1=%+04d c2=%+04d c=%+04d dist=%6.6f\n", l,i,j, c1,c2,c,
merge_distance[l])