Open
Description
// TODO: Cmst_from_complete:
/ / optimise distance computation for the Euclidean and EuclideanSquared distances
// cache sum(x_i^2) in a vector d
// note that sum((x_i-x_j)^2) = sum(x_i^2) - 2*sum(x_i*x_j) + sum(x_j^2)
// = -2 * t(x_j)*x_i + 1 * d[j] + d[i]
// d[i] = const in each iter
// BLAS GEMV can be used in the remaining part
// store a copy of X, swap rows after selecting the min to keep data
// contiguous + keep the permutation vector