1#ifndef SPIKE_TIMEFRAME_H
2#define SPIKE_TIMEFRAME_H
18 std::vector<double> t;
25 explicit TimeFrame(
const std::string &input_file);
33 TimeFrame(
double t_0,
double t_end,
double dt);
44 [[nodiscard]]
double get_t_0()
const {
return t_0; };
50 [[nodiscard]]
double get_t_end()
const {
return t_end; };
56 [[nodiscard]]
double get_dt()
const {
return dt; };
62 [[nodiscard]]
size_t get_size()
const {
return t.size(); };
68 [[nodiscard]]
double get_time(
size_t i)
const {
return t[i]; };
74 [[nodiscard]]
const std::vector<double> &
get_times()
const {
return t; };
A time frame with discrete time steps.
Definition TimeFrame.h:13
const std::vector< double > & get_times() const
Returns the times vector.
Definition TimeFrame.h:74
void calculate_times()
Calculates the discretized times.
Definition TimeFrame.cpp:44
double get_t_0() const
Returns the start time.
Definition TimeFrame.h:44
double get_t_end() const
Returns the end time.
Definition TimeFrame.h:50
double get_dt() const
Returns the time step.
Definition TimeFrame.h:56
TimeFrame(const std::string &input_file)
Constructs a time frame from a .ini file.
Definition TimeFrame.cpp:23
size_t get_size() const
Returns the size of the time frame.
Definition TimeFrame.h:62
friend std::ostream & operator<<(std::ostream &out, const TimeFrame &tf)
Overloads the operator << so we can print time frame.
Definition TimeFrame.cpp:51
double get_time(size_t i) const
Returns the time at index i.
Definition TimeFrame.h:68