algebra dispatcher now recognizes dts::array

This commit is contained in:
Mario Mulansky 2014-11-11 18:32:11 +01:00
parent 133fb843d3
commit f171a84ba7
2 changed files with 27 additions and 6 deletions

View File

@ -19,6 +19,7 @@
#include <complex>
#include <boost/config.hpp>
#include <boost/type_traits/is_floating_point.hpp>
#include <boost/numeric/ublas/vector.hpp>
@ -84,4 +85,26 @@ struct algebra_dispatcher< boost::numeric::ublas::matrix< T , L , A > >
}
}
#ifndef BOOST_NO_CXX11_HDR_ARRAY
// Specialization for std::array if available
#include <array>
namespace boost {
namespace numeric {
namespace odeint {
// specialize for std::array
template< class T , size_t N >
struct algebra_dispatcher< std::array< T , N > >
{
typedef array_algebra algebra_type;
};
} } }
#endif
#endif

View File

@ -9,15 +9,12 @@
import testing ;
use-project boost : $(BOOST_ROOT) ;
# use-project boost : $(BOOST_ROOT) ;
project
: requirements
# explicitely include ../include directory first to make sure local odeint
# is found first
<include>../include&&$(BOOST_ROOT)
<library>/boost/test//boost_unit_test_framework
<define>BOOST_ALL_NO_LIB=1
<library>$(BOOST_ROOT)/stage/lib/libboost_unit_test_framework.a
<link>static
<toolset>clang:<cxxflags>-Wno-unused-variable
# <cxxflags>-D_SCL_SECURE_NO_WARNINGS
@ -78,7 +75,8 @@ test-suite "odeint"
[ compile unwrap_reference.cpp : <cxxflags>-std=c++0x : unwrap_reference_C++11 ]
[ compile-fail unwrap_reference.cpp : <cxxflags>-std=c++98 : unwrap_reference_C++98 ]
[ compile std_array.cpp : <cxxflags>-std=c++0x ]
: <testing.launcher>valgrind
:
<testing.launcher>valgrind
;
# also run numeric tests