Skip to content

Commit

Permalink
Add default constructor to TimeInterval
Browse files Browse the repository at this point in the history
  • Loading branch information
lamyj committed Nov 1, 2023
1 parent 50d1864 commit fe6c106
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
6 changes: 6 additions & 0 deletions src/sycomore/TimeInterval.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ ::shortest(Vector3Q const & k, Quantity const & G_max)
return sycomore::TimeInterval(min_time, k);
}

TimeInterval
::TimeInterval()
{
// Nothing else.
}

TimeInterval
::TimeInterval(
Quantity const & duration, Quantity const & gradient)
Expand Down
15 changes: 12 additions & 3 deletions src/sycomore/TimeInterval.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,30 @@ class TimeInterval
* or dephasing (rad/m) and maximum gradient amplitude
*/
static TimeInterval shortest(Vector3Q const & k, Quantity const & G_max);


/// @brief Default-initialize duration and gradient.
TimeInterval();

/**
* @brief Constructor, gradient may be specified as amplitude (in T/m),
* area (in T/m*s) or dephasing (in rad/m).
*/
TimeInterval(
Quantity const & duration=0*units::s,
Quantity const & duration,
Quantity const & gradient=0*units::T/units::m);

/**
* @brief Constructor, gradient may be specified as amplitude (in T/m),
* area (in T/m*s) or dephasing (in rad/m).
*/
TimeInterval(Quantity const & duration, Vector3Q const & gradient);


TimeInterval(TimeInterval const &) = default;
TimeInterval(TimeInterval &&) = default;
TimeInterval & operator=(TimeInterval const &) = default;
TimeInterval & operator=(TimeInterval &&) = default;
~TimeInterval() = default;

/// @brief Return the duration.
Quantity const & duration() const;

Expand Down

0 comments on commit fe6c106

Please sign in to comment.