Skip to content

Commit

Permalink
Start documenting pointers.
Browse files Browse the repository at this point in the history
  • Loading branch information
1uc committed Feb 7, 2024
1 parent 3e3f62a commit edcd9de
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
25 changes: 25 additions & 0 deletions docs/contents/pointers.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
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 what could be referred to as genuine pointers
to other doubles. More precisely, pointers to parameters in other mechanisms or
pointers to the parameters associated with each node, e.g. the voltage.

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. 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".



1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ About NMODL
:caption: Contents:

contents/visitors
contents/pointers

.. toctree::
:maxdepth: 3
Expand Down

0 comments on commit edcd9de

Please sign in to comment.