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
* Assigns elements from a broadcasted input ndarray to a specified diagonal of an output ndarray.
370
+
*
371
+
* ## Notes
372
+
*
373
+
* - The order of the dimension indices contained in `dims` matters. The first element specifies the row-like dimension. The second element specifies the column-like dimension.
374
+
* - Each provided dimension index must reside on the interval `[-ndims, ndims-1]`.
375
+
* - The diagonal offset `k` is interpreted as `column - row`. Accordingly, when `k = 0`, the function assigns to the main diagonal; when `k > 0`, the function assigns to a diagonal above the main diagonal; and when `k < 0`, the function assigns to a diagonal below the main diagonal.
376
+
* - The input ndarray must be broadcast compatible with the output ndarray view defined by the specified diagonal.
377
+
*
378
+
* @param arrays - array-like object containing one input array and one output array
379
+
* @param dims - dimension indices defining the plane in which to assign elements to the diagonal
380
+
* @param k - diagonal offset
381
+
* @returns output ndarray
382
+
*
383
+
* @example
384
+
* var scalar2ndarray = require( './../../../from-scalar' );
* Assigns a scalar value to every element of an output ndarray.
369
403
*
@@ -3351,8 +3385,8 @@ interface Namespace {
3351
3385
*
3352
3386
* The purpose of this function is to order ndarray dimensions according to the magnitude of array strides. By using the ordered dimensions and associated strides, one can construct nested loops (one for each dimension) such that the innermost loop iterates over the dimension in which array elements are closest in memory and the outermost loop iterates over the dimension in which array elements are farthest apart in memory. As a consequence, element iteration is optimized to minimize cache misses and ensure locality of reference.
0 commit comments