From 60a0bfb863aa2a05bafd943423c284f5c2d68863 Mon Sep 17 00:00:00 2001 From: Samuel Fadel Date: Mon, 25 Jan 2016 19:55:52 +0100 Subject: Scatterplots & splat now share the same scaling. --- projectionobserver.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'projectionobserver.cpp') diff --git a/projectionobserver.cpp b/projectionobserver.cpp index 30f8325..395110c 100644 --- a/projectionobserver.cpp +++ b/projectionobserver.cpp @@ -2,10 +2,10 @@ #include #include - -#include +#include #include "mp.h" +#include "numericrange.h" static const float EPSILON = 1e-6f; @@ -42,13 +42,9 @@ ProjectionObserver::ProjectionObserver(const arma::mat &X, m_distX = mp::dist(m_X); m_values.set_size(m_X.n_rows); - arma::uvec indices(m_X.n_rows); - for (arma::uword i = 0; i < indices.n_elem; i++) { - indices[i] = i; - } - std::set_difference(indices.cbegin(), indices.cend(), - m_cpIndices.cbegin(), m_cpIndices.cend(), - m_rpIndices.begin()); + NumericRange range(0, m_X.n_rows); + std::set_symmetric_difference(range.cbegin(), range.cend(), + m_cpIndices.cbegin(), m_cpIndices.cend(), m_rpIndices.begin()); } bool ProjectionObserver::setType(int type) -- cgit v1.2.3