48 #include <QtConcurrent>
54 using namespace RTPROCESSINGLIB;
55 using namespace FIFFLIB;
56 using namespace Eigen;
62 RtCov::RtCov(QSharedPointer<FIFFLIB::FiffInfo> pFiffInfo)
63 : m_fiffInfo(*pFiffInfo)
74 qWarning() <<
"[RtCov::estimateCovariance] FiffInfo was not set. Returning empty covariance estimation.";
85 QFuture<RtCovComputeResult> result = QtConcurrent::mappedReduced(
m_lData,
89 result.waitForFinished();
95 computedCov.
data = finalResult.matData;
108 computedCov.
data.array() -=
m_iSamples * (finalResult.mu * finalResult.mu.transpose()).array();
112 computedCov.
diag =
false;
113 computedCov.
dim = computedCov.
data.rows();
140 qWarning() <<
"[RtCov::estimateCovariance] Number of samples equals zero. Regularization not possible. Returning empty covariance estimation.";
151 result.mu = matData.rowwise().sum();
152 result.matData = matData * matData.transpose();
160 if(finalResult.matData.size() == 0 || finalResult.mu.size() == 0) {
161 finalResult.mu = tempResult.mu;
162 finalResult.matData = tempResult.matData;
164 finalResult.mu += tempResult.mu;
165 finalResult.matData += tempResult.matData;