same_size.cpp 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*
  2. [auto_generated]
  3. libs/numeric/odeint/test_external/eigen/same_size.cpp
  4. [begin_description]
  5. tba.
  6. [end_description]
  7. Copyright 2013 Karsten Ahnert
  8. Copyright 2013 Mario Mulansky
  9. Distributed under the Boost Software License, Version 1.0.
  10. (See accompanying file LICENSE_1_0.txt or
  11. copy at http://www.boost.org/LICENSE_1_0.txt)
  12. */
  13. #include <boost/config.hpp>
  14. #ifdef BOOST_MSVC
  15. #pragma warning(disable:4996)
  16. #endif
  17. #define BOOST_TEST_MODULE odeint_eigen_same_size
  18. #include <boost/test/unit_test.hpp>
  19. #include <boost/numeric/odeint/external/eigen/eigen_resize.hpp>
  20. using namespace boost::unit_test;
  21. using namespace boost::numeric::odeint;
  22. BOOST_AUTO_TEST_SUITE( eigen_same_size )
  23. BOOST_AUTO_TEST_CASE( compile_time_matrix )
  24. {
  25. typedef Eigen::Matrix< double , 1 , 1 > matrix_type;
  26. matrix_type a , b;
  27. BOOST_CHECK( boost::numeric::odeint::same_size( a , b ) );
  28. }
  29. BOOST_AUTO_TEST_CASE( runtime_matrix )
  30. {
  31. typedef Eigen::Matrix< double , Eigen::Dynamic , Eigen::Dynamic > matrix_type;
  32. matrix_type a( 10 , 2 ) , b( 10 , 2 );
  33. BOOST_CHECK( boost::numeric::odeint::same_size( a , b ) );
  34. }
  35. BOOST_AUTO_TEST_CASE( fail_runtime_matrix )
  36. {
  37. typedef Eigen::Matrix< double , Eigen::Dynamic , Eigen::Dynamic > matrix_type;
  38. matrix_type a( 11 , 2 ) , b( 10 , 2 );
  39. BOOST_CHECK( !boost::numeric::odeint::same_size( a , b ) );
  40. }
  41. BOOST_AUTO_TEST_CASE( compile_time_array )
  42. {
  43. typedef Eigen::Array< double , 1 , 1 > array_type;
  44. array_type a , b;
  45. BOOST_CHECK( boost::numeric::odeint::same_size( a , b ) );
  46. }
  47. BOOST_AUTO_TEST_CASE( runtime_array )
  48. {
  49. typedef Eigen::Array< double , Eigen::Dynamic , Eigen::Dynamic > array_type;
  50. array_type a( 10 , 2 ) , b( 10 , 2 );
  51. BOOST_CHECK( boost::numeric::odeint::same_size( a , b ) );
  52. }
  53. BOOST_AUTO_TEST_CASE( fail_runtime_array )
  54. {
  55. typedef Eigen::Array< double , Eigen::Dynamic , Eigen::Dynamic > array_type;
  56. array_type a( 11 , 2 ) , b( 10 , 2 );
  57. BOOST_CHECK( !boost::numeric::odeint::same_size( a , b ) );
  58. }
  59. BOOST_AUTO_TEST_SUITE_END()