diff options
author | Hauke Heibel <hauke.heibel@gmail.com> | 2009-09-07 17:22:01 +0200 |
---|---|---|
committer | Hauke Heibel <hauke.heibel@gmail.com> | 2009-09-07 17:22:01 +0200 |
commit | 64095b66108d358ebd31ab2cc596421b2bddfff3 (patch) | |
tree | d1c321dfc0f6d1d7196b7d2fec85187794883281 /test | |
parent | 8f4bf4ed7ffa4f39957118a5b4162613b21f190a (diff) |
Changed the AnyMatrixBase / ei_special_scalar_op inheritance order as proposed by Gael.
Added conservativeResizeLike as discussed on the mailing list.
Diffstat (limited to 'test')
-rw-r--r-- | test/conservative_resize.cpp | 46 |
1 files changed, 30 insertions, 16 deletions
diff --git a/test/conservative_resize.cpp b/test/conservative_resize.cpp index f0d025283..e4ff4f331 100644 --- a/test/conservative_resize.cpp +++ b/test/conservative_resize.cpp @@ -108,22 +108,36 @@ void run_vector_tests() } } +template <typename Scalar, int Storage> +void run_resize_like_tests() +{ + typedef Matrix<Scalar, Eigen::Dynamic, 1, Storage> MatrixType; + + MatrixType m; + + m = MatrixType::Random(5); + m.conservativeResizeLike( MatrixType::Ones(2) ); + std::cout << m << std::endl; +} + void test_conservative_resize() { - run_matrix_tests<int, Eigen::RowMajor>(); - run_matrix_tests<int, Eigen::ColMajor>(); - run_matrix_tests<float, Eigen::RowMajor>(); - run_matrix_tests<float, Eigen::ColMajor>(); - run_matrix_tests<double, Eigen::RowMajor>(); - run_matrix_tests<double, Eigen::ColMajor>(); - run_matrix_tests<std::complex<float>, Eigen::RowMajor>(); - run_matrix_tests<std::complex<float>, Eigen::ColMajor>(); - run_matrix_tests<std::complex<double>, Eigen::RowMajor>(); - run_matrix_tests<std::complex<double>, Eigen::ColMajor>(); - - run_vector_tests<int>(); - run_vector_tests<float>(); - run_vector_tests<double>(); - run_vector_tests<std::complex<float> >(); - run_vector_tests<std::complex<double> >(); + run_resize_like_tests<int, Eigen::RowMajor>(); + + //run_matrix_tests<int, Eigen::RowMajor>(); + //run_matrix_tests<int, Eigen::ColMajor>(); + //run_matrix_tests<float, Eigen::RowMajor>(); + //run_matrix_tests<float, Eigen::ColMajor>(); + //run_matrix_tests<double, Eigen::RowMajor>(); + //run_matrix_tests<double, Eigen::ColMajor>(); + //run_matrix_tests<std::complex<float>, Eigen::RowMajor>(); + //run_matrix_tests<std::complex<float>, Eigen::ColMajor>(); + //run_matrix_tests<std::complex<double>, Eigen::RowMajor>(); + //run_matrix_tests<std::complex<double>, Eigen::ColMajor>(); + + //run_vector_tests<int>(); + //run_vector_tests<float>(); + //run_vector_tests<double>(); + //run_vector_tests<std::complex<float> >(); + //run_vector_tests<std::complex<double> >(); } |