SystemML Class
std/2009/data/spikes
Summary
Container for a list of spikes (boolean values) with a sparse representation
Status
Stable

Overview

The spikes list contains a one-dimensional list of spikes, or boolean values. You may like to think of this as a spikes "bus", having N streams, like a ribbon cable, carrying the spiking state of each stream on one filament.

Output format

A spikes structure, as follows.

Matlab Console
spikes = version: 1 meta: empty structure, i.e. no meta-data fS: sample rate of data t: [0 T], where T is number of samples stored s: [0 S], where S is number of streams (list length) ts: [2xN int32], where N is number of spikes, and each column is [t; s], where t is sample number and s is stream number

Native Interface

The data object provides the following C++ interface. The Input and Output classes are "Accessors". An Accessor is unattached when it is created, and is attached to a Port either by calling attach() (on an Input) or create() (on an Output).

For usage examples, see the source code for any Standard Library process that uses this data type.

Notes
  • The C++ interface overlays a C interface; for details of the C interface, see the header file for the class.
  • As with all Data and Utility Components, this one presents its C++ interface in a namespace named for its SystemML Class, with underscores instead of slashes and the release tagged on the end. It may be easier to import this namespace, provided it does not conflict with other symbols in your source code, but you can always use symbols within it explicitly, as shown here. An alternative is to create a namespace alias with a more convenient name - this approach is used, for example, in the 1199 template.

This interface is undocumented, but hopefully it's more-or-less self-explanatory, given its similarity to the documented interface to std/data/numeric.

Accessor

C/C++ API (Data)
struct Accessor { bool isAttached() const; bool isPresent() const; const char* getName() const; UINT32 getFlags() const; void selectSet(Symbol hSet); // read the structure UINT32 getCapacity(); Dims getDims(); Dimensions* getDimensions(); };

Input

C/C++ API (Data)
struct Input : public Accessor { // attach the input port (in EVENT_INIT_CONNECT) const Input& attach(Symbol hComponent, std::string name); const Input& attach(Symbol hComponent, UINT32 index); // attach to a port that may not be there bool tryAttach(Symbol hComponent, std::string name); // get the content (in EVENT_RUN_SERVICE) UINT32 getContent(INT32*& state); };

Output

C/C++ API (Data)
struct Output : public Accessor { // prepare for creation (in EVENT_INIT_CONNECT) void setName(const char* name); void setSampleRate(SampleRate sampleRate); // create the output port (in EVENT_INIT_CONNECT) void create(Symbol hComponent); void create(Symbol hComponent, const Accessor& accessor); // structure the data in the created port (in EVENT_INIT_CONNECT) void setCapacity(INT32 capacity); void setDims(const Dims& dims); void setDimensions(const Dimensions& dims); // write the output port (in EVENT_RUN_SERVICE) void setContent(INT32* state, UINT32 count); };

Generic Interface

The structure string has the form <dim>,<dim>,..., where <dim> is an integer as a string. For example, "32" is a spikes list with a capacity of 32 streams and only one dimension. The numeric equivalent form is a UINT32 list of spike streams that are currently in spiking state (on).