Spike
Loading...
Searching...
No Matches
Spike::TimeFrame Class Reference

A time frame with discrete time steps. More...

#include <TimeFrame.h>

Public Member Functions

 TimeFrame (const std::string &input_file)
 Constructs a time frame from a .ini file.
 
 TimeFrame (double t_0, double t_end, double dt)
 Constructs a time frame from the given parameters.
 
void calculate_times ()
 Calculates the discretized times.
 
double get_t_0 () const
 Returns the start time.
 
double get_t_end () const
 Returns the end time.
 
double get_dt () const
 Returns the time step.
 
size_t get_size () const
 Returns the size of the time frame.
 
double get_time (size_t i) const
 Returns the time at index i.
 
const std::vector< double > & get_times () const
 Returns the times vector.
 

Friends

std::ostream & operator<< (std::ostream &out, const TimeFrame &tf)
 Overloads the operator << so we can print time frame.
 

Detailed Description

A time frame with discrete time steps.

Constructor & Destructor Documentation

◆ TimeFrame() [1/2]

Spike::TimeFrame::TimeFrame ( const std::string & input_file)
explicit

Constructs a time frame from a .ini file.

Parameters
input_filePath to .ini file

◆ TimeFrame() [2/2]

Spike::TimeFrame::TimeFrame ( double t_0,
double t_end,
double dt )

Constructs a time frame from the given parameters.

Parameters
t_0Start time
t_endEnd time
dtTime step

Member Function Documentation

◆ get_dt()

double Spike::TimeFrame::get_dt ( ) const
inline

Returns the time step.

Returns
time step

◆ get_size()

size_t Spike::TimeFrame::get_size ( ) const
inline

Returns the size of the time frame.

Returns
size of the time frame

◆ get_t_0()

double Spike::TimeFrame::get_t_0 ( ) const
inline

Returns the start time.

Returns
start time

◆ get_t_end()

double Spike::TimeFrame::get_t_end ( ) const
inline

Returns the end time.

Returns
end time

◆ get_time()

double Spike::TimeFrame::get_time ( size_t i) const
inline

Returns the time at index i.

Returns
time at index i

◆ get_times()

const std::vector< double > & Spike::TimeFrame::get_times ( ) const
inline

Returns the times vector.

Returns
times vector

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream & out,
const TimeFrame & tf )
friend

Overloads the operator << so we can print time frame.

Parameters
outout stream
tftime frame
Returns
out stream

The documentation for this class was generated from the following files: