40 #include "../network/networknode.h"
41 #include "../network/networkedge.h"
42 #include "../network/network.h"
49 #include <QElapsedTimer>
50 #include <QtConcurrent>
56 #include <unsupported/Eigen/FFT>
62 using namespace CONNECTIVITYLIB;
63 using namespace Eigen;
87 if(connectivitySettings.isEmpty()) {
88 qDebug() <<
"Correlation::calculate - Input data is empty";
95 int rows = connectivitySettings.at(0).matData.rows();
96 RowVectorXf rowVert = RowVectorXf::Zero(3);
98 for(
int i = 0; i < rows; ++i) {
99 rowVert = RowVectorXf::Zero(3);
101 if(connectivitySettings.getNodePositions().rows() != 0 && i < connectivitySettings.getNodePositions().rows()) {
102 rowVert(0) = connectivitySettings.getNodePositions().row(i)(0);
103 rowVert(1) = connectivitySettings.getNodePositions().row(i)(1);
104 rowVert(2) = connectivitySettings.getNodePositions().row(i)(2);
118 QFuture<MatrixXd> resultMat = QtConcurrent::mappedReduced(connectivitySettings.getTrialData(),
121 resultMat.waitForFinished();
123 MatrixXd matDist = resultMat.result();
138 MatrixXd matWeight(1,1);
139 QSharedPointer<NetworkEdge> pEdge;
142 for(
int i = 0; i < matDist.rows(); ++i) {
143 for(j = i; j < matDist.cols(); ++j) {
144 matWeight << matDist(i,j);
146 pEdge = QSharedPointer<NetworkEdge>(
new NetworkEdge(i, j, matWeight));
148 finalNetwork.
getNodeAt(i)->append(pEdge);
149 finalNetwork.
getNodeAt(j)->append(pEdge);
150 finalNetwork.
append(pEdge);
165 MatrixXd matDist = MatrixXd::Zero(inputData.matData.rows(), inputData.matData.rows());
169 matDist = inputData.matData * inputData.matData.transpose();
185 const MatrixXd &data)
187 if(resultData.rows() != data.rows() || resultData.cols() != data.cols()) {
188 resultData.resize(data.rows(), data.cols());
189 resultData.setZero();