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

A spike train for discretized times. For a given time discretization with time step dt, a spike train is an array that, at each entry, is either zero if the neuron hasn't spiked or 1/dt if the neuron has spiked. More...

#include <SpikeTrain.h>

Public Member Functions

 SpikeTrain (const TimeFrame &time_frame)
 Constructs a spike train from a given time frame.
 
size_t spike_count ()
 Counts the number of spikes in the spike train.
 
void clear ()
 Clears the spike train, i.e. sets all values to zero.
 
void add_spike (size_t i)
 Adds a spike at index i.
 
double get_dt () const
 Returns time step.
 
size_t get_size () const
 Returns size of spike train (length).
 
bool get_spike (size_t i) const
 Checks whether there is a spike at index i.
 
const std::vector< double > & get_values () const
 Returns the whole spike train (as a vector)
 

Detailed Description

A spike train for discretized times. For a given time discretization with time step dt, a spike train is an array that, at each entry, is either zero if the neuron hasn't spiked or 1/dt if the neuron has spiked.

Constructor & Destructor Documentation

◆ SpikeTrain()

Spike::SpikeTrain::SpikeTrain ( const TimeFrame & time_frame)
explicit

Constructs a spike train from a given time frame.

Parameters
time_frameTime frame

Member Function Documentation

◆ add_spike()

void Spike::SpikeTrain::add_spike ( size_t i)

Adds a spike at index i.

Parameters
iIndex of spike

◆ get_dt()

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

Returns time step.

Returns
time step

◆ get_size()

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

Returns size of spike train (length).

Returns
size of spike train

◆ get_spike()

bool Spike::SpikeTrain::get_spike ( size_t i) const
inline

Checks whether there is a spike at index i.

Parameters
iindex
Returns
true if spike is present, false if not

◆ get_values()

const std::vector< double > & Spike::SpikeTrain::get_values ( ) const
inline

Returns the whole spike train (as a vector)

Returns
spike train vector

◆ spike_count()

size_t Spike::SpikeTrain::spike_count ( )

Counts the number of spikes in the spike train.

Returns
Number of spikes

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