aboutsummaryrefslogtreecommitdiff
path: root/selectionhandler.cpp
blob: 4c488a050acd3c0979d4edf8fa44f15148782b7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include "selectionhandler.h"

SelectionHandler::SelectionHandler(const arma::uvec &sampleIndices)
    : m_sampleIndices(sampleIndices)
{
}

void SelectionHandler::setSelection(const arma::uvec &selection)
{
    arma::uvec newSelection(selection);

    // The selecion happens over the sample indices. We use the original dataset
    // indices in sampleIndices to translate indices.
    for (auto it = newSelection.begin(); it != newSelection.end(); it++) {
        *it = m_sampleIndices[*it];
    }

    emit selectionChanged(newSelection);
}