protected static < E extends MTreeEntry , N extends AbstractMTreeNode < ? , N , E > > double [ ] [ ] computeDistanceMatrix ( AbstractMTree < ? , N , E , ? > tree , N node ) { final int n = node . getNumEntries ( ) ; double [ ] [ ] distancematrix = new double [ n ] [ n ] ; // Build distance matrix for ( int i = 0 ; i < n ; i ++ ) { E ei = node . getEntry ( i ) ; double [ ] row_i = distancematrix [ i ] ; for ( int j = i + 1 ; j < n ; j ++ ) { row_i [ j ] = distancematrix [ j ] [ i ] = tree . distance ( ei , node . getEntry ( j ) ) ; } } return distancematrix ; }
Compute the pairwise distances in the given node .