1#ifndef SPIKE_SPIKETRAIN_H
2#define SPIKE_SPIKETRAIN_H
8#include "Spike/TimeFrame/TimeFrame.h"
21 std::vector<double> spikes;
51 [[nodiscard]]
double get_dt()
const {
return dt; };
57 [[nodiscard]]
size_t get_size()
const {
return spikes.size(); };
64 [[nodiscard]]
bool get_spike(
size_t i)
const {
return (spikes[i] != 0); };
70 [[nodiscard]]
const std::vector<double> &
get_values()
const {
A spike train for discretized times. For a given time discretization with time step dt,...
Definition SpikeTrain.h:18
void clear()
Clears the spike train, i.e. sets all values to zero.
Definition SpikeTrain.cpp:23
double get_dt() const
Returns time step.
Definition SpikeTrain.h:51
SpikeTrain(const TimeFrame &time_frame)
Constructs a spike train from a given time frame.
Definition SpikeTrain.cpp:5
bool get_spike(size_t i) const
Checks whether there is a spike at index i.
Definition SpikeTrain.h:64
size_t spike_count()
Counts the number of spikes in the spike train.
Definition SpikeTrain.cpp:11
size_t get_size() const
Returns size of spike train (length).
Definition SpikeTrain.h:57
const std::vector< double > & get_values() const
Returns the whole spike train (as a vector)
Definition SpikeTrain.h:70
void add_spike(size_t i)
Adds a spike at index i.
Definition SpikeTrain.cpp:28
A time frame with discrete time steps.
Definition TimeFrame.h:13