mirror of
https://github.com/boostorg/odeint.git
synced 2026-01-26 06:42:23 +00:00
adding find_if example
This commit is contained in:
@@ -193,6 +193,18 @@ int main( int argc , char **argv )
|
||||
}
|
||||
|
||||
|
||||
// boost::range::find with time iterator
|
||||
{
|
||||
runge_kutta4< state_type > stepper;
|
||||
state_type x = {{ 10.0 , 10.0 , 10.0 }};
|
||||
auto iter = boost::find_if( make_const_step_time_range( stepper , lorenz() , x , 0.0 , 1.0 , 0.01 ) ,
|
||||
[]( const std::pair< state_type & , double > &x ) {
|
||||
return ( x.first[0] < 0.0 ); } );
|
||||
cout << iter->second << "\t" << iter->first[0] << "\t" << iter->first[1] << "\t" << iter->first[2] << "\n";
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -230,5 +242,8 @@ int main( int argc , char **argv )
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user