Subject: Re: [Boost-bugs] [Boost C++ Libraries] #10680: Cannot use Eigen vector as state type in integrate?
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-01-29 21:41:10
#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
Resolution: | Keywords:
--------------------------------+---------------------
Comment (by karsten):
There are two problems with your code. First, eigen is not support by
default, you need to include the eigen adaption of odeint. And secondly,
integrate can not determine the value from the eigen vector by itself. If
you change the example to
{{{
#!cpp
#include "boost/numeric/odeint.hpp"
#include "boost/numeric/odeint/external/eigen/eigen.hpp"
#include "Eigen/Core"
using namespace boost::numeric::odeint;
int main()
{
Eigen::Vector3d state(0, 0, 0);
integrate< double >(
[](const auto& state, auto& change, const double /*time*/){
change = Eigen::Vector3d(1, 0, 0);
},
state,
0.0,
1.0,
0.1
);
return 0;
}
}}}
everything should work.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/10680#comment:1> 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