diff --git a/docs/contents/pointers.rst b/docs/contents/pointers.rst new file mode 100644 index 0000000000..9add4b8e32 --- /dev/null +++ b/docs/contents/pointers.rst @@ -0,0 +1,30 @@ +NMODL "pointers" +================ + +Mechanisms can refer to values in other mechanisms, e.g. the sodium current +``ina``. Therefore, it supports a notion of "pointer", called ``Datum``. A datum +can store a pointer to a double, a stable pointer to a double, integers, or +pointers to anything else. + +Integer Variables +----------------- +One important subset of Datum are pointers to RANGE variables. Meaning they are +pointers to parameters in other mechanisms or pointers to the parameters +associated with each node, e.g. the voltage. Since the storage of RANGE +variable is controlled by NEURON/CoreNEURON, these pointers have stronger +semantics than a ``double*``. + +These make up the majority of usecases for Datum; and are considered the +well-mannered subset. + +In CoreNEURON this subset of Datums are treated differently for other Datums. +Because CoreNEURON stores the values these Datums can point to in a single +contiguous array of doubles, the "pointers" can be expressed as indices into +this array. + +Therefore, this subset of Datums is referred to as "integer variables". + +In NEURON these pointers are a ``data_handle`` to the value they point to. +Before the simulation phase they are "resolved" and a cache stores a list of +``double*`` to the appropriate values. + diff --git a/docs/index.rst b/docs/index.rst index 4a494781f7..8c5f5e07db 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -19,6 +19,7 @@ About NMODL :caption: Contents: contents/visitors + contents/pointers .. toctree:: :maxdepth: 3