aboutsummaryrefslogtreecommitdiff
path: root/interactionhandler.cpp
blob: b79fdd863857d5a39116ff5008e6a2f15d7657d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include "interactionhandler.h"

#include "mp.h"

InteractionHandler::InteractionHandler(const arma::mat &X,
                                       const arma::uvec &sampleIndices)
    : m_X(X)
    , m_Y(X.n_rows, 2)
    , m_sampleIndices(sampleIndices)
    , m_technique(TECHNIQUE_LAMP)
{
}

void InteractionHandler::setSubsample(const arma::mat &Ys)
{
    switch (m_technique) {
    case TECHNIQUE_PLMP:
    case TECHNIQUE_LSP:
    case TECHNIQUE_LAMP:
        mp::lamp(m_X, m_sampleIndices, Ys, m_Y);
        break;
    }

    emit subsampleChanged(m_Y);
}