aboutsummaryrefslogtreecommitdiff
path: root/dist.cpp
diff options
context:
space:
mode:
authorSamuel Fadel <samuelfadel@gmail.com>2015-07-24 13:01:16 -0300
committerSamuel Fadel <samuelfadel@gmail.com>2015-07-24 13:01:16 -0300
commit6da67a32e56c101b9334d2c6f33bd5238d082330 (patch)
tree87d6f4dbc4b1d926be75c432ede2578ab45d8b33 /dist.cpp
parentb7e1060b7cb71b30b91cc65c011b719e255c0a06 (diff)
Color mapping in Scatterplot and initial measures.
- Scatterplot: can now map any floating point data to colors; - Scatterplot: somewhat optimized geometry/material updates; - Removed anything related to labels where it was not necessary; - Added observers to implement distortion (via measures) visualization; - Added skeleton implementations of NP and silhouette.
Diffstat (limited to 'dist.cpp')
-rw-r--r--dist.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/dist.cpp b/dist.cpp
index aaa2167..a5620ad 100644
--- a/dist.cpp
+++ b/dist.cpp
@@ -5,14 +5,14 @@ double mp::euclidean(const arma::rowvec &x1, const arma::rowvec &x2)
return arma::norm(x1 - x2, 2);
}
-arma::mat mp::dist(const arma::mat &X, double (*distCalc)(const arma::rowvec &, const arma::rowvec &))
+arma::mat mp::dist(const arma::mat &X, mp::DistFunc dfunc)
{
arma::uword n = X.n_rows;
arma::mat D(n, n, arma::fill::zeros);
for (arma::uword i = 0; i < n; i++)
for (arma::uword j = 0; j < i; j++) {
- D(i, j) = distCalc(X.row(i), X.row(j));
+ D(i, j) = dfunc(X.row(i), X.row(j));
D(j, i) = D(i, j);
}