You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Generates a simplex graph in a `dim`-component space based on (1) grid of nodes following `ndiv` divisions per dimension (i.e., quantized to `1/ndiv`),
268
-
## similar to `simplex_grid`_, and (2) a list of neighbor lists corresponding to edges. The result is a tuple of
269
-
## (1) a deterministically allocated Arraymancer `Tensor[int]` of shape `(N_S(dim, ndiv), dim)` containing all possible compositions in the simplex space
270
-
## just like in `simplex_grid`_, and (2) a `seq[seq[int]]` containing a list of neighbors for each node. The current implementation utilizes GC-allocated `seq` for neighbors
271
-
## to reduce memory footprint in cases where `ndiv` is close to `dim` and not all nodes have the complete set of `dim(dim-1)` neighbors. This is a tradeoff between memory and performance, which can be
272
-
## adjusted by switching to a (N_S(dim, ndiv), dim(dim-1)) `Tensor[int]` with `-1` padding for missing neighbors, just like done in `outFunction_graph`_ for NumPy output generation.
266
+
## .. image:: ../assets/small_GL.png
267
+
## Generates a "limited" simplex graph in up to `dim`-component space represented by (1) grid of nodes quantized to `1/ndiv`, similar to `simplex_grid`_, and (2) a list of
268
+
## neighbor lists corresponding to edges, but only for nodes within the specified `limit` sequence of integer pairs denoting maximum and minimum values for each component
269
+
## in terms of fractions of `ndiv` (e.g. [[0, 24], [0, 12], [3, 6]] with `ndiv=24` would mean that the first component can take values from 0 to 100%, the second from 0 to
270
+
## 50%, and the third from 12.5 to 25%, inclusive). The figure above depicts an example of a 3-component simplex graph with `ndiv=12` and limits of [[1, 8], [1, 8], [1, 8]].
271
+
## This implementation iterates over all nodes but only computes neighbors for those within the limits, which then gets prunned to avoid connecting to nodes outside the limits
272
+
## (difficult to avoide for more than 3 components). The is rearranged and node indexes are remapped to be a dense uniformly spread grid in a subspace of the simplex, akin to
273
+
## the full `simplex_graph`_ but with a smaller number of nodes and more elaborate shapes, such as in the figure below with `ndiv=24` and limits of
274
+
## [[0, 24], [0, 24], [0, 12], [0, 3]], resulting in a tetrahedron cut around its base and one corner.
275
+
## .. image:: ../assets/small_GL2.png
276
+
## The result is a tuple of (1) a runtime allocated Arraymancer `Tensor[int]` of shape `(N<=N_S(dim, ndiv), dim)` containing compositions and (2) a `seq[seq[int]]` containing
277
+
## a list of neighbors for each node.
273
278
274
279
assertlen(limit) == dim, "The size of limit sequence put on the simplex grid must match the dimensionality"
0 commit comments