Peano
Loading...
Searching...
No Matches
mghype.cpph
Go to the documentation of this file.
1#include <cmath> // for std::pow
2
3
4template <int Rows, int Cols>
7 const std::vector<int>& scaleFactors,
9) {
10 assertionEquals( scaleFactors.size(), matrices.size() );
12 auto scaleIter = scaleFactors.begin();
13 auto matrixIter = matrices.begin();
14 // no need to compare both iterators, as the vectors have same size
15 for (; matrixIter!=matrices.end(); matrixIter++, scaleIter++) {
16 output = output + (*matrixIter) * std::pow(h(0), *scaleIter);
17 }
18 return output;
19}
#define assertionEquals(lhs, rhs)
Static (i.e.
Definition Matrix.h:31
tarch::la::Matrix< Rows, Cols, double > composeMatrixFromHWeightedLinearCombination(const std::vector< tarch::la::Matrix< Rows, Cols, double > > &matrices, const std::vector< int > &scaleFactors, const tarch::la::Vector< Dimensions, double > &h)
Compute a weighted linear combination of matrices.
Definition mghype.cpph:5
Simple vector class.
Definition Vector.h:134