Skip to content

Commit 8b51e1d

Browse files
committed
Auto-generated commit
1 parent 481a7c2 commit 8b51e1d

File tree

8 files changed

+20
-75
lines changed

8 files changed

+20
-75
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -860,6 +860,7 @@ A total of 57 issues were closed in this release:
860860

861861
<details>
862862

863+
- [`ace9b98`](https://github.com/stdlib-js/stdlib/commit/ace9b98cd31056ec3efbbd14b3c12defe96b07fc) - **docs:** improve doctests for ndarray instances in `blas/ext/find-last-index` [(#11487)](https://github.com/stdlib-js/stdlib/pull/11487) _(by Uday Kakade)_
863864
- [`b2160c6`](https://github.com/stdlib-js/stdlib/commit/b2160c655c2ce47912079386eab7ecf61c6bbceb) - **docs:** improve doctests for ndarray instances in `blas/ext/index-of` [(#11488)](https://github.com/stdlib-js/stdlib/pull/11488) _(by Uday Kakade)_
864865
- [`15486dd`](https://github.com/stdlib-js/stdlib/commit/15486dd0fd476b34264b9773b2724d3b59484da5) - **test:** incorrect fixture import path in `strsv` [(#11491)](https://github.com/stdlib-js/stdlib/pull/11491) _(by Divit Jain)_
865866
- [`54aee70`](https://github.com/stdlib-js/stdlib/commit/54aee70f85a87f79c6b17e4a8cc13a1549a565ed) - **feat:** add `ssort` to namespace _(by Athan Reines)_

ext/last-index-of/README.md

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,7 @@ var x = array( [ 1.0, 2.0, 3.0, 2.0, 5.0, 6.0 ] );
4343

4444
// Perform operation:
4545
var out = lastIndexOf( x, 2.0 );
46-
// returns <ndarray>
47-
48-
var idx = out.get();
49-
// returns 3
46+
// returns <ndarray>[ 3 ]
5047
```
5148

5249
The function has the following parameters:
@@ -73,10 +70,7 @@ var x = array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
7370

7471
// Perform operation:
7572
var out = lastIndexOf( x, 10.0 );
76-
// returns <ndarray>
77-
78-
var idx = out.get();
79-
// returns -1
73+
// returns <ndarray>[ -1 ]
8074
```
8175

8276
By default, the function begins searching from the last element along the reduction dimension. To begin searching from a different index, provide a `fromIndex` argument.
@@ -90,34 +84,26 @@ var x = array( [ 1.0, 2.0, 3.0, 4.0, 2.0, 6.0 ] );
9084

9185
// Perform operation:
9286
var out = lastIndexOf( x, 2.0, 3 );
93-
// returns <ndarray>
94-
95-
var idx = out.get();
96-
// returns 1
87+
// returns <ndarray>[ 1 ]
9788
```
9889

9990
By default, the function performs the operation over elements in the last dimension. To perform the operation over a different dimension, provide a `dim` option.
10091

10192
```javascript
102-
var ndarray2array = require( '@stdlib/ndarray/to-array' );
10393
var array = require( '@stdlib/ndarray/array' );
10494

10595
var x = array( [ [ -3.0, 2.0 ], [ -3.0, 4.0 ] ] );
10696

10797
var out = lastIndexOf( x, -3.0, {
10898
'dim': 0
10999
});
110-
// returns <ndarray>
111-
112-
var idx = ndarray2array( out );
113-
// returns [ 1, -1 ]
100+
// returns <ndarray>[ 1, -1 ]
114101
```
115102

116103
By default, the function excludes reduced dimensions from the output [ndarray][@stdlib/ndarray/ctor]. To include the reduced dimensions as singleton dimensions, set the `keepdims` option to `true`.
117104

118105
```javascript
119106
var array = require( '@stdlib/ndarray/array' );
120-
var ndarray2array = require( '@stdlib/ndarray/to-array' );
121107

122108
var x = array( [ [ -3.0, 2.0 ], [ -3.0, 4.0 ] ] );
123109

@@ -127,10 +113,7 @@ var opts = {
127113
};
128114

129115
var out = lastIndexOf( x, -3.0, opts );
130-
// returns <ndarray>
131-
132-
var idx = ndarray2array( out );
133-
// returns [ [ 1, -1 ] ]
116+
// returns <ndarray>[ [ 1, -1 ] ]
134117
```
135118

136119
By default, the function returns an [ndarray][@stdlib/ndarray/ctor] having a [data type][@stdlib/ndarray/dtypes] determined by the function's output data type [policy][@stdlib/ndarray/output-dtype-policies]. To override the default behavior, set the `dtype` option.
@@ -164,10 +147,7 @@ var y = zeros( [], {
164147
});
165148

166149
var out = lastIndexOf.assign( x, 2.0, y );
167-
// returns <ndarray>
168-
169-
var idx = out.get();
170-
// returns 3
150+
// returns <ndarray>[ 3 ]
171151

172152
var bool = ( out === y );
173153
// returns true

ext/last-index-of/docs/repl.txt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,8 @@
5959
Examples
6060
--------
6161
> var x = {{alias:@stdlib/ndarray/array}}( [ -1.0, 2.0, -3.0, 2.0 ] );
62-
> var y = {{alias}}( x, 2.0, 3 );
63-
> var v = y.get()
64-
3
62+
> var y = {{alias}}( x, 2.0, 3 )
63+
<ndarray>[ 3 ]
6564

6665

6766
{{alias}}.assign( x, searchElement[, fromIndex], out[, options] )
@@ -122,11 +121,9 @@
122121
> var x = {{alias:@stdlib/ndarray/array}}( [ -1.0, 2.0, -3.0, 2.0 ] );
123122
> var out = {{alias:@stdlib/ndarray/zeros}}( [], { 'dtype': 'int32' } );
124123
> var y = {{alias}}.assign( x, 2.0, 3, out )
125-
<ndarray>
124+
<ndarray>[ 3 ]
126125
> var bool = ( out === y )
127126
true
128-
> var v = out.get()
129-
3
130127

131128
See Also
132129
--------

ext/last-index-of/docs/types/index.d.ts

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,7 @@ interface lastIndexOf {
9595
* var x = array( [ -1.0, 2.0, -3.0, 2.0 ] );
9696
*
9797
* var y = lastIndexOf( x, 2.0 );
98-
* // returns <ndarray>
99-
*
100-
* var idx = y.get();
101-
* // returns 3
98+
* // returns <ndarray>[ 3 ]
10299
*/
103100
<T = unknown>( x: InputArray<T>, searchElement: SearchElement<T>, options?: Options ): OutputArray;
104101

@@ -122,10 +119,7 @@ interface lastIndexOf {
122119
* var x = array( [ 1.0, 2.0, -3.0, 2.0, -5.0, 6.0 ] );
123120
*
124121
* var y = lastIndexOf( x, 2.0, 5 );
125-
* // returns <ndarray>
126-
*
127-
* var idx = y.get();
128-
* // returns 3
122+
* // returns <ndarray>[ 3 ]
129123
*/
130124
<T = unknown>( x: InputArray<T>, searchElement: SearchElement<T>, fromIndex: FromIndex, options?: Options ): OutputArray;
131125

@@ -153,13 +147,10 @@ interface lastIndexOf {
153147
* } );
154148
*
155149
* var out = lastIndexOf.assign( x, 2.0, y );
156-
* // returns <ndarray>
150+
* // returns <ndarray>[ 3 ]
157151
*
158152
* var bool = ( out === y );
159153
* // returns true
160-
*
161-
* var idx = out.get();
162-
* // returns 3
163154
*/
164155
assign<T = unknown, U extends OutputArray = OutputArray>( x: InputArray<T>, searchElement: SearchElement<T>, out: U, options?: BaseOptions ): U;
165156

@@ -188,13 +179,10 @@ interface lastIndexOf {
188179
* } );
189180
*
190181
* var out = lastIndexOf.assign( x, 1.0, 5, y );
191-
* // returns <ndarray>
182+
* // returns <ndarray>[ 0 ]
192183
*
193184
* var bool = ( out === y );
194185
* // returns true
195-
*
196-
* var idx = out.get();
197-
* // returns 0
198186
*/
199187
assign<T = unknown, U extends OutputArray = OutputArray>( x: InputArray<T>, searchElement: SearchElement<T>, fromIndex: FromIndex, out: U, options?: BaseOptions ): U;
200188
}
@@ -219,10 +207,7 @@ interface lastIndexOf {
219207
* var x = array( [ -1.0, 2.0, -3.0, 2.0 ] );
220208
*
221209
* var y = lastIndexOf( x, 2.0 );
222-
* // returns <ndarray>
223-
*
224-
* var idx = y.get();
225-
* // returns 3
210+
* // returns <ndarray>[ 3 ]
226211
*
227212
* @example
228213
* var zeros = require( '@stdlib/ndarray/zeros' );
@@ -234,13 +219,10 @@ interface lastIndexOf {
234219
* } );
235220
*
236221
* var out = lastIndexOf.assign( x, 2.0, y );
237-
* // returns <ndarray>
222+
* // returns <ndarray>[ 3 ]
238223
*
239224
* var bool = ( out === y );
240225
* // returns true
241-
*
242-
* var idx = out.get();
243-
* // returns 3
244226
*/
245227
declare const lastIndexOf: lastIndexOf;
246228

ext/last-index-of/lib/assign.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ var DEFAULT_DTYPE = defaults.get( 'dtypes.integer_index' );
6464
* @example
6565
* var Float64Array = require( '@stdlib/array/float64' );
6666
* var zeros = require( '@stdlib/ndarray/zeros' );
67-
* var ndarray2array = require( '@stdlib/ndarray/to-array' );
6867
* var ndarray = require( '@stdlib/ndarray/ctor' );
6968
*
7069
* // Create data buffers:
@@ -89,13 +88,10 @@ var DEFAULT_DTYPE = defaults.get( 'dtypes.integer_index' );
8988
*
9089
* // Perform operation:
9190
* var out = assign( x, 2.0, y );
92-
* // returns <ndarray>
91+
* // returns <ndarray>[ 1, 0 ]
9392
*
9493
* var bool = ( out === y );
9594
* // returns true
96-
*
97-
* var arr = ndarray2array( out );
98-
* // returns [ 1, 0 ]
9995
*/
10096
function assign( x, searchElement, fromIndex, out ) {
10197
var hasOptions;

ext/last-index-of/lib/base.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,7 @@ var table = {
107107
*
108108
* // Perform operation:
109109
* var out = lastIndexOf( x, searchElement, fromIndex );
110-
* // returns <ndarray>
111-
*
112-
* var idx = out.get();
113-
* // returns 3
110+
* // returns <ndarray>[ 2 ]
114111
*/
115112
var lastIndexOf = factory( table, [ idtypes0, idtypes1, idtypes2 ], odtypes, policies ); // eslint-disable-line max-len
116113

ext/last-index-of/lib/index.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
*
2626
* @example
2727
* var Float64Array = require( '@stdlib/array/float64' );
28-
* var ndarray2array = require( '@stdlib/ndarray/to-array' );
2928
* var ndarray = require( '@stdlib/ndarray/ctor' );
3029
* var lastIndexOf = require( '@stdlib/blas/ext/last-index-of' );
3130
*
@@ -46,10 +45,7 @@
4645
*
4746
* // Perform operation:
4847
* var out = lastIndexOf( x, 2.0 );
49-
* // returns <ndarray>
50-
*
51-
* var arr = ndarray2array( out );
52-
* // returns [ 1, 0 ]
48+
* // returns <ndarray>[ 1, 0 ]
5349
*/
5450

5551
// MODULES //

ext/last-index-of/lib/main.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ var DEFAULT_DTYPE = defaults.get( 'dtypes.integer_index' );
6363
*
6464
* @example
6565
* var Float64Array = require( '@stdlib/array/float64' );
66-
* var ndarray2array = require( '@stdlib/ndarray/to-array' );
6766
* var ndarray = require( '@stdlib/ndarray/ctor' );
6867
*
6968
* // Create a data buffer:
@@ -83,10 +82,7 @@ var DEFAULT_DTYPE = defaults.get( 'dtypes.integer_index' );
8382
*
8483
* // Perform operation:
8584
* var out = lastIndexOf( x, 2.0 );
86-
* // returns <ndarray>
87-
*
88-
* var arr = ndarray2array( out );
89-
* // returns [ 1, 0 ]
85+
* // returns <ndarray>[ 1, 0 ]
9086
*/
9187
function lastIndexOf( x, searchElement, fromIndex ) {
9288
var hasOptions;

0 commit comments

Comments
 (0)