2
0
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:
Karsten Ahnert
2012-07-09 10:19:45 +02:00
parent bcabbe61a5
commit 0a54ed3e09

View File

@@ -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;
}