From d9259b48ca684aa4fa6ea2fa680698f37fa0b6ab Mon Sep 17 00:00:00 2001 From: Oliver Sander <sander@igpm.rwth-aachen.de> Date: Thu, 8 Mar 2012 10:39:06 +0000 Subject: [PATCH] Support for square matrices [[Imported from SVN: r8555]] --- test/valuefactory.hh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/test/valuefactory.hh b/test/valuefactory.hh index db9aa269..8406c18e 100644 --- a/test/valuefactory.hh +++ b/test/valuefactory.hh @@ -225,5 +225,28 @@ public: }; +/** \brief A class that creates sets of values of various types, to be used in unit tests + * + * This is the specialization for square FieldMatrices + */ +template <class T, int N> +class ValueFactory<Dune::FieldMatrix<T,N,N> > +{ +public: + static void get(std::vector<Dune::FieldMatrix<T,N,N> >& values) { + + int nTestPoints = 10; + values.resize(nTestPoints); + + // Set up elements of T^{N \times N} + for (int i=0; i<nTestPoints; i++) + for (int j=0; j<N; j++) + for (int k=0; k<N; k++) + values[i][j][k] = std::rand(); + + } + +}; + #endif \ No newline at end of file -- GitLab