diff options
-rw-r--r-- | effectivenessobserver.cpp | 44 | ||||
-rw-r--r-- | effectivenessobserver.h | 28 | ||||
-rw-r--r-- | npdistortion.cpp | 13 | ||||
-rw-r--r-- | npdistortion.h | 16 |
4 files changed, 0 insertions, 101 deletions
diff --git a/effectivenessobserver.cpp b/effectivenessobserver.cpp deleted file mode 100644 index 61bc264..0000000 --- a/effectivenessobserver.cpp +++ /dev/null @@ -1,44 +0,0 @@ -#include "effectivenessobserver.h" - -EffectiveInteractionEnforcer::EffectiveInteractionEnforcer(const arma::uvec &sampleIndices) - : m_sampleIndices(sampleIndices) - , m_effectiveness(arma::zeros<arma::vec>(sampleIndices.n_elem)) -{ -} - -void EffectiveInteractionEnforcer::setSelection(const QSet<int> &selection) -{ - m_selection = selection; -} - -void EffectiveInteractionEnforcer::setMeasureDifference(const arma::vec &measure) -{ - m_measure = measure; - - if (m_selection.isEmpty()) { - return; - } - - arma::uvec selectionIndices(m_selection.size()); - int i = 0; - for (auto it = m_selection.cbegin(); it != m_selection.cend(); it++) { - selectionIndices[i] = m_sampleIndices[*it]; - i++; - } - - double diff = arma::mean(m_measure(selectionIndices)); - int effectiveness; - if (diff > 0) { - effectiveness = 1; - } else if (diff < 0) { - effectiveness = -1; - } else { - effectiveness = 0; - } - - for (auto it = m_selection.cbegin(); it != m_selection.cend(); it++) { - m_effectiveness[*it] = effectiveness; - } - - emit effectivenessChanged(m_effectiveness); -} diff --git a/effectivenessobserver.h b/effectivenessobserver.h deleted file mode 100644 index 80ee368..0000000 --- a/effectivenessobserver.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef EFFECTIVEINTERACTIONENFORCER_H -#define EFFECTIVEINTERACTIONENFORCER_H - -#include <QObject> -#include <QSet> -#include <armadillo> - -class EffectiveInteractionEnforcer : public QObject -{ - Q_OBJECT -public: - EffectiveInteractionEnforcer(const arma::uvec &sampleIndices); - -signals: - void effectivenessChanged(const arma::vec &effectiveness); - -public slots: - void setSelection(const QSet<int> &selection); - void setMeasureDifference(const arma::vec &measure); - -private: - arma::uvec m_sampleIndices; - arma::mat m_effectiveness; - arma::vec m_measure; - QSet<int> m_selection; -}; - -#endif // EFFECTIVEINTERACTIONENFORCER_H diff --git a/npdistortion.cpp b/npdistortion.cpp deleted file mode 100644 index 1994c74..0000000 --- a/npdistortion.cpp +++ /dev/null @@ -1,13 +0,0 @@ -#include "npdistortion.h" - -#include "mp.h" - -NPDistortion::NPDistortion(int k) - : m_k(k) -{ -} - -arma::vec NPDistortion::measure(const arma::mat &distA, const arma::mat &distB) -{ - return mp::neighborhoodPreservation(distA, distB, m_k); -} diff --git a/npdistortion.h b/npdistortion.h deleted file mode 100644 index a70616d..0000000 --- a/npdistortion.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef NPDISTORTION_H -#define NPDISTORTION_H - -#include "distortionmeasure.h" - -class NPDistortion : public DistortionMeasure -{ -public: - NPDistortion(int k = 10); - arma::vec measure(const arma::mat &distA, const arma::mat &distB); - -private: - int m_k; -}; - -#endif // NPDISTORTION_H |