diff options
author | Gael Guennebaud <g.gael@free.fr> | 2016-08-29 18:56:46 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2016-08-29 18:56:46 +0200 |
commit | e074f720c71e2ecf74932af80cbfbf670565730e (patch) | |
tree | 5cfdbeb23fa8c8f6f3cb21cb16f378cc3728099f /unsupported/test/kronecker_product.cpp | |
parent | 2915e1fc5de1cd830eb1a4a723c41a7b14d87254 (diff) |
Include missing forward declaration of SparseMatrix
Diffstat (limited to 'unsupported/test/kronecker_product.cpp')
-rw-r--r-- | unsupported/test/kronecker_product.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/unsupported/test/kronecker_product.cpp b/unsupported/test/kronecker_product.cpp index 02411a262..e770049e5 100644 --- a/unsupported/test/kronecker_product.cpp +++ b/unsupported/test/kronecker_product.cpp @@ -9,12 +9,12 @@ // Public License v. 2.0. If a copy of the MPL was not distributed // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. +#ifdef EIGEN_TEST_PART_1 #include "sparse.h" #include <Eigen/SparseExtra> #include <Eigen/KroneckerProduct> - template<typename MatrixType> void check_dimension(const MatrixType& ab, const int rows, const int cols) { @@ -230,3 +230,23 @@ void test_kronecker_product() VERIFY_IS_APPROX(MatrixXf(sC2),dC); } } + +#endif + +#ifdef EIGEN_TEST_PART_2 + +// simply check that for a dense kronecker product, sparse module is not needed + +#include "main.h" +#include <Eigen/KroneckerProduct> + +void test_kronecker_product() +{ + MatrixXd a(2,2), b(3,3), c; + a.setRandom(); + b.setRandom(); + c = kroneckerProduct(a,b); + VERIFY_IS_APPROX(c.block(3,3,3,3), a(1,1)*b); +} + +#endif |