|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r67966 - sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper
From: karsten.ahnert_at_[hidden]
Date: 2011-01-11 13:12:16
Author: karsten
Date: 2011-01-11 13:12:15 EST (Tue, 11 Jan 2011)
New Revision: 67966
URL: http://svn.boost.org/trac/boost/changeset/67966
Log:
adjust_sizer works now with boost::array instead of ptr_array
Text files modified:
sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/adjust_size.hpp | 29 ++++++++++++++++++++++++-----
1 files changed, 24 insertions(+), 5 deletions(-)
Modified: sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/adjust_size.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/adjust_size.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/adjust_size.hpp 2011-01-11 13:12:15 EST (Tue, 11 Jan 2011)
@@ -13,8 +13,10 @@
#ifndef BOOST_NUMERIC_ODEINT_ADJUST_SIZE_HPP_INCLUDED
#define BOOST_NUMERIC_ODEINT_ADJUST_SIZE_HPP_INCLUDED
+#include <algorithm>
+
#include <boost/noncopyable.hpp>
-#include <boost/ptr_container/ptr_array.hpp>
+#include <boost/array.hpp>
#include <boost/numeric/odeint/algebra/standard_resize.hpp>
@@ -45,7 +47,10 @@
{
public:
- size_adjuster() : m_is_initialized( false ) { }
+ size_adjuster() : m_is_initialized( false ) , m_states()
+ {
+ std::fill( m_states.begin() , m_states.end() , static_cast< State* >( 0 ) );
+ }
bool adjust_size( const State &x )
{
@@ -74,7 +79,7 @@
void register_state( size_t idx , State &x )
{
- m_states.replace( idx , &x );
+ m_states[idx] = &x;
}
@@ -85,7 +90,7 @@
bool changed = false;
for( size_t i=0 ; i<Dim ; ++i )
{
- boost::numeric::odeint::adjust_size( x , m_states[i] );
+ boost::numeric::odeint::adjust_size( x , *(m_states[i]) );
changed = true;
}
return changed;
@@ -100,7 +105,7 @@
private :
bool m_is_initialized;
- boost::ptr_array< State , Dim , boost::view_clone_allocator > m_states;
+ boost::array< State* , Dim > m_states;
};
@@ -111,6 +116,20 @@
+
+
+
+
+
+
+
+
+
+
+
+/*
+ * really old stuff
+ */
//template< class State , class AdjustSizeImpl >
//class size_adjuster
//{
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