|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r57067 - sandbox/odeint/libs/numeric/odeint/examples
From: mario.mulansky_at_[hidden]
Date: 2009-10-22 11:10:17
Author: mariomulansky
Date: 2009-10-22 11:10:16 EDT (Thu, 22 Oct 2009)
New Revision: 57067
URL: http://svn.boost.org/trac/boost/changeset/57067
Log:
reduced everything to containers only
Removed:
sandbox/odeint/libs/numeric/odeint/examples/lorenz_carray.cpp
Text files modified:
sandbox/odeint/libs/numeric/odeint/examples/lorenz.cpp | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
Modified: sandbox/odeint/libs/numeric/odeint/examples/lorenz.cpp
==============================================================================
--- sandbox/odeint/libs/numeric/odeint/examples/lorenz.cpp (original)
+++ sandbox/odeint/libs/numeric/odeint/examples/lorenz.cpp 2009-10-22 11:10:16 EDT (Thu, 22 Oct 2009)
@@ -42,7 +42,7 @@
typedef vector<double> state_type;
//typedef list<double> state_type;
-void lorenz( state_type::iterator x , state_type::iterator dxdt , double t )
+void lorenz( state_type &x , state_type &dxdt , double t )
{
dxdt[0] = sigma * ( x[1] - x[0] );
dxdt[1] = R * x[0] - x[1] - x[0] * x[2];
Deleted: sandbox/odeint/libs/numeric/odeint/examples/lorenz_carray.cpp
==============================================================================
--- sandbox/odeint/libs/numeric/odeint/examples/lorenz_carray.cpp 2009-10-22 11:10:16 EDT (Thu, 22 Oct 2009)
+++ (empty file)
@@ -1,66 +0,0 @@
-/* Boost numeric/odeint/examples/lorenz.cpp
-
- Copyright 2009 Karsten Ahnert
-
- Shows, the usage of odeint, and integrates the Lorenz equations,
- a deterministic chaotic system. In this version, the system state
- is represented by a c-style double[3] array. The Lorenz system is
- defined as
-
- dx/dt = sigma * ( x - y)
- dy/dt = R*x - y - x*z
- dz/dt = x*y - b*z
-
- with sigma = 10, r=28, b = 8/3
-
- 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)
-*/
-
-#include <iostream>
-
-#include <boost/numeric/odeint.hpp>
-
-#define tab "\t"
-
-using namespace std;
-using namespace boost::numeric::odeint;
-
-const double sigma = 10.0;
-const double R = 28.0;
-const double b = 8.0 / 3.0;
-
-const double dt = 0.01;
-const size_t olen = 10000;
-
-void lorenz( double* x , double* dxdt , double t )
-{
- dxdt[0] = sigma * ( x[1] - x[0] );
- dxdt[1] = R * x[0] - x[1] - x[0] * x[2];
- dxdt[2] = x[0]*x[1] - b * x[2];
-}
-
-int main( int argc , char **argv )
-{
- double x[3];
- x[0] = 1.0;
- x[1] = 0.0;
- x[2] = 0.0;
-
- ode_step_euler< double* > euler;
-
- double t = 0.0;
- for( size_t oi=0 ; oi<olen ; ++oi,t+=dt )
- {
- cout << t << tab << x[0] << tab << x[1] << tab << x[2] << endl;
- euler.next_step( lorenz , x , 3, t , dt );
- }
-
- return 0;
-}
-
-/*
- Compile with
- g++ -Wall -I../../../../ lorenz_carray.cpp
-*/
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