1 /* 2 [auto_generated] 3 libs/numeric/odeint/test/resizing_test_state_type.hpp 4 5 [begin_description] 6 tba. 7 [end_description] 8 9 Copyright 2009-2012 Karsten Ahnert 10 Copyright 2009-2012 Mario Mulansky 11 12 Distributed under the Boost Software License, Version 1.0. 13 (See accompanying file LICENSE_1_0.txt or 14 copy at http://www.boost.org/LICENSE_1_0.txt) 15 */ 16 17 18 #ifndef LIBS_NUMERIC_ODEINT_TEST_RESIZING_TEST_STATE_TYPE_HPP_DEFINED 19 #define LIBS_NUMERIC_ODEINT_TEST_RESIZING_TEST_STATE_TYPE_HPP_DEFINED 20 21 #include <boost/numeric/odeint/util/is_resizeable.hpp> 22 #include <boost/numeric/odeint/util/resize.hpp> 23 #include <boost/numeric/odeint/util/same_size.hpp> 24 25 #include <boost/array.hpp> 26 27 28 29 // Mario: velocity verlet tests need arrays of size 2 30 // some ugly detailed dependency, maybe this can be improved? 31 class test_array_type : public boost::array< double , 2 > { }; 32 33 size_t adjust_size_count; 34 35 namespace boost { 36 namespace numeric { 37 namespace odeint { 38 39 template<> 40 struct is_resizeable< test_array_type > 41 { 42 typedef boost::true_type type; 43 const static bool value = type::value; 44 }; 45 46 template<> 47 struct same_size_impl< test_array_type , test_array_type > 48 { same_sizeboost::numeric::odeint::same_size_impl49 static bool same_size( const test_array_type &x1 , const test_array_type &x2 ) 50 { 51 return false; 52 } 53 }; 54 55 template<> 56 struct resize_impl< test_array_type , test_array_type > 57 { resizeboost::numeric::odeint::resize_impl58 static void resize( test_array_type &x1 , const test_array_type &x2 ) 59 { 60 adjust_size_count++; 61 } 62 }; 63 64 } // namespace odeint 65 } // namespace numeric 66 } // namespace boost 67 68 69 #endif // LIBS_NUMERIC_ODEINT_TEST_RESIZING_TEST_STATE_TYPE_HPP_DEFINED 70