1 //============================================================================== 2 // Copyright 2014 LRI UMR 8623 CNRS/Univ Paris Sud XI 3 // Copyright 2014 NumScale SAS 4 // 5 // Distributed under the Boost Software License, Version 1.0. 6 // See accompanying file LICENSE.txt or copy at 7 // http://www.boost.org/LICENSE_1_0.txt 8 //============================================================================== 9 #ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_NT2_NT2_RESIZE_HPP_INCLUDED 10 #define BOOST_NUMERIC_ODEINT_EXTERNAL_NT2_NT2_RESIZE_HPP_INCLUDED 11 12 #include <nt2/core/container/table/table.hpp> 13 14 #include <boost/numeric/odeint/util/same_size.hpp> 15 16 namespace boost { namespace numeric { namespace odeint { 17 18 template<typename T, typename S> 19 struct is_resizeable< nt2::container::table<T,S> > 20 { 21 typedef boost::true_type type; 22 static const bool value = type::value; 23 }; 24 25 template<typename T, typename S> 26 struct same_size_impl< nt2::container::table<T,S> 27 , nt2::container::table<T,S> 28 > 29 { same_sizeboost::numeric::odeint::same_size_impl30 static bool same_size ( const nt2::container::table<T,S> &v1 31 , const nt2::container::table<T,S> &v2 32 ) 33 { 34 return v1.extent() == v2.extent(); 35 } 36 }; 37 38 template<typename T, typename S> 39 struct resize_impl< nt2::container::table<T,S> 40 , nt2::container::table<T,S> 41 > 42 { resizeboost::numeric::odeint::resize_impl43 static void resize ( nt2::container::table<T,S> &v1 44 , const nt2::container::table<T,S> &v2 45 ) 46 { 47 v1.resize( v2.extent() ); 48 } 49 }; 50 } } } 51 52 #endif 53