DiffEq - Modern C++ ODE Integration Library 1.0.0
High-performance C++ library for solving ODEs with async signal processing
Loading...
Searching...
No Matches
CoroutineIntegrator< State > Class Template Reference

将积分器包装为协程,支持细粒度控制 More...

Public Member Functions

 CoroutineIntegrator (std::unique_ptr< diffeq::core::AbstractIntegrator< State > > integrator)
 
IntegrationTask< State > integrate_coro (State initial_state, typename diffeq::core::AbstractIntegrator< State >::time_type dt, typename diffeq::core::AbstractIntegrator< State >::time_type end_time, size_t yield_interval=10)
 协程化的积分,每步都可以暂停
 
template<typename ProgressCallback >
IntegrationTask< State > integrate_with_progress (State initial_state, typename diffeq::core::AbstractIntegrator< State >::time_type dt, typename diffeq::core::AbstractIntegrator< State >::time_type end_time, ProgressCallback &&callback)
 带进度回调的协程积分
 

Detailed Description

template<typename State>
class CoroutineIntegrator< State >

将积分器包装为协程,支持细粒度控制

Definition at line 172 of file coroutine_integration_demo.cpp.

Constructor & Destructor Documentation

◆ CoroutineIntegrator()

template<typename State >
CoroutineIntegrator< State >::CoroutineIntegrator ( std::unique_ptr< diffeq::core::AbstractIntegrator< State > >  integrator)
inlineexplicit

Definition at line 177 of file coroutine_integration_demo.cpp.

Member Function Documentation

◆ integrate_coro()

template<typename State >
IntegrationTask< State > CoroutineIntegrator< State >::integrate_coro ( State  initial_state,
typename diffeq::core::AbstractIntegrator< State >::time_type  dt,
typename diffeq::core::AbstractIntegrator< State >::time_type  end_time,
size_t  yield_interval = 10 
)
inline

协程化的积分,每步都可以暂停

Parameters
initial_state初始状态
dt时间步长
end_time结束时间
yield_interval产生中间结果的步数间隔

Definition at line 188 of file coroutine_integration_demo.cpp.

◆ integrate_with_progress()

template<typename State >
template<typename ProgressCallback >
IntegrationTask< State > CoroutineIntegrator< State >::integrate_with_progress ( State  initial_state,
typename diffeq::core::AbstractIntegrator< State >::time_type  dt,
typename diffeq::core::AbstractIntegrator< State >::time_type  end_time,
ProgressCallback &&  callback 
)
inline

带进度回调的协程积分

Definition at line 221 of file coroutine_integration_demo.cpp.


The documentation for this class was generated from the following file: