mirror of
https://github.com/boostorg/odeint.git
synced 2026-02-18 14:22:07 +00:00
specializations so that nt2 works with odeint
This commit is contained in:
23
include/boost/numeric/odeint/external/nt2/nt2_algebra_dispatcher.hpp
vendored
Normal file
23
include/boost/numeric/odeint/external/nt2/nt2_algebra_dispatcher.hpp
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
//==============================================================================
|
||||
// Copyright 2014 LASMEA UMR 6602 CNRS/Univ. Clermont II
|
||||
// Copyright 2014 LRI UMR 8623 CNRS/Univ Paris Sud XI
|
||||
// Copyright 2014 MetaScale SAS
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See accompanying file LICENSE.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt
|
||||
//==============================================================================
|
||||
#ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_NT2_NT2_ALGEBRA_DISPATCHER_HPP_INCLUDED
|
||||
#define BOOST_NUMERIC_ODEINT_EXTERNAL_NT2_NT2_ALGEBRA_DISPATCHER_HPP_INCLUDED
|
||||
|
||||
#include <nt2/table.hpp>
|
||||
|
||||
namespace boost { namespace numeric { namespace odeint {
|
||||
template<typename T, typename S>
|
||||
struct algebra_dispatcher<nt2::container::table<T,S> >
|
||||
{
|
||||
typedef vector_space_algebra algebra_type;
|
||||
};
|
||||
} } }
|
||||
|
||||
#endif
|
||||
27
include/boost/numeric/odeint/external/nt2/nt2_copy.hpp
vendored
Normal file
27
include/boost/numeric/odeint/external/nt2/nt2_copy.hpp
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
//==============================================================================
|
||||
// Copyright 2014 LASMEA UMR 6602 CNRS/Univ. Clermont II
|
||||
// Copyright 2014 LRI UMR 8623 CNRS/Univ Paris Sud XI
|
||||
// Copyright 2014 MetaScale SAS
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See accompanying file LICENSE.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt
|
||||
//==============================================================================
|
||||
#ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_NT2_NT2_COPY_HPP_INCLUDED
|
||||
#define BOOST_NUMERIC_ODEINT_EXTERNAL_NT2_NT2_COPY_HPP_INCLUDED
|
||||
|
||||
#include <nt2/table.hpp>
|
||||
|
||||
namespace boost { namespace numeric { namespace odeint {
|
||||
|
||||
template<typename T, typename S>
|
||||
struct copy_impl<nt2::container::table<T,S> , nt2::container::table<T,S> >
|
||||
{
|
||||
static void copy(const nt2::container::table<T,S> &v1, nt2::container::table<T,S> &v2)
|
||||
{
|
||||
v2 = v1;
|
||||
}
|
||||
};
|
||||
} } }
|
||||
|
||||
#endif
|
||||
29
include/boost/numeric/odeint/external/nt2/nt2_norm_inf.hpp
vendored
Normal file
29
include/boost/numeric/odeint/external/nt2/nt2_norm_inf.hpp
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
//==============================================================================
|
||||
// Copyright 2014 LASMEA UMR 6602 CNRS/Univ. Clermont II
|
||||
// Copyright 2014 LRI UMR 8623 CNRS/Univ Paris Sud XI
|
||||
// Copyright 2014 MetaScale SAS
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See accompanying file LICENSE.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt
|
||||
//==============================================================================
|
||||
#ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_NT2_NT2_NORM_INF_HPP_INCLUDED
|
||||
#define BOOST_NUMERIC_ODEINT_EXTERNAL_NT2_NT2_NORM_INF_HPP_INCLUDED
|
||||
|
||||
#include <nt2/table.hpp>
|
||||
#include <nt2/include/functions/globalmax.hpp>
|
||||
#include <nt2/include/functions/abs.hpp>
|
||||
|
||||
namespace boost { namespace numeric { namespace odeint {
|
||||
template<typename T, typename S>
|
||||
struct vector_space_norm_inf<nt2::container::table<T,S> >
|
||||
{
|
||||
typedef T result_type;
|
||||
result_type operator()(const nt2::container::table<T,S> &v1) const
|
||||
{
|
||||
return nt2::globalmax(nt2::abs(v1));
|
||||
}
|
||||
};
|
||||
} } }
|
||||
|
||||
#endif
|
||||
45
include/boost/numeric/odeint/external/nt2/nt2_resize.hpp
vendored
Normal file
45
include/boost/numeric/odeint/external/nt2/nt2_resize.hpp
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
//==============================================================================
|
||||
// Copyright 2014 LASMEA UMR 6602 CNRS/Univ. Clermont II
|
||||
// Copyright 2014 LRI UMR 8623 CNRS/Univ Paris Sud XI
|
||||
// Copyright 2014 MetaScale SAS
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See accompanying file LICENSE.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt
|
||||
//==============================================================================
|
||||
#ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_NT2_NT2_RESIZE_HPP_INCLUDED
|
||||
#define BOOST_NUMERIC_ODEINT_EXTERNAL_NT2_NT2_RESIZE_HPP_INCLUDED
|
||||
|
||||
#include <nt2/table.hpp>
|
||||
|
||||
namespace boost { namespace numeric { namespace odeint {
|
||||
|
||||
template<typename T, typename S>
|
||||
struct is_resizeable< nt2::container::table<T,S> >
|
||||
{
|
||||
typedef boost::true_type type;
|
||||
static const bool value = type::value;
|
||||
};
|
||||
|
||||
template<typename T, typename S>
|
||||
struct same_size_impl< nt2::container::table<T,S> , nt2::container::table<T,S> >
|
||||
{
|
||||
static bool same_size( const nt2::container::table<T,S> &v1 ,
|
||||
const nt2::container::table<T,S> &v2 )
|
||||
{
|
||||
return v1.size() == v2.size();
|
||||
}
|
||||
};
|
||||
|
||||
template<typename T, typename S>
|
||||
struct resize_impl< nt2::container::table<T,S> , nt2::container::table<T,S> >
|
||||
{
|
||||
static void resize( nt2::container::table<T,S> &v1 ,
|
||||
const nt2::container::table<T,S> &v2 )
|
||||
{
|
||||
v1.resize( nt2::of_size(v2.size() ));
|
||||
}
|
||||
};
|
||||
} } }
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user