[Boost-bugs] [Boost C++ Libraries] #10680: Cannot use Eigen vector as state type in integrate?

Subject: [Boost-bugs] [Boost C++ Libraries] #10680: Cannot use Eigen vector as state type in integrate?
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-10-20 20:43:23


#10680: Cannot use Eigen vector as state type in integrate?
-------------------------------+---------------------
 Reporter: ilja.j.honkonen@… | Owner: karsten
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: odeint
  Version: Boost 1.56.0 | Severity: Problem
 Keywords: |
-------------------------------+---------------------
 The program

 {{{
 #include "boost/numeric/odeint.hpp"
 #include "Eigen/Core"

 using namespace boost::numeric::odeint;

 int main()
 {
         Eigen::Vector3d state(0, 0, 0);
         integrate(
                 [](const auto& state, auto& change, const double
 /*time*/){
                         change = Eigen::Vector3d(1, 0, 0);
                 },
                 state,
                 0.0,
                 1.0,
                 0.1
         );
         return 0;
 }
 }}}

 does not compile with Apple LLVM version 6.0 (clang-600.0.51) (based on
 LLVM 3.5svn) using -std=c++1y

 {{{
 In file included from /Users/iljah/include/boost/numeric/odeint.hpp:67:
 /Users/iljah/include/boost/numeric/odeint/integrate/integrate.hpp:59:12:
 error: no matching function for call to
       'integrate'
     return integrate( system , start_state , start_time , end_time , dt ,
 null_observer() );
            ^~~~~~~~~
 odeint1.cpp:9:2: note: in instantiation of function template
 specialization 'boost::numeric::odeint::integrate<<lambda
       at odeint1.cpp:10:3>, Eigen::Matrix<double, 3, 1, 0, 3, 1>, double>'
 requested here
         integrate(
         ^
 /Users/iljah/include/boost/numeric/odeint/integrate/integrate.hpp:44:28:
 note: candidate template ignored: disabled by
       'enable_if' [with System = <lambda at odeint1.cpp:10:3>, State =
 Eigen::Matrix<double, 3, 1, 0, 3, 1>, Time =
       double, Observer = boost::numeric::odeint::null_observer]
 typename boost::enable_if< typename has_value_type<State>::type , size_t
>::type
                            ^
 /Users/iljah/include/boost/numeric/odeint/integrate/integrate.hpp:57:8:
 note: candidate function template not viable:
       requires 5 arguments, but 6 were provided
 size_t integrate( System system , State &start_state , Time start_time ,
 Time end_time , Time dt )
        ^
 1 error generated.
 }}}

 Based on "disabled by 'enable_if'" I'd guess the problem is in odeint not
 Eigen, or this a user error? I get many more errors if the state type is
 e.g. a std::array of Eigen vectors but I'll create another ticket if that
 issue persists.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/10680>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:17 UTC