|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r57089 - in sandbox/odeint: boost/numeric/odeint libs/numeric/odeint/examples
From: mario.mulansky_at_[hidden]
Date: 2009-10-23 10:14:00
Author: mariomulansky
Date: 2009-10-23 10:13:59 EDT (Fri, 23 Oct 2009)
New Revision: 57089
URL: http://svn.boost.org/trac/boost/changeset/57089
Log:
renamed resize classes to resizable and nonresizable to makes their meaning more clear
Text files modified:
sandbox/odeint/boost/numeric/odeint/euler.hpp | 21 +++++++++------------
sandbox/odeint/libs/numeric/odeint/examples/lorenz_array.cpp | 3 ++-
2 files changed, 11 insertions(+), 13 deletions(-)
Modified: sandbox/odeint/boost/numeric/odeint/euler.hpp
==============================================================================
--- sandbox/odeint/boost/numeric/odeint/euler.hpp (original)
+++ sandbox/odeint/boost/numeric/odeint/euler.hpp 2009-10-23 10:13:59 EDT (Fri, 23 Oct 2009)
@@ -24,12 +24,9 @@
namespace numeric {
namespace odeint {
-
- template< class ContainerType >
- class container_resizer
+ struct resizable
{
- public:
-
+ template< class ContainerType >
void resize( const ContainerType &x , ContainerType &dxdt ) const
{
if( x.size() != dxdt.size() )
@@ -39,12 +36,12 @@
- template< class T , int N >
- class array_resizer
+ struct non_resizable
{
- public:
- void resize( const std::tr1::array<T,N> &x , std::tr1::array<T,N> &dxdt ) const
- {
+ template< class ContainerType >
+ void resize( const ContainerType &x , ContainerType &dxdt ) const
+ {
+ throw; //should not happen
}
};
@@ -52,13 +49,13 @@
template<
class ContainerType ,
- class ResizerType = container_resizer<ContainerType>
+ class ResizeType = resizable
>
class ode_step_euler
{
// BOOST_CLASS_REQUIRE( ContainerType , boost , SequenceConcept );
ContainerType dxdt;
- ResizerType resizer;
+ ResizeType resizer;
typedef typename ContainerType::iterator iterator;
Modified: sandbox/odeint/libs/numeric/odeint/examples/lorenz_array.cpp
==============================================================================
--- sandbox/odeint/libs/numeric/odeint/examples/lorenz_array.cpp (original)
+++ sandbox/odeint/libs/numeric/odeint/examples/lorenz_array.cpp 2009-10-23 10:13:59 EDT (Fri, 23 Oct 2009)
@@ -52,7 +52,8 @@
x[1] = 0.0;
x[2] = 0.0;
- ode_step_euler< state_type , array_resizer<double,3> > euler;
+ // tr1::array is not resizable, we have to tell this to the stepper!
+ ode_step_euler< state_type , non_resizable > euler;
double t = 0.0;
for( size_t oi=0 ; oi<olen ; ++oi,t+=dt )
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk