lp_distance | R Documentation |
l_p^p
Distance Vector ComputationTakes in a double matrix \mathbf{X}
, whose transpose \mathbf{X}^T
has N
rows, and computes a vector recording all
{N \choose 2}
pairwise l_p^p
distances of \mathbf{X}^T
,
ordered lexicographically.
lp_distance(X, p)
X |
double matrix (arma::mat class) |
p |
numeric Minkowski power (double class) |
vector of l_p^p
distances (arma::vec class)
# X = [[0.5,0.5],[0,1],[0.3,0.7]] --> lPVec = [x,y,z]
# with x = (0.5^p + 0.5^p)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.