1 #ifndef MF_NDARRAY_TIMED_VIEW_H_
2 #define MF_NDARRAY_TIMED_VIEW_H_
12 template<std::
size_t Dim,
typename T>
26 base(vw), start_time_(start_time)
42 else throw std::out_of_range(
"time out of bounds");
46 else throw std::out_of_range(
"time out of bounds");
52 start_time_ = vw.start_time_;
Mapping between coordinates, indices, and addresses of multi-dimensional data.
Definition: ndarray_view.h:16
decltype(auto) at_time(time_unit t) const
Definition: ndarray_timed_view.h:40
std::ptrdiff_t time_unit
Discrete time unit type.
Definition: common.h:52
Ndarray view with absolute time indices associated to first dimension.
Definition: ndarray_timed_view.h:13
ndarray_timed_view()
Create null timed view.
Definition: ndarray_timed_view.h:21
const shape_type & shape() const noexcept
Definition: ndarray_view.h:200
static ndarray_timed_view null()
Definition: ndarray_timed_view.h:31
time_unit duration() const
Definition: ndarray_timed_view.h:35
decltype(auto) operator[](std::ptrdiff_t c) const
Subscript operator, creates slice on first dimension.
Definition: ndarray_view.h:163
ndarray_timed_view(const base &vw, time_unit start_time)
Create timed view where time index start_time is associated with frame vw[0].
Definition: ndarray_timed_view.h:25
std::ptrdiff_t time_index(time_unit t) const
Definition: ndarray_timed_view.h:37
void reset(const ndarray_timed_view &vw)
Definition: ndarray_timed_view.h:51
time_unit time_at(std::ptrdiff_t i) const
Definition: ndarray_timed_view.h:38
bool is_null() const noexcept
Definition: ndarray_view.h:123
time_unit end_time() const
Definition: ndarray_timed_view.h:34
time_span span() const
Definition: ndarray_timed_view.h:49
#define MF_EXPECTS(condition)
Definition: common.h:27
One-dimensional time span.
Definition: common.h:61
const T & front() const noexcept
Definition: ndcoord.h:117
time_unit start_time() const
Definition: ndarray_timed_view.h:33
void reset() noexcept
Definition: ndarray_view.h:127
std::ptrdiff_t fix_coordinate_(std::ptrdiff_t c, std::ptrdiff_t dim) const
Definition: ndarray_view.tcc:92