blob: 29d7e6ff6a68398011b7de52ed0713fa0263e82b (
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
26
27
28
29
30
31
32
33
|
#include "distortionobserver.h"
#include "mp.h"
DistortionObserver::DistortionObserver(const arma::mat &X,
const arma::uvec &sampleIndices)
: m_X(X)
, m_sampleIndices(sampleIndices)
, m_distortionMeasure(0)
{
m_distX = mp::dist(m_X);
}
void DistortionObserver::setMeasure(DistortionMeasure *measure)
{
m_distortionMeasure = measure;
}
void DistortionObserver::setMap(const arma::mat &Y)
{
if (!m_distortionMeasure) {
return;
}
arma::vec measures = m_distortionMeasure->measure(m_distX, mp::dist(Y));
if (m_Y.n_elem != 0) {
emit mapChanged(measures - m_measures);
} else {
m_Y = Y;
m_measures = measures;
}
}
|