![]() |
NEURON
|
#include <section.h>
Public Member Functions | |
Prop (Node *node, short type) | |
auto | id () const |
Get the identifier of this instance. More... | |
bool | owns (neuron::container::data_handle< double > const &handle) const |
Check if the given handle refers to data owned by this Prop. More... | |
double & | param (int field_index, int array_index=0) |
Return a reference to the i-th floating point data field associated with this Prop. More... | |
double const & | param (int field_index, int array_index=0) const |
Return a reference to the i-th double value associated with this Prop. More... | |
auto | param_handle (int field, int array_index=0) |
Return a handle to the i-th double value associated with this Prop. More... | |
auto | param_handle (neuron::container::field_index ind) |
double & | param_legacy (int legacy_index) |
double const & | param_legacy (int legacy_index) const |
auto | param_handle_legacy (int legacy_index) |
int | param_size () const |
Return how many double values are assocated with this Prop. More... | |
int | param_num_vars () const |
Return how many (possibly-array) variables are associated with this Prop. More... | |
int | param_array_dimension (int field) const |
Return the array dimension of the given value. More... | |
std::size_t | current_row () const |
Public Attributes | |
Node * | node |
Prop * | next |
short | _type |
int | dparam_size |
Datum * | dparam |
long | _alloc_seq |
Object * | ob |
Private Member Functions | |
std::pair< int, int > | translate_legacy_index (int legacy_index) const |
Translate a legacy (flat) index into a (variable, array offset) pair. More... | |
Private Attributes | |
std::optional< neuron::container::Mechanism::owning_handle > | m_mech_handle |
Friends | |
std::ostream & | operator<< (std::ostream &os, Prop const &p) |
|
inline |
|
inline |
|
inline |
Return a reference to the i-th floating point data field associated with this Prop.
Note that there is a subtlety with the numbering scheme in case of array variables. If we have 3 array variables (a, b, c) with dimensions x, y, z: a[x] b[y] c[z] then, for example, the second element of b (assume y >= 2) is obtained with param(1, 1). In AoS NEURON these values were all stored contiguously, and the values were obtained using a single index; taking the same example, the second element of b used to be found at index x + 1 in the param array. In all of the above, scalar variables are treated the same and simply have dimension 1. In SoA NEURON then a[1] is stored immediately after a[0] in memory, but for a given mechanism instance b[0] is not stored immediately after a[x-1].
It is possible, but a little inefficient, to calculate the new pair of indices from an old index. For that, see the param_legacy and param_handle_legacy functions.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Return how many (possibly-array) variables are associated with this Prop.
In case of array variables, this ignores array dimensions. i.e. if a mechanism has a[2] b[2] then param_size()=4 and param_num_vars()=2.
|
inline |
Return how many double values are assocated with this Prop.
In case of array variables, this is the sum over array dimensions. i.e. if a mechanism has a[2] b[2] then param_size()=4 and param_num_vars()=2.
|
inlineprivate |
|
friend |
|
private |