整理
This commit is contained in:
27
include/boost/numeric/odeint/external/eigen/eigen.hpp
vendored
Normal file
27
include/boost/numeric/odeint/external/eigen/eigen.hpp
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
[auto_generated]
|
||||
boost/numeric/odeint/external/eigen/eigen.hpp
|
||||
|
||||
[begin_description]
|
||||
tba.
|
||||
[end_description]
|
||||
|
||||
Copyright 2009-2012 Karsten Ahnert
|
||||
Copyright 2009-2012 Mario Mulansky
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or
|
||||
copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
|
||||
|
||||
#ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_EIGEN_EIGEN_HPP_INCLUDED
|
||||
#define BOOST_NUMERIC_ODEINT_EXTERNAL_EIGEN_EIGEN_HPP_INCLUDED
|
||||
|
||||
|
||||
#include <boost/numeric/odeint/external/eigen/eigen_algebra.hpp>
|
||||
#include <boost/numeric/odeint/external/eigen/eigen_algebra_dispatcher.hpp>
|
||||
#include <boost/numeric/odeint/external/eigen/eigen_resize.hpp>
|
||||
|
||||
|
||||
#endif // BOOST_NUMERIC_ODEINT_EXTERNAL_EIGEN_EIGEN_HPP_INCLUDED
|
||||
98
include/boost/numeric/odeint/external/eigen/eigen_algebra.hpp
vendored
Normal file
98
include/boost/numeric/odeint/external/eigen/eigen_algebra.hpp
vendored
Normal file
@@ -0,0 +1,98 @@
|
||||
/*
|
||||
[auto_generated]
|
||||
boost/numeric/odeint/external/eigen/eigen_algebra.hpp
|
||||
|
||||
[begin_description]
|
||||
tba.
|
||||
[end_description]
|
||||
|
||||
Copyright 2013 Christian Shelton
|
||||
Copyright 2013 Karsten Ahnert
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or
|
||||
copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
|
||||
|
||||
#ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_EIGEN_EIGEN_ALGEBRA_HPP_INCLUDED
|
||||
#define BOOST_NUMERIC_ODEINT_EXTERNAL_EIGEN_EIGEN_ALGEBRA_HPP_INCLUDED
|
||||
|
||||
#include <Eigen/Dense>
|
||||
#include <boost/numeric/odeint/algebra/vector_space_algebra.hpp>
|
||||
|
||||
// Necessary routines for Eigen matrices to work with vector_space_algebra
|
||||
// from odeint
|
||||
// (that is, it lets odeint treat the eigen matrices correctly, knowing
|
||||
// how to add, multiply, compute the norm, etc)
|
||||
namespace Eigen {
|
||||
|
||||
template<typename D>
|
||||
inline const
|
||||
typename Eigen::CwiseBinaryOp<
|
||||
internal::scalar_sum_op<typename internal::traits<D>::Scalar>,
|
||||
typename DenseBase<D>::ConstantReturnType,
|
||||
const D>
|
||||
operator+(const typename Eigen::MatrixBase<D> &m,
|
||||
const typename Eigen::internal::traits<D>::Scalar &s) {
|
||||
return CwiseBinaryOp<
|
||||
internal::scalar_sum_op<typename internal::traits<D>::Scalar>,
|
||||
typename DenseBase<D>::ConstantReturnType,
|
||||
const D>(DenseBase<D>::Constant(m.rows(), m.cols(), s), m.derived());
|
||||
}
|
||||
|
||||
template<typename D>
|
||||
inline const
|
||||
typename Eigen::CwiseBinaryOp<
|
||||
internal::scalar_sum_op<typename internal::traits<D>::Scalar>,
|
||||
typename DenseBase<D>::ConstantReturnType,
|
||||
const D>
|
||||
operator+(const typename Eigen::internal::traits<D>::Scalar &s,
|
||||
const typename Eigen::MatrixBase<D> &m) {
|
||||
return CwiseBinaryOp<
|
||||
internal::scalar_sum_op<typename internal::traits<D>::Scalar>,
|
||||
typename DenseBase<D>::ConstantReturnType,
|
||||
const D>(DenseBase<D>::Constant(m.rows(), m.cols(), s), m.derived());
|
||||
}
|
||||
|
||||
template<typename D1,typename D2>
|
||||
inline const
|
||||
typename Eigen::CwiseBinaryOp<
|
||||
typename Eigen::internal::scalar_quotient_op<
|
||||
typename Eigen::internal::traits<D1>::Scalar>,
|
||||
const D1, const D2>
|
||||
operator/(const Eigen::MatrixBase<D1> &x1, const Eigen::MatrixBase<D2> &x2) {
|
||||
return x1.cwiseQuotient(x2);
|
||||
}
|
||||
|
||||
|
||||
template< typename D >
|
||||
inline const
|
||||
typename Eigen::CwiseUnaryOp<
|
||||
typename Eigen::internal::scalar_abs_op<
|
||||
typename Eigen::internal::traits< D >::Scalar > ,
|
||||
const D >
|
||||
abs( const Eigen::MatrixBase< D > &m ) {
|
||||
return m.cwiseAbs();
|
||||
}
|
||||
|
||||
} // end Eigen namespace
|
||||
|
||||
|
||||
namespace boost {
|
||||
namespace numeric {
|
||||
namespace odeint {
|
||||
|
||||
template<typename B,int S1,int S2,int O, int M1, int M2>
|
||||
struct vector_space_norm_inf< Eigen::Matrix<B,S1,S2,O,M1,M2> >
|
||||
{
|
||||
typedef B result_type;
|
||||
result_type operator()( const Eigen::Matrix<B,S1,S2,O,M1,M2> &m ) const
|
||||
{
|
||||
return m.template lpNorm<Eigen::Infinity>();
|
||||
}
|
||||
};
|
||||
|
||||
} } } // end boost::numeric::odeint namespace
|
||||
|
||||
#endif // BOOST_NUMERIC_ODEINT_EXTERNAL_EIGEN_EIGEN_ALGEBRA_HPP_INCLUDED
|
||||
49
include/boost/numeric/odeint/external/eigen/eigen_algebra_dispatcher.hpp
vendored
Normal file
49
include/boost/numeric/odeint/external/eigen/eigen_algebra_dispatcher.hpp
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
[auto_generated]
|
||||
boost/numeric/odeint/external/eigen/eigen_algebra_dispatcher.hpp
|
||||
|
||||
[begin_description]
|
||||
tba.
|
||||
[end_description]
|
||||
|
||||
Copyright 2009-2012 Karsten Ahnert
|
||||
Copyright 2009-2012 Mario Mulansky
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or
|
||||
copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
|
||||
|
||||
#ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_EIGEN_EIGEN_ALGEBRA_DISPATCHER_HPP_INCLUDED
|
||||
#define BOOST_NUMERIC_ODEINT_EXTERNAL_EIGEN_EIGEN_ALGEBRA_DISPATCHER_HPP_INCLUDED
|
||||
|
||||
|
||||
namespace boost {
|
||||
namespace numeric {
|
||||
namespace odeint {
|
||||
|
||||
|
||||
template< class Derived >
|
||||
struct algebra_dispatcher_sfinae< Derived ,
|
||||
typename boost::enable_if< typename boost::is_base_of< Eigen::MatrixBase< Derived > , Derived >::type >::type >
|
||||
{
|
||||
typedef vector_space_algebra algebra_type;
|
||||
};
|
||||
|
||||
|
||||
template < class Derived >
|
||||
struct algebra_dispatcher_sfinae< Derived ,
|
||||
typename boost::enable_if< typename boost::is_base_of< Eigen::ArrayBase< Derived > , Derived >::type >::type >
|
||||
{
|
||||
typedef vector_space_algebra algebra_type;
|
||||
};
|
||||
|
||||
|
||||
|
||||
} // namespace odeint
|
||||
} // namespace numeric
|
||||
} // namespace boost
|
||||
|
||||
|
||||
#endif // BOOST_NUMERIC_ODEINT_EXTERNAL_EIGEN_EIGEN_ALGEBRA_DISPATCHER_HPP_INCLUDED
|
||||
103
include/boost/numeric/odeint/external/eigen/eigen_resize.hpp
vendored
Normal file
103
include/boost/numeric/odeint/external/eigen/eigen_resize.hpp
vendored
Normal file
@@ -0,0 +1,103 @@
|
||||
/*
|
||||
[auto_generated]
|
||||
boost/numeric/odeint/external/eigen/eigen_resize.hpp
|
||||
|
||||
[begin_description]
|
||||
tba.
|
||||
[end_description]
|
||||
|
||||
Copyright 2013 Ankur Sinha
|
||||
Copyright 2013 Karsten Ahnert
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or
|
||||
copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
|
||||
|
||||
#ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_EIGEN_EIGEN_RESIZE_HPP_DEFINED
|
||||
#define BOOST_NUMERIC_ODEINT_EXTERNAL_EIGEN_EIGEN_RESIZE_HPP_DEFINED
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
#include <boost/numeric/odeint/util/is_resizeable.hpp>
|
||||
#include <boost/numeric/odeint/util/resize.hpp>
|
||||
#include <boost/numeric/odeint/util/same_size.hpp>
|
||||
|
||||
#include <Eigen/Dense>
|
||||
|
||||
namespace boost {
|
||||
namespace numeric {
|
||||
namespace odeint {
|
||||
|
||||
template< class Derived >
|
||||
struct is_resizeable_sfinae< Derived ,
|
||||
typename std::enable_if< std::is_base_of< Eigen::MatrixBase< Derived > , Derived >::value >::type >
|
||||
{
|
||||
typedef std::integral_constant<bool, true> type;
|
||||
const static bool value = type::value;
|
||||
};
|
||||
|
||||
|
||||
template < class Derived >
|
||||
struct is_resizeable_sfinae< Derived ,
|
||||
typename std::enable_if< std::is_base_of< Eigen::ArrayBase< Derived > , Derived >::value >::type >
|
||||
{
|
||||
typedef std::integral_constant<bool, true> type;
|
||||
const static bool value = type::value;
|
||||
};
|
||||
|
||||
|
||||
|
||||
template< class Derived >
|
||||
struct same_size_impl_sfinae< Derived , Derived ,
|
||||
typename std::enable_if< std::is_base_of< Eigen::MatrixBase< Derived > , Derived >::value >::type >
|
||||
{
|
||||
static bool same_size( const Eigen::MatrixBase< Derived > &m1 , const Eigen::MatrixBase< Derived > &m2 )
|
||||
|
||||
{
|
||||
return ( ( m1.innerSize () == m2.innerSize () ) && ( m1.outerSize() == m2.outerSize() ) );
|
||||
}
|
||||
};
|
||||
|
||||
template< class Derived >
|
||||
struct same_size_impl_sfinae< Derived , Derived ,
|
||||
typename std::enable_if< std::is_base_of< Eigen::ArrayBase< Derived > , Derived >::value >::type >
|
||||
{
|
||||
static bool same_size( const Eigen::ArrayBase< Derived > &v1 , const Eigen::ArrayBase< Derived > &v2 )
|
||||
{
|
||||
return ( ( v1.innerSize () == v2.innerSize () ) && ( v1.outerSize() == v2.outerSize() ) );
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
template< class Derived >
|
||||
struct resize_impl_sfinae< Derived , Derived ,
|
||||
typename std::enable_if< std::is_base_of< Eigen::MatrixBase< Derived > , Derived >::value >::type >
|
||||
{
|
||||
static void resize( Eigen::MatrixBase< Derived > &m1 , const Eigen::MatrixBase< Derived > &m2 )
|
||||
{
|
||||
m1.derived().resizeLike(m2);
|
||||
}
|
||||
};
|
||||
|
||||
template< class Derived >
|
||||
struct resize_impl_sfinae< Derived , Derived ,
|
||||
typename std::enable_if< std::is_base_of< Eigen::ArrayBase< Derived > , Derived >::value >::type >
|
||||
{
|
||||
static void resize( Eigen::ArrayBase< Derived > &v1 , const Eigen::ArrayBase< Derived > &v2 )
|
||||
{
|
||||
v1.derived().resizeLike(v2);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
} // namespace odeint
|
||||
} // namespace numeric
|
||||
} // namespace boost
|
||||
|
||||
|
||||
#endif // BOOST_NUMERIC_ODEINT_EXTERNAL_EIGEN_EIGEN_RESIZE_HPP_DEFINED
|
||||
Reference in New Issue
Block a user