mirror of
https://github.com/boostorg/odeint.git
synced 2025-05-11 05:24:01 +00:00
added initialize function to controlled_runge_kutta (fsal version)
This commit is contained in:
parent
8fc311693b
commit
47dbdac33c
@ -406,9 +406,7 @@ public:
|
|||||||
{
|
{
|
||||||
if( m_dxdt_resizer.adjust_size( in , detail::bind( &controlled_runge_kutta::template resize_m_dxdt_impl< StateIn > , detail::ref( *this ) , detail::_1 ) ) || m_first_call )
|
if( m_dxdt_resizer.adjust_size( in , detail::bind( &controlled_runge_kutta::template resize_m_dxdt_impl< StateIn > , detail::ref( *this ) , detail::_1 ) ) || m_first_call )
|
||||||
{
|
{
|
||||||
typename odeint::unwrap_reference< System >::type &sys = system;
|
initialize( system , in , t );
|
||||||
sys( in , m_dxdt.m_v ,t );
|
|
||||||
m_first_call = false;
|
|
||||||
}
|
}
|
||||||
return try_step( system , in , m_dxdt.m_v , t , out , dt );
|
return try_step( system , in , m_dxdt.m_v , t , out , dt );
|
||||||
}
|
}
|
||||||
@ -480,6 +478,32 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void reset( void )
|
||||||
|
{
|
||||||
|
m_first_call = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
template< class DerivIn >
|
||||||
|
void initialize( const DerivIn &deriv )
|
||||||
|
{
|
||||||
|
boost::numeric::odeint::copy( deriv , m_dxdt.m_v );
|
||||||
|
m_first_call = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
template< class System , class StateIn >
|
||||||
|
void initialize( System system , const StateIn &x , const time_type &t )
|
||||||
|
{
|
||||||
|
typename odeint::unwrap_reference< System >::type &sys = system;
|
||||||
|
sys( x , m_dxdt.m_v , t );
|
||||||
|
m_first_call = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool is_initialized( void ) const
|
||||||
|
{
|
||||||
|
return ! m_first_call;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
template< class StateType >
|
template< class StateType >
|
||||||
void adjust_size( const StateType &x )
|
void adjust_size( const StateType &x )
|
||||||
@ -536,9 +560,7 @@ private:
|
|||||||
{
|
{
|
||||||
if( m_dxdt_resizer.adjust_size( x , detail::bind( &controlled_runge_kutta::template resize_m_dxdt_impl< StateInOut > , detail::ref( *this ) , detail::_1 ) ) || m_first_call )
|
if( m_dxdt_resizer.adjust_size( x , detail::bind( &controlled_runge_kutta::template resize_m_dxdt_impl< StateInOut > , detail::ref( *this ) , detail::_1 ) ) || m_first_call )
|
||||||
{
|
{
|
||||||
typename odeint::unwrap_reference< System >::type &sys = system;
|
initialize( system , x , t );
|
||||||
sys( x , m_dxdt.m_v , t );
|
|
||||||
m_first_call = false;
|
|
||||||
}
|
}
|
||||||
return try_step( system , x , m_dxdt.m_v , t , dt );
|
return try_step( system , x , m_dxdt.m_v , t , dt );
|
||||||
}
|
}
|
||||||
|
@ -3,13 +3,11 @@
|
|||||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||||
<title>Chapter 1. Boost.Numeric.Odeint</title>
|
<title>Chapter 1. Boost.Numeric.Odeint</title>
|
||||||
<link rel="stylesheet" href="boostbook.css" type="text/css">
|
<link rel="stylesheet" href="boostbook.css" type="text/css">
|
||||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
<meta name="generator" content="DocBook XSL Stylesheets V1.77.0">
|
||||||
<link rel="home" href="index.html" title="Chapter 1. Boost.Numeric.Odeint">
|
<link rel="home" href="index.html" title="Chapter 1. Boost.Numeric.Odeint">
|
||||||
<link rel="next" href="boost_numeric_odeint/getting_started.html" title="Getting started">
|
<link rel="next" href="boost_numeric_odeint/getting_started.html" title="Getting started">
|
||||||
</head>
|
</head>
|
||||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||||
<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
|
|
||||||
<hr>
|
|
||||||
<div class="spirit-nav"><a accesskey="n" href="boost_numeric_odeint/getting_started.html"><img src="images/next.png" alt="Next"></a></div>
|
<div class="spirit-nav"><a accesskey="n" href="boost_numeric_odeint/getting_started.html"><img src="images/next.png" alt="Next"></a></div>
|
||||||
<div class="chapter">
|
<div class="chapter">
|
||||||
<div class="titlepage"><div>
|
<div class="titlepage"><div>
|
||||||
@ -24,7 +22,7 @@
|
|||||||
<div><p class="copyright">Copyright © 2009-2011 Karsten Ahnert
|
<div><p class="copyright">Copyright © 2009-2011 Karsten Ahnert
|
||||||
and Mario Mulansky</p></div>
|
and Mario Mulansky</p></div>
|
||||||
<div><div class="legalnotice">
|
<div><div class="legalnotice">
|
||||||
<a name="id566702"></a><p>
|
<a name="odeint.legal"></a><p>
|
||||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||||
</p>
|
</p>
|
||||||
@ -94,7 +92,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||||
<td align="left"><p><small>Last revised: May 23, 2012 at 20:24:00 GMT</small></p></td>
|
<td align="left"><p><small>Last revised: May 29, 2012 at 14:07:10 GMT</small></p></td>
|
||||||
<td align="right"><div class="copyright-footer"></div></td>
|
<td align="right"><div class="copyright-footer"></div></td>
|
||||||
</tr></table>
|
</tr></table>
|
||||||
<hr>
|
<hr>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user