aboutsummaryrefslogtreecommitdiff
path: root/npdistortion.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'npdistortion.cpp')
-rw-r--r--npdistortion.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/npdistortion.cpp b/npdistortion.cpp
new file mode 100644
index 0000000..71db85b
--- /dev/null
+++ b/npdistortion.cpp
@@ -0,0 +1,14 @@
+#include "npdistortion.h"
+
+#include "mp.h"
+
+NPDistortion::NPDistortion(const arma::mat &X, const arma::uvec &sampleIndices, int k)
+ : DistortionObserver(X, sampleIndices)
+ , m_k(k)
+{
+}
+
+arma::vec NPDistortion::measureFunc(const arma::mat &distA, const arma::mat &distB)
+{
+ return mp::neighborhoodPreservation(distA, distB, m_k);
+}