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
Copy file name to clipboardExpand all lines: README.md
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -211,15 +211,18 @@ var o = ns;
211
211
- <spanclass="signature">[`gfindIndex( N, x, strideX, clbk[, thisArg] )`][@stdlib/blas/ext/base/gfind-index]</span><spanclass="delimiter">: </span><spanclass="description">return the index of the first element which passes a test implemented by a predicate function.</span>
212
212
- <spanclass="signature">[`gfindLastIndex( N, x, strideX, clbk[, thisArg] )`][@stdlib/blas/ext/base/gfind-last-index]</span><spanclass="delimiter">: </span><spanclass="description">return the index of the last element which passes a test implemented by a predicate function.</span>
213
213
- <spanclass="signature">[`gindexOfColumn( order, M, N, A, LDA, x, strideX )`][@stdlib/blas/ext/base/gindex-of-column]</span><spanclass="delimiter">: </span><spanclass="description">return the index of the first column in an input matrix which has the same elements as a provided search vector.</span>
214
+
- <spanclass="signature">[`gindexOfFalsy( N, x, strideX )`][@stdlib/blas/ext/base/gindex-of-falsy]</span><spanclass="delimiter">: </span><spanclass="description">return the index of the first falsy element in a strided array.</span>
214
215
- <spanclass="signature">[`gindexOfRow( order, M, N, A, LDA, x, strideX )`][@stdlib/blas/ext/base/gindex-of-row]</span><spanclass="delimiter">: </span><spanclass="description">return the index of the first row in an input matrix which has the same elements as a provided search vector.</span>
215
216
- <spanclass="signature">[`gindexOfTruthy( N, x, strideX )`][@stdlib/blas/ext/base/gindex-of-truthy]</span><spanclass="delimiter">: </span><spanclass="description">return the index of the first truthy element in a strided array.</span>
216
217
- <spanclass="signature">[`gindexOf( N, searchElement, x, strideX )`][@stdlib/blas/ext/base/gindex-of]</span><spanclass="delimiter">: </span><spanclass="description">return the first index of a specified search element in a strided array.</span>
217
218
- <spanclass="signature">[`gjoinBetween( N, prefix, suffix, x, strideX, separators, strideS )`][@stdlib/blas/ext/base/gjoin-between]</span><spanclass="delimiter">: </span><spanclass="description">return a string by joining strided array elements using a specified separator for each pair of consecutive elements.</span>
218
219
- <spanclass="signature">[`gjoin( N, separator, x, strideX )`][@stdlib/blas/ext/base/gjoin]</span><spanclass="delimiter">: </span><spanclass="description">return a string created by joining strided array elements using a specified separator.</span>
219
220
- <spanclass="signature">[`glastIndexOfRow( order, M, N, A, LDA, x, strideX, workspace, strideW )`][@stdlib/blas/ext/base/glast-index-of-row]</span><spanclass="delimiter">: </span><spanclass="description">return the index of the last row in an input matrix which has the same elements as a provided search vector.</span>
221
+
- <spanclass="signature">[`glastIndexOfTruthy( N, x, strideX )`][@stdlib/blas/ext/base/glast-index-of-truthy]</span><spanclass="delimiter">: </span><spanclass="description">return the index of the last truthy element in a strided array.</span>
220
222
- <spanclass="signature">[`glastIndexOf( N, searchElement, x, strideX )`][@stdlib/blas/ext/base/glast-index-of]</span><spanclass="delimiter">: </span><spanclass="description">return the last index of a specified search element in a strided array.</span>
221
223
- <spanclass="signature">[`glinspace( N, start, stop, endpoint, x, strideX )`][@stdlib/blas/ext/base/glinspace]</span><spanclass="delimiter">: </span><spanclass="description">fill a strided array with linearly spaced values over a specified interval.</span>
222
224
- <spanclass="signature">[`gminheapSiftDown( N, index, value, x, strideX )`][@stdlib/blas/ext/base/gminheap-sift-down]</span><spanclass="delimiter">: </span><spanclass="description">sift a value down from a specified index in a strided min-heap until the heap property is restored.</span>
225
+
- <spanclass="signature">[`gminheapify( N, x, strideX )`][@stdlib/blas/ext/base/gminheapify]</span><spanclass="delimiter">: </span><spanclass="description">convert a strided array to a min-heap.</span>
223
226
- <spanclass="signature">[`gmskrev( N, x, strideX, mask, strideMask )`][@stdlib/blas/ext/base/gmskrev]</span><spanclass="delimiter">: </span><spanclass="description">reverse a strided array in-place according to a mask.</span>
224
227
- <spanclass="signature">[`gnancount( N, x, strideX )`][@stdlib/blas/ext/base/gnancount]</span><spanclass="delimiter">: </span><spanclass="description">calculate the number of non-`NaN` elements in a strided array.</span>
225
228
- <spanclass="signature">[`gnannsumkbn( N, x, strideX, out, strideOut )`][@stdlib/blas/ext/base/gnannsumkbn]</span><spanclass="delimiter">: </span><spanclass="description">calculate the sum of strided array elements, ignoring `NaN` values and using an improved Kahan–Babuška algorithm.</span>
@@ -293,6 +296,7 @@ var o = ns;
293
296
- <spanclass="signature">[`slastIndexOfRow( order, M, N, A, LDA, x, strideX, workspace, strideW )`][@stdlib/blas/ext/base/slast-index-of-row]</span><spanclass="delimiter">: </span><spanclass="description">return the index of the last row in a single-precision floating-point input matrix which has the same elements as a provided search vector.</span>
294
297
- <spanclass="signature">[`slastIndexOf( N, searchElement, x, strideX )`][@stdlib/blas/ext/base/slast-index-of]</span><spanclass="delimiter">: </span><spanclass="description">return the last index of a specified search element in a single-precision floating-point strided array.</span>
295
298
- <spanclass="signature">[`slinspace( N, start, stop, endpoint, x, strideX )`][@stdlib/blas/ext/base/slinspace]</span><spanclass="delimiter">: </span><spanclass="description">fill a single-precision floating-point strided array with linearly spaced values over a specified interval.</span>
299
+
- <spanclass="signature">[`sminheapSiftDown( N, index, value, x, strideX )`][@stdlib/blas/ext/base/sminheap-sift-down]</span><spanclass="delimiter">: </span><spanclass="description">sift a value down from a specified index in a single-precision floating-point strided min-heap until the heap property is restored.</span>
296
300
- <spanclass="signature">[`smskrev( N, x, strideX, mask, strideMask )`][@stdlib/blas/ext/base/smskrev]</span><spanclass="delimiter">: </span><spanclass="description">reverse a single-precision floating-point strided array in-place according to a mask.</span>
297
301
- <spanclass="signature">[`snancount( N, x, strideX )`][@stdlib/blas/ext/base/snancount]</span><spanclass="delimiter">: </span><spanclass="description">calculate the number of non-`NaN` elements in a single-precision floating-point strided array.</span>
298
302
- <spanclass="signature">[`snansum( N, x, strideX )`][@stdlib/blas/ext/base/snansum]</span><spanclass="delimiter">: </span><spanclass="description">calculate the sum of single-precision floating-point strided array elements, ignoring `NaN` values.</span>
* Returns the index of the first falsy element in a strided array.
4434
+
*
4435
+
* ## Notes
4436
+
*
4437
+
* - If unable to find a falsy element, the function returns `-1`.
4438
+
*
4439
+
* @param N - number of indexed elements
4440
+
* @param x - input array
4441
+
* @param strideX - stride length
4442
+
* @returns index
4443
+
*
4444
+
* @example
4445
+
* var x = [ 3.0, 2.0, 0.0, 1.0 ];
4446
+
*
4447
+
* var idx = ns.gindexOfFalsy( x.length, x, 1 );
4448
+
* // returns 2
4449
+
*
4450
+
* @example
4451
+
* var x = [ 3.0, 2.0, 0.0, 1.0 ];
4452
+
*
4453
+
* var idx = ns.gindexOfFalsy.ndarray( x.length, x, 1, 0 );
4454
+
* // returns 2
4455
+
*/
4456
+
gindexOfFalsy: typeofgindexOfFalsy;
4457
+
4428
4458
/**
4429
4459
* Returns the index of the first row in an input matrix which has the same elements as a provided search vector.
4430
4460
*
@@ -4598,6 +4628,32 @@ interface Namespace {
4598
4628
*/
4599
4629
glastIndexOfRow: typeofglastIndexOfRow;
4600
4630
4631
+
/**
4632
+
* Returns the index of the last truthy element in a strided array.
4633
+
*
4634
+
* ## Notes
4635
+
*
4636
+
* - If unable to find a truthy element, the function returns `-1`.
4637
+
*
4638
+
* @param N - number of indexed elements
4639
+
* @param x - input array
4640
+
* @param strideX - stride length
4641
+
* @returns index
4642
+
*
4643
+
* @example
4644
+
* var x = [ 0.0, 1.0, 0.0, 2.0 ];
4645
+
*
4646
+
* var idx = ns.glastIndexOfTruthy( x.length, x, 1 );
4647
+
* // returns 3
4648
+
*
4649
+
* @example
4650
+
* var x = [ 0.0, 1.0, 0.0, 2.0 ];
4651
+
*
4652
+
* var idx = ns.glastIndexOfTruthy.ndarray( x.length, x, 1, 0 );
4653
+
* // returns 3
4654
+
*/
4655
+
glastIndexOfTruthy: typeofglastIndexOfTruthy;
4656
+
4601
4657
/**
4602
4658
* Fills a strided array with linearly spaced values over a specified interval.
4603
4659
*
@@ -4664,6 +4720,32 @@ interface Namespace {
4664
4720
*/
4665
4721
gminheapSiftDown: typeofgminheapSiftDown;
4666
4722
4723
+
/**
4724
+
* Converts a strided array to a min-heap.
4725
+
*
4726
+
* ## Notes
4727
+
*
4728
+
* - The min-heap algorithm is sensitive to the presence of `NaN` values. Since `NaN` comparisons always return `false`, if `NaN` values are present in the input array, the results may be unpredictable.
4729
+
*
4730
+
* @param N - number of indexed elements
4731
+
* @param x - input array
4732
+
* @param strideX - stride length
4733
+
* @returns input array
4734
+
*
4735
+
* @example
4736
+
* var x = [ 7.0, 5.0, 3.0, 1.0, 9.0 ];
4737
+
*
4738
+
* ns.gminheapify( 5, x, 1 );
4739
+
* // x => [ 1.0, 5.0, 3.0, 7.0, 9.0 ]
4740
+
*
4741
+
* @example
4742
+
* var x = [ 7.0, 5.0, 3.0, 1.0, 9.0 ];
4743
+
*
4744
+
* ns.gminheapify.ndarray( 5, x, 1, 0 );
4745
+
* // x => [ 1.0, 5.0, 3.0, 7.0, 9.0 ]
4746
+
*/
4747
+
gminheapify: typeofgminheapify;
4748
+
4667
4749
/**
4668
4750
* Reverses a strided array in-place according to a mask.
4669
4751
*
@@ -6727,6 +6809,39 @@ interface Namespace {
6727
6809
*/
6728
6810
slinspace: typeofslinspace;
6729
6811
6812
+
/**
6813
+
* Sifts a value down from a specified index in a single-precision floating-point strided min-heap until the heap property is restored.
6814
+
*
6815
+
* ## Notes
6816
+
*
6817
+
* - The function assumes that the subtrees rooted at the children of `index` already satisfy the min-heap property and only the value being sifted may violate the min-heap invariant.
6818
+
* - The min-heap algorithm is sensitive to the presence of `NaN` values. Since `NaN` comparisons always return `false`, if `NaN` values are present in the input array, the results may be unpredictable.
6819
+
*
6820
+
* @param N - number of indexed elements
6821
+
* @param index - logical index at which to begin sifting
6822
+
* @param value - value to place into the heap
6823
+
* @param x - heap storage array
6824
+
* @param strideX - stride length
6825
+
* @returns heap storage array
6826
+
*
6827
+
* @example
6828
+
* var Float32Array = require( '@stdlib/array-float32' );
6829
+
*
6830
+
* var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );
0 commit comments