Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r71962 - sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/taylor/taylor_v4
From: mario.mulansky_at_[hidden]
Date: 2011-05-15 15:18:12


Author: mariomulansky
Date: 2011-05-15 15:18:12 EDT (Sun, 15 May 2011)
New Revision: 71962
URL: http://svn.boost.org/trac/boost/changeset/71962

Log:
changed std::tr1::array -> boost::array to be platform independent
removed reference in taylor.hpp to make it compile with msvc
Text files modified:
   sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/taylor/taylor_v4/taylor.hpp | 18 ++++++++++++------
   sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/taylor/taylor_v4/taylor_lorenz_evol_adaptive_statistics.cpp | 4 ++--
   sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/taylor/taylor_v4/taylor_main.cpp | 2 +-
   3 files changed, 15 insertions(+), 9 deletions(-)

Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/taylor/taylor_v4/taylor.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/taylor/taylor_v4/taylor.hpp (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/taylor/taylor_v4/taylor.hpp 2011-05-15 15:18:12 EDT (Sun, 15 May 2011)
@@ -10,7 +10,7 @@
 
 #include <ostream>
 #include <cmath>
-#include <tr1/array>
+#include <boost/array.hpp>
 
 #include <iostream>
 using namespace std;
@@ -82,7 +82,7 @@
         struct taylor_context
         {
                 typedef State state_type;
- typedef std::tr1::array< state_type , MaxOrder > deriv_type;
+ typedef boost::array< state_type , MaxOrder > deriv_type;
 
                 size_t which;
                 const state_type &x;
@@ -363,7 +363,13 @@
                 void operator()( Index )
                 {
                         typedef typename fusion::result_of::at< System , Index >::type expr_type;
- const expr_type &expr = boost::fusion::at< Index >( m_sys );
+
+ /* Mario: changed to make it compile with msvc 9.0
+ * error: invalid type: reference to reference
+ */
+ //const expr_type &expr = boost::fusion::at< Index >( m_sys );
+ expr_type expr = boost::fusion::at< Index >( m_sys );
+ /* end changes */
 
                         double deriv = taylor_transform()( expr , 0.0 , m_data );
                         m_data.derivs[ m_data.which ][ Index::value ] = m_data.dt_fac / double( m_data.which + 1 ) * deriv;
@@ -371,7 +377,7 @@
         };
 
         template< class System , class State , size_t Order >
- eval_derivs< System , State , Order > make_eval_derivs( System sys , const State &x , std::tr1::array< State , Order > &derivs , double &dt_fac , size_t i )
+ eval_derivs< System , State , Order > make_eval_derivs( System sys , const State &x , boost::array< State , Order > &derivs , double &dt_fac , size_t i )
         {
                 return eval_derivs< System , State , Order >( sys , x , derivs , dt_fac , i );
         }
@@ -388,9 +394,9 @@
         typedef value_type time_type;
         typedef unsigned short order_type;
 
- typedef std::tr1::array< value_type , dim > state_type;
+ typedef boost::array< value_type , dim > state_type;
         typedef state_type deriv_type;
- typedef std::tr1::array< state_type , order_value > derivs_type;
+ typedef boost::array< state_type , order_value > derivs_type;
 
         taylor( value_type rel_error = 1.0e-14 , value_type abs_error = 1.0e-14 )
         : m_derivs() , m_dt_fac( 1.0 ) , m_rel_error( rel_error ) , m_abs_error( abs_error ) { }

Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/taylor/taylor_v4/taylor_lorenz_evol_adaptive_statistics.cpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/taylor/taylor_v4/taylor_lorenz_evol_adaptive_statistics.cpp (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/taylor/taylor_v4/taylor_lorenz_evol_adaptive_statistics.cpp 2011-05-15 15:18:12 EDT (Sun, 15 May 2011)
@@ -26,14 +26,14 @@
 #define tab "\t"
 
 template< typename T , size_t N >
-std::ostream& operator<<( std::ostream& out , const std::tr1::array< T , N > &x )
+std::ostream& operator<<( std::ostream& out , const boost::array< T , N > &x )
 {
         if( !x.empty() ) out << x[0];
         for( size_t i=1 ; i<x.size() ; ++i ) out << "\t" << x[i];
         return out;
 }
 
-typedef std::tr1::array< double , 3 > state_type;
+typedef boost::array< double , 3 > state_type;
 
 typedef boost::numeric::odeint::explicit_error_rk54_ck< state_type > rk54_type;
 

Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/taylor/taylor_v4/taylor_main.cpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/taylor/taylor_v4/taylor_main.cpp (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/taylor/taylor_v4/taylor_main.cpp 2011-05-15 15:18:12 EDT (Sun, 15 May 2011)
@@ -13,7 +13,7 @@
 #include <boost/fusion/include/make_vector.hpp>
 
 template< typename T , size_t N >
-std::ostream& operator<<( std::ostream& out , const std::tr1::array< T , N > &x )
+std::ostream& operator<<( std::ostream& out , const boost::array< T , N > &x )
 {
         if( !x.empty() ) out << x[0];
         for( size_t i=1 ; i<x.size() ; ++i ) out << "\t" << x[i];


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