/usr/include/boost/numeric/odeint/external/eigen
Edit: /usr/include/boost/numeric/odeint/external/eigen/eigen_algebra.hpp (2968B)
/*
[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
#include
// 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
inline const
typename Eigen::CwiseBinaryOp<
internal::scalar_sum_op::Scalar>,
typename DenseBase::ConstantReturnType,
const D>
operator+(const typename Eigen::MatrixBase &m,
const typename Eigen::internal::traits::Scalar &s) {
return CwiseBinaryOp<
internal::scalar_sum_op::Scalar>,
typename DenseBase::ConstantReturnType,
const D>(DenseBase::Constant(m.rows(), m.cols(), s), m.derived());
}
template
inline const
typename Eigen::CwiseBinaryOp<
internal::scalar_sum_op::Scalar>,
typename DenseBase::ConstantReturnType,
const D>
operator+(const typename Eigen::internal::traits::Scalar &s,
const typename Eigen::MatrixBase &m) {
return CwiseBinaryOp<
internal::scalar_sum_op::Scalar>,
typename DenseBase::ConstantReturnType,
const D>(DenseBase::Constant(m.rows(), m.cols(), s), m.derived());
}
template
inline const
typename Eigen::CwiseBinaryOp<
typename Eigen::internal::scalar_quotient_op<
typename Eigen::internal::traits::Scalar>,
const D1, const D2>
operator/(const Eigen::MatrixBase &x1, const Eigen::MatrixBase &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
struct vector_space_norm_inf< Eigen::Matrix >
{
typedef B result_type;
result_type operator()( const Eigen::Matrix &m ) const
{
return m.template lpNorm();
}
};
} } } // end boost::numeric::odeint namespace
#endif // BOOST_NUMERIC_ODEINT_EXTERNAL_EIGEN_EIGEN_ALGEBRA_HPP_INCLUDED