Boost logo

Boost :

Subject: Re: [boost] [odeint] gsoc 2011: finalization of odeint
From: Karsten Ahnert (karsten.ahnert_at_[hidden])
Date: 2011-03-22 16:01:01


> I would love to see this in Boost. Of course, odeint needs to play
well with Boost.Units. Here is how I would expect the code to look
(stripped down version of numeric/odeint/examples/lorenz_integrator.cpp) :

It works with Boost.Units, have a look at

https://svn.boost.org/svn/boost/sandbox/odeint/branches/karsten/libs/numeric/odeint/test/stepper_with_units.cpp

It also works well with fusion containers, where every entry can have a
different dimension.

> In particular, the steppers should be able to take a function pointer or other function object and derive the container types directly from it rather than requiring that these be provided as template parameters. Then the user need only provide the function to integrate (optionally providing a Jacobian for stiff solvers).
>
> Matthias
>

This seems to be difficult. The container type is used to store
intermediate values within the steppers, such that objects like

   container_type m_dxdt;

exist. I don't see a way to avoid this (without loss of performance).
But, it might be possible to use a default type for the internal
containers (like vector< double >) and then use a templatized functors, like

struct lorenz
{
    template< class State , class Value >
    void operator()( const State &x , State &dxdt, Value t )
    {
        ...
    }
};

Karsten


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk