Skip to content

Commit

Permalink
Auto-generated commit
Browse files Browse the repository at this point in the history
  • Loading branch information
stdlib-bot committed Jan 28, 2024
1 parent b8a331c commit b26d9a0
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
4 changes: 4 additions & 0 deletions base/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1715,6 +1715,7 @@ interface Namespace {
*
* - **sh**: dimensions sorted in loop order.
* - **sx**: ndarray strides sorted in loop order.
* - **idx**: dimension indices sorted in loop order.
*
* - When iterating over the elements of a multi-dimensional array, accessing elements which are closer in memory can improve performance. To this end, loop interchange is a technique used in loop nest optimization to improve locality of reference and take advantage of CPU cache.
*
Expand All @@ -1737,6 +1738,9 @@ interface Namespace {
*
* var ssx = o.sx;
* // returns [ 1, 4, 12 ]
*
* var idx = o.idx;
* // returns [ 2, 1, 0 ]
*/
nullaryLoopOrder: typeof nullaryLoopOrder;

Expand Down
30 changes: 30 additions & 0 deletions docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
/* eslint-disable max-lines */

import array = require( './../../array' );
import ndat = require( './../../at' );
import base = require( './../../base' );
import broadcastArray = require( './../../broadcast-array' );
import broadcastArrays = require( './../../broadcast-arrays' );
Expand Down Expand Up @@ -130,6 +131,35 @@ interface Namespace {
*/
array: typeof array;

/**
* Returns an ndarray element.
*
* ## Notes
*
* - The number of index arguments must equal the number of ndarray dimensions.
* - Negative indices are resolved relative to the last element along the respective dimension, with the last element corresponding to `-1`.
* - If provided out-of-bounds indices, the function always returns `undefined`.
*
* @param x - input ndarray
* @param indices - index arguments
* @returns ndarray element
*
* @example
* var zeros = require( './../../zeros' );
*
* var x = zeros( [ 3, 3 ], {
* 'dtype': 'generic'
* });
* // returns <ndarray>
*
* var v = ns.ndat( x, 0, 0 );
* // returns 0
*
* v = ns.ndat( x, 5, 5 );
* // returns undefined
*/
ndat: typeof ndat;

/**
* Base ndarray.
*/
Expand Down

0 comments on commit b26d9a0

Please sign in to comment.