]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/numeric/odeint/include/boost/numeric/odeint/external/eigen/eigen_algebra.hpp
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / numeric / odeint / include / boost / numeric / odeint / external / eigen / eigen_algebra.hpp
CommitLineData
7c673cae
FG
1/*
2 [auto_generated]
3 boost/numeric/odeint/external/eigen/eigen_algebra.hpp
4
5 [begin_description]
6 tba.
7 [end_description]
8
9 Copyright 2013 Christian Shelton
10 Copyright 2013 Karsten Ahnert
11
12 Distributed under the Boost Software License, Version 1.0.
13 (See accompanying file LICENSE_1_0.txt or
14 copy at http://www.boost.org/LICENSE_1_0.txt)
15*/
16
17
18#ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_EIGEN_EIGEN_ALGEBRA_HPP_INCLUDED
19#define BOOST_NUMERIC_ODEINT_EXTERNAL_EIGEN_EIGEN_ALGEBRA_HPP_INCLUDED
20
21#include <Eigen/Dense>
22#include <boost/numeric/odeint/algebra/vector_space_algebra.hpp>
23
24// Necessary routines for Eigen matrices to work with vector_space_algebra
25// from odeint
26// (that is, it lets odeint treat the eigen matrices correctly, knowing
27// how to add, multiply, compute the norm, etc)
28
29namespace Eigen {
30
31
32template<typename D>
33inline const
34typename Eigen::CwiseUnaryOp<
35 typename Eigen::internal::scalar_add_op<
36 typename Eigen::internal::traits<D>::Scalar>,
37 const D >
38operator+(const typename Eigen::MatrixBase<D> &m,
39 const typename Eigen::internal::traits<D>::Scalar &s) {
40 return Eigen::CwiseUnaryOp<
41 typename Eigen::internal::scalar_add_op<
42 typename Eigen::internal::traits<D>::Scalar>,
43 const D >(m.derived(),Eigen::internal::scalar_add_op<
44 typename Eigen::internal::traits<D>::Scalar>(s));
45}
46
47template<typename D>
48inline const
49typename Eigen::CwiseUnaryOp<
50 typename Eigen::internal::scalar_add_op<
51 typename Eigen::internal::traits<D>::Scalar>,
52 const D >
53operator+(const typename Eigen::internal::traits<D>::Scalar &s,
54const typename Eigen::MatrixBase<D> &m) {
55 return Eigen::CwiseUnaryOp<
56 typename Eigen::internal::scalar_add_op<
57 typename Eigen::internal::traits<D>::Scalar>,
58 const D >(m.derived(),Eigen::internal::scalar_add_op<
59 typename Eigen::internal::traits<D>::Scalar>(s));
60}
61
62
63
64template<typename D1,typename D2>
65inline const
66typename Eigen::CwiseBinaryOp<
67 typename Eigen::internal::scalar_quotient_op<
68 typename Eigen::internal::traits<D1>::Scalar>,
69 const D1, const D2>
70operator/(const Eigen::MatrixBase<D1> &x1, const Eigen::MatrixBase<D2> &x2) {
71 return x1.cwiseQuotient(x2);
72}
73
74
75template< typename D >
76inline const
77typename Eigen::CwiseUnaryOp<
78 typename Eigen::internal::scalar_abs_op<
79 typename Eigen::internal::traits< D >::Scalar > ,
80 const D >
81abs( const Eigen::MatrixBase< D > &m ) {
82 return m.cwiseAbs();
83}
84
85
86
87} // end Eigen namespace
88
89
90
91
92
93namespace boost {
94namespace numeric {
95namespace odeint {
96
97template<typename B,int S1,int S2,int O, int M1, int M2>
98struct vector_space_norm_inf< Eigen::Matrix<B,S1,S2,O,M1,M2> >
99{
100 typedef B result_type;
101 result_type operator()( const Eigen::Matrix<B,S1,S2,O,M1,M2> &m ) const
102 {
103 return m.template lpNorm<Eigen::Infinity>();
104 }
105};
106
107} } } // end boost::numeric::odeint namespace
108
109#endif // BOOST_NUMERIC_ODEINT_EXTERNAL_EIGEN_EIGEN_ALGEBRA_HPP_INCLUDED