forked from headmyshoulder/odeint-v2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathiterator_ideas.cpp
45 lines (33 loc) · 1.11 KB
/
iterator_ideas.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
Iterator versions:
class XYZ_iterator
{
state_type m_x;
stepper_type m_stepper;
system_type m_system;
};
template< class Stepper , class System >
class XYZ_iterator
{
typedef Stepper unwrapped_stepper_type;
typedef System unwrapped_system_type;
typedef typename odeint::unwrap_reference< unwrapped_stepper_type >::type stepper_type;
typedef typename stepper_type::state_type state_type;
typedef typename stepper_type::time_type time_type;
typedef typename odeint::unwrap_reference< unwrapped_system_type >::type system_type
public:
XYZ_iterator( unwrapped_stepper_type stepper , unwrapped_system_type system , state_type &x ,
time_type t_start , time_type t_end , time_end dt )
: m_stepper( stepper ) , m_system( system ) , m_x( &x ) ,
m_t( t_start ) , m_t_end( t_end ) , m_dt( dt ) , m_is_last( false )
{ }
state_type *m_x;
unwrapped_stepper_type m_stepper;
unwrapped_system_type m_system;
time_type m_t;
time_type m_t_end;
time_type m_dt;
bool m_is_last;
};
TEST:
test copy constructor
test assignment operator