Cypress  1.0
C++ Spiking Neural Network Simulation Framework
Public Member Functions | Protected Member Functions | Static Protected Member Functions | List of all members
cypress::PopulationDataView Class Reference

#include <data.hpp>

Inheritance diagram for cypress::PopulationDataView:
Inheritance graph
[legend]

Public Member Functions

 PopulationDataView ()
 
 PopulationDataView (const PopulationDataView &other)
 
 PopulationDataView (PopulationDataView &&) noexcept=default
 
 PopulationDataView (std::shared_ptr< PopulationData > data, NeuronIndex nid0, NeuronIndex nid1, bool own_parameters=true, bool own_record=true, bool own_data=true)
 
PopulationDataViewoperator= (const PopulationDataView &other)
 

Protected Member Functions

const PopulationDatapopulation_data () const
 
PopulationDatapopulation_data ()
 
size_t get_parameters_size () const
 
size_t get_record_size () const
 
size_t get_data_size () const
 
const auto & read_parameters () const
 
const auto & read_record () const
 
const auto & read_data () const
 
auto write_parameters (bool partial=true)
 
auto write_record (bool partial=true)
 
auto write_data (bool partial=true)
 

Static Protected Member Functions

template<typename Seq >
static Seq::value_type from_sequence (Seq list)
 

Detailed Description

View into part of the population data, indicated by a neuron start index and a neuron end index.

Constructor & Destructor Documentation

cypress::PopulationDataView::PopulationDataView ( )
inline

Default constructor – creates a separate instance of the underlying PopulationData.

cypress::PopulationDataView::PopulationDataView ( const PopulationDataView other)

Creates a decoupled copy of the original population data view.

Parameters
otheris the PopulationDataView of which a copy should be created.
cypress::PopulationDataView::PopulationDataView ( PopulationDataView &&  )
defaultnoexcept

Move constructor.

cypress::PopulationDataView::PopulationDataView ( std::shared_ptr< PopulationData data,
NeuronIndex  nid0,
NeuronIndex  nid1,
bool  own_parameters = true,
bool  own_record = true,
bool  own_data = true 
)
inline

Constructor which allows the PopulationDataView to act as a view onto the data stored for a range of neurons in a population. The ownership flags specify which data sections are updated on assignment.

Parameters
datais a reference onto the underlying population data store.
nid0is the index of the first neuron represented by this view.
nid1is the index of the last-plus-one neuron represented by this view.
own_parametersif true, the view covers the "parameters" section of the underlying data.
own_recordif true, the view covers the "record" section of the underlying data.
own_dataif true, the view covers the "data" section of the underlying data.

Member Function Documentation

template<typename Seq >
static Seq::value_type cypress::PopulationDataView::from_sequence ( Seq  list)
inlinestaticprotected

Templated method which allows to construct a PopulationDataView with its own data from a list of PopulationData objects. This method is used by the various neuron parameter and signal implementations to be able to supply a list of parameters/signals to the various constructors.

size_t cypress::PopulationDataView::get_data_size ( ) const
inlineprotected

Returns the size of the record vector. Throws an exception if the neurons in the given range do not share parameters of the same size.

Returns
the number of entires in the data array.
size_t cypress::PopulationDataView::get_parameters_size ( ) const
inlineprotected

Returns the size of the parameter vector. Throws an exception if the neurons in the given range do not share parameters of the same size.

Returns
the number of parameters in the parameter array.
size_t cypress::PopulationDataView::get_record_size ( ) const
inlineprotected

Returns the size of the record vector. Throws an exception if the neurons in the given range do not share parameters of the same size.

Returns
the number of entires in the record array.
PopulationDataView& cypress::PopulationDataView::operator= ( const PopulationDataView other)

Assignment operator. Sets the data in this instance to the data given in the other instance.

const PopulationData& cypress::PopulationDataView::population_data ( ) const
inlineprotected

Returns a const reference at the underlying PopulationData.

PopulationData& cypress::PopulationDataView::population_data ( )
inlineprotected

Returns a reference at the underlying PopulationData.

const auto& cypress::PopulationDataView::read_data ( ) const
inlineprotected

Returns a const-reference at the vector containing the recorded data for the neurons represented by this view. Throws an exception if the neurons in this view do not share the same record flags.

Returns
the record data shared by the neurons in the given range.
const auto& cypress::PopulationDataView::read_parameters ( ) const
inlineprotected

Returns a const-reference at the parameter vector for the neurons represented by this view. Throws an exception if the neurons in this view do not share the same parameters.

Returns
the parameters shared by the neurons in the given range.
const auto& cypress::PopulationDataView::read_record ( ) const
inlineprotected

Returns a const-reference at the vector specifying whether a signal should be recorded or not for the neurons represented by this view. Throws an exception if the neurons in this view do not share the same record flags.

Returns
the record flags shared by the neurons in the given range.
auto cypress::PopulationDataView::write_data ( bool  partial = true)
inlineprotected

Returns an iteratble range allowing to write the recorded data for the range of neurons represented by this vie2. Assumes that the data is being set to the same value for the specified range.

Parameters
partialif true, indicates that the record data is not entirely overridden, preventing the method from re-homogenising the data.
Returns
an iterable object pointing at the recorded data for the specified neuron range.
auto cypress::PopulationDataView::write_parameters ( bool  partial = true)
inlineprotected

Returns an iterable range allowing to modify the parameters for the range of neurons represented by this view. Assumes that the data is being set to the same value for the specified range.

Parameters
partialif true, indicates that the parameters are not entirely overridden, preventing the method from re-homogenising the data.
Returns
an iterable object pointing at the parameters for the specified neuron range.
auto cypress::PopulationDataView::write_record ( bool  partial = true)
inlineprotected

Returns an iteratble range allowing to modify the record flags for the range of neurons represented by this view. Assumes that the data is being set to the same value for the specified range.

Parameters
partialif true, indicates that the record flags are not entirely overridden, preventing the method from re-homogenising the data.
Returns
an iterable object pointing at the record flags for the specified neuron range.

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