aboutsummaryrefslogtreecommitdiff
path: root/effectivenessobserver.cpp
diff options
context:
space:
mode:
authorSamuel Fadel <samuelfadel@gmail.com>2016-01-29 10:11:27 +0100
committerSamuel Fadel <samuelfadel@gmail.com>2016-01-29 10:11:27 +0100
commit990a1eb8aa57aecddf0b8d0d8c230875a7421a10 (patch)
tree4bbf9ae20d5e542500102027864fcf47c6ca7231 /effectivenessobserver.cpp
parentcdd910e41b9f5200aebf4ce38246ac93177f7e5b (diff)
Removed unused old files.
Diffstat (limited to 'effectivenessobserver.cpp')
-rw-r--r--effectivenessobserver.cpp44
1 files changed, 0 insertions, 44 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);
-}