4 #ifndef CPPQEDCORE_STRUCTURE_TIME_H_INCLUDED
5 #define CPPQEDCORE_STRUCTURE_TIME_H_INCLUDED
9 #include <boost/operators.hpp>
11 #include <boost/mpl/if.hpp>
27 class TwoTime :
private boost::equality_comparable<TwoTime>
30 TwoTime(
double t,
double t0) : t_(t), t0_(t0) {}
32 double getT ()
const {
return t_ ;}
33 double getT0()
const {
return t0_;}
36 friend bool operator==(
TwoTime t1,
TwoTime t2) {
return t1.t_==t2.t_ && t1.t0_==t2.t0_;}
43 class OneTime :
private boost::equality_comparable<OneTime>
46 explicit OneTime(
double t,
double t0=0) : deltaT_(t-t0) {}
48 operator double()
const {
return deltaT_;}
51 friend bool operator==(
OneTime t1,
OneTime t2) {
return t1.deltaT_==t2.deltaT_;}
61 explicit NoTime(
double,
double=0) {}
72 template<TimeDependence TD>
73 struct Dispatcher : boost::mpl::if_c<TD==TWO_TIME,TwoTime,
74 typename boost::mpl::if_c<TD==ONE_TIME,OneTime,NoTime>::type
81 template<
bool IS_TIME_DEPENDENT>
88 template<
bool IS_TWO_TIME>
97 #endif // CPPQEDCORE_STRUCTURE_TIME_H_INCLUDED
Metafunction dispatching two OneTime & NoTime according to the template parameter IS_TIME_DEPENDENT ...
Case 4 – Time-independent problem, no exact part
TimeDependence
Enumeration of different possibilities for time dependence of Hamiltonians.
Comprises modules for describing quantum systems.
Metafunction dispatching the three classes TwoTime, OneTime, & NoTime according to the template param...
Describes one-time dependence corresponding to the case ONE_TIME.
Describes two-time dependence corresponding to the case TWO_TIME.
Case 1 – Time-dependent problem + exact part ( )
Metafunction dispatching two TwoTime & OneTime according to the template parameter IS_TWO_TIME ...
Case 2 – Time-dependent problem, no exact part OR Case 3 – Time-independent problem + exact part ...
Describes no-time dependence corresponding to the case NO_TIME.