Skip to content

Commit 6ee30cd

Browse files
committed
feat: document support for normalize index mode
1 parent 4ea3975 commit 6ee30cd

2 files changed

Lines changed: 13 additions & 8 deletions

File tree

lib/node_modules/@stdlib/ndarray/fancy/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ The constructor accepts the following `options`:
111111
The constructor supports the following `modes`:
112112

113113
- **throw**: specifies that a `FancyArray` instance should throw an error when an index exceeds array dimensions.
114+
- **normalize**: specifies that a `FancyArray` instance should normalize negative indices and throw an error when an index exceeds array dimensions.
114115
- **wrap**: specifies that a `FancyArray` instance should wrap around an index exceeding array dimensions using modulo arithmetic.
115116
- **clamp**: specifies that a `FancyArray` instance should set an index exceeding array dimensions to either `0` (minimum index) or the maximum index.
116117

lib/node_modules/@stdlib/ndarray/fancy/docs/repl.txt

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,21 +51,25 @@
5151
options.mode: string (optional)
5252
Specifies how to handle indices which exceed array dimensions. If equal
5353
to 'throw', an ndarray instance throws an error when an index exceeds
54+
array dimensions. If equal to 'normalize', an ndarray instance
55+
normalizes negative indices and throws an error when an index exceeds
5456
array dimensions. If equal to 'wrap', an ndarray instance wraps around
5557
indices exceeding array dimensions using modulo arithmetic. If equal to
56-
'clamp', an ndarray instance sets an index exceeding array dimensions to
57-
either `0` (minimum index) or the maximum index. Default: 'throw'.
58+
'clamp', an ndarray instance sets an index exceeding array dimensions
59+
to either `0` (minimum index) or the maximum index. Default: 'throw'.
5860

5961
options.submode: Array<string> (optional)
6062
Specifies how to handle subscripts which exceed array dimensions. If a
6163
mode for a corresponding dimension is equal to 'throw', an ndarray
6264
instance throws an error when a subscript exceeds array dimensions. If
63-
equal to 'wrap', an ndarray instance wraps around subscripts exceeding
64-
array dimensions using modulo arithmetic. If equal to 'clamp', an
65-
ndarray instance sets a subscript exceeding array dimensions to either
66-
`0` (minimum index) or the maximum index. If the number of modes is
67-
fewer than the number of dimensions, the function recycles modes using
68-
modulo arithmetic. Default: [ options.mode ].
65+
equal to 'normalize', an ndarray instance normalizes negative
66+
subscripts and throws an error when a subscript exceeds array
67+
dimensions. If equal to 'wrap', an ndarray instance wraps around
68+
subscripts exceeding array dimensions using modulo arithmetic. If equal
69+
to 'clamp', an ndarray instance sets a subscript exceeding array
70+
dimensions to either `0` (minimum index) or the maximum index. If the
71+
number of modes is fewer than the number of dimensions, the function
72+
recycles modes using modulo arithmetic. Default: [ options.mode ].
6973

7074
options.readonly: boolean (optional)
7175
Boolean indicating whether an array should be read-only. Default: false.

0 commit comments

Comments
 (0)