20 #include "matrixlinker.h"
21 #include "randomgenerator.h"
23 using namespace Eigen;
29 nrows(fromVector().size()),
30 ncols(toVector().size()),
31 w(MatrixXd::Zero(nrows, ncols)) {
35 :
Linker( params, prefix ),
36 nrows(fromVector().size()),
37 ncols(toVector().size()),
38 w(MatrixXd::Zero(nrows, ncols)) {
40 QString str = params.
getValue(prefix +
"weights");
42 QStringList list = str.split(QRegExp(
"\\s+"), QString::SkipEmptyParts);
43 int cycleLength = nrows*ncols;
44 if (list.size() != cycleLength) {
46 qWarning() <<
"The number of elements of the weights in configuration file (" << list.size()
47 <<
") is different from the total number of weights (" << cycleLength <<
").";
49 cycleLength =
std::min(list.size(), cycleLength);
51 for(
int i=0; i<cycleLength; i++) {
53 unsigned int r = i/ncols;
54 unsigned int c = i%ncols;
55 w(r,c) = list[i].toDouble(&ok);
71 for (
unsigned int i = 0; i<nrows; i++ ) {
72 for (
unsigned int j = 0; j<ncols; j++ ) {
91 for(
unsigned int r=0; r<
rows(); r++ ) {
92 for(
unsigned int c=0; c<
cols(); c++ ) {
93 list.push_back(QString::number(w(r,c)));