|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r58251 - in sandbox/odeint: boost/numeric/odeint branches/karsten/boost/numeric/odeint branches/karsten/boost/numeric/odeint/detail
From: mario.mulansky_at_[hidden]
Date: 2009-12-09 11:55:26
Author: mariomulansky
Date: 2009-12-09 11:55:24 EST (Wed, 09 Dec 2009)
New Revision: 58251
URL: http://svn.boost.org/trac/boost/changeset/58251
Log:
iterator traits...
Text files modified:
sandbox/odeint/boost/numeric/odeint/controlled_stepper_bs.hpp | 10 +++++-----
sandbox/odeint/boost/numeric/odeint/error_checker_standard.hpp | 14 ++++++++++++++
sandbox/odeint/branches/karsten/boost/numeric/odeint/container_traits_mtl4_dense2d.hpp | 12 ++++++------
sandbox/odeint/branches/karsten/boost/numeric/odeint/detail/iterator_algebra.hpp | 3 ++-
4 files changed, 27 insertions(+), 12 deletions(-)
Modified: sandbox/odeint/boost/numeric/odeint/controlled_stepper_bs.hpp
==============================================================================
--- sandbox/odeint/boost/numeric/odeint/controlled_stepper_bs.hpp (original)
+++ sandbox/odeint/boost/numeric/odeint/controlled_stepper_bs.hpp 2009-12-09 11:55:24 EST (Wed, 09 Dec 2009)
@@ -94,9 +94,9 @@
typedef std::vector< std::vector< time_type > > value_matrix;
typedef std::vector< unsigned short > us_vector;
- value_vector m_error;
- value_vector m_a;
- value_matrix m_alpha;
+ value_vector m_error; // errors of repeated midpoint steps and extrapolations
+ value_vector m_a; // stores the work (number of f calls) required for the orders
+ value_matrix m_alpha; // stores convergence factor for stepsize adjustment
us_vector m_interval_sequence;
value_vector m_times;
@@ -168,7 +168,7 @@
unsigned short k_conv = 0;
for( unsigned short k=0; k<=m_current_k_max; k++ )
- {
+ { // loop through interval numbers
unsigned short stepcount = m_interval_sequence[k];
//out-of-place midpoint step
m_stepper_mp.set_stepcount(stepcount);
@@ -215,7 +215,7 @@
}
}
}
- if( !converged ) { // dt was too large - no converge up to order k_max
+ if( !converged ) { // dt was too large - no convergence up to order k_max
// step_scale is always > 1
step_scale = std::max(step_scale, m_min_step_scale); // at least m_min ...
Modified: sandbox/odeint/boost/numeric/odeint/error_checker_standard.hpp
==============================================================================
--- sandbox/odeint/boost/numeric/odeint/error_checker_standard.hpp (original)
+++ sandbox/odeint/boost/numeric/odeint/error_checker_standard.hpp 2009-12-09 11:55:24 EST (Wed, 09 Dec 2009)
@@ -1,3 +1,17 @@
+/* Boost odeint/error_checker_standard.hpp header file
+
+ Copyright 2009 Karsten Ahnert
+ Copyright 2009 Mario Mulansky
+
+ This file includes the standard error checker to be used with
+ controlled steppers. It's purpose is to provide a method
+ that calculates the error ration of a given error-estimation
+ with respect to some user defined tolerance.
+
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENSE_1_0.txt or
+ copy at http://www.boost.org/LICENSE_1_0.txt)
+*/
#ifndef BOOST_NUMERIC_ODEINT_ERROR_CHECKER_STANDARD_HPP
Modified: sandbox/odeint/branches/karsten/boost/numeric/odeint/container_traits_mtl4_dense2d.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/container_traits_mtl4_dense2d.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/container_traits_mtl4_dense2d.hpp 2009-12-09 11:55:24 EST (Wed, 09 Dec 2009)
@@ -138,9 +138,9 @@
// define iterator traits for dense2D iterators
namespace std {
-template <typename Value_Map, typename Cursor , typename Value >
+template < typename Cursor , typename Value , typename Parameters>
struct iterator_traits<
- mtl::utilities::iterator_adaptor< Value_Map, Cursor, Value >
+ mtl::utilities::iterator_adaptor< mtl::detail::direct_value< mtl::dense2D< Value , Parameters > >, Cursor, Value >
>
{
typedef Value value_type;
@@ -151,10 +151,9 @@
};
- /*
-template <typename Value, typename Parameters >
+template < typename Cursor , typename Value , typename Parameters>
struct iterator_traits<
- typename boost::numeric::odeint::container_traits< mtl::dense2D< Value , Parameters > >::const_iterator
+ mtl::utilities::iterator_adaptor< mtl::detail::direct_const_value< mtl::dense2D< Value , Parameters > >, Cursor, Value >
>
{
typedef const Value value_type;
@@ -163,7 +162,8 @@
typedef const Value& reference;
typedef std::random_access_iterator_tag iterator_category;
};
- */
+
+
}
Modified: sandbox/odeint/branches/karsten/boost/numeric/odeint/detail/iterator_algebra.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/detail/iterator_algebra.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/detail/iterator_algebra.hpp 2009-12-09 11:55:24 EST (Wed, 09 Dec 2009)
@@ -36,8 +36,9 @@
T alpha
)
{
+ typedef typename std::iterator_traits<InputIterator>::value_type value_type;
while( first1 != last1 )
- (*first1++) += alpha * (*first2++);
+ (*first1++) += alpha * static_cast<value_type>(*first2++);
}
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