forked from stdlib-js/stdlib
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrepl.txt
More file actions
129 lines (104 loc) · 5.36 KB
/
repl.txt
File metadata and controls
129 lines (104 loc) · 5.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
{{alias}}( x, searchElement[, fromIndex][, options] )
Returns the first index of a specified search element along an ndarray
dimension.
When searching for a search element, the function checks for equality using
the strict equality operator `===`. As a consequence, `NaN` values are
considered distinct, and `-0` and `+0` are considered the same.
If unable to find a search element along an ndarray dimension, the
corresponding element in the returned ndarray is `-1`.
Parameters
----------
x: ndarray
Input array. Must have at least one dimension.
searchElement: ndarray|any
Search element. May be either a scalar value or an ndarray. If provided
a scalar value, the value is cast to the data type of the input ndarray.
If provided an ndarray, the value must have a shape which is broadcast
compatible with the non-reduced dimensions of the input ndarray. For
example, given the input shape `[2, 3, 4]` and `options.dim=0`, the
search element ndarray must have a shape which is broadcast-compatible
with the shape `[3, 4]`.
fromIndex: ndarray|integer (optional)
Index from which to begin searching. May be either a scalar value or an
ndarray having an integer or "generic" data type. If provided an ndarray
the value must have a shape which is broadcast compatible with the non-
reduced dimensions of the input ndarray. For example, given the input
shape `[2, 3, 4]` and `options.dim=0`, a provided ndarray must have a
shape which is broadcast-compatible with the shape `[3, 4]`. If provided
a negative integer, the index at which to begin searching along a
dimension is determined by counting backward from the last element
(where -1 refers to the last element). Default: 0.
options: Object (optional)
Function options.
options.dtype: string|DataType (optional)
Output array data type. Must be an integer index or "generic" data type.
options.dim: integer (optional)
Dimension over which to perform a reduction. If provided a negative
integer, the dimension along which to perform the operation is
determined by counting backward from the last dimension (where -1 refers
to the last dimension). Default: -1.
options.keepdims: boolean (optional)
Boolean indicating whether the reduced dimensions should be included in
the returned ndarray as singleton dimensions. Default: false.
Returns
-------
out: ndarray
Output array.
Examples
--------
> var x = {{alias:@stdlib/ndarray/array}}( [ -1.0, 2.0, -3.0, -4.0 ] );
> var y = {{alias}}( x, 2.0 )
<ndarray>[ 1 ]
{{alias}}.assign( x, searchElement[, fromIndex], out[, options] )
Returns the first index of a specified search element along an ndarray
dimension and assigns results to a provided output ndarray.
When searching for a search element, the function checks for equality using
the strict equality operator `===`. As a consequence, `NaN` values are
considered distinct, and `-0` and `+0` are considered the same.
If unable to find a search element along an ndarray dimension, the
corresponding element in the returned ndarray is `-1`.
Parameters
----------
x: ndarray
Input array. Must have at least one dimension.
searchElement: ndarray|any
Search element. May be either a scalar value or an ndarray. If provided
a scalar value, the value is cast to the data type of the input ndarray.
If provided an ndarray, the value must have a shape which is broadcast
compatible with the non-reduced dimensions of the input ndarray. For
example, given the input shape `[2, 3, 4]` and `options.dim=0`, the
search element ndarray must have a shape which is broadcast-compatible
with the shape `[3, 4]`.
fromIndex: ndarray|integer (optional)
Index from which to begin searching. May be either a scalar value or an
ndarray having an integer or "generic" data type. If provided an ndarray
the value must have a shape which is broadcast compatible with the non-
reduced dimensions of the input ndarray. For example, given the input
shape `[2, 3, 4]` and `options.dim=0`, a provided ndarray must have a
shape which is broadcast-compatible with the shape `[3, 4]`. If provided
a negative integer, the index at which to begin searching along a
dimension is determined by counting backward from the last element
(where -1 refers to the last element). Default: 0.
out: ndarray
Output array.
options: Object (optional)
Function options.
options.dim: integer (optional)
Dimension over which to perform a reduction. If provided a negative
integer, the dimension along which to perform the operation is
determined by counting backward from the last dimension (where -1 refers
to the last dimension). Default: -1.
Returns
-------
out: ndarray
Output array.
Examples
--------
> var x = {{alias:@stdlib/ndarray/array}}( [ -1.0, 2.0, -3.0, -4.0 ] );
> var out = {{alias:@stdlib/ndarray/zeros}}( [], { 'dtype': 'int32' } );
> var y = {{alias}}.assign( x, 2.0, out )
<ndarray>[ 1 ]
> var bool = ( out === y )
true
See Also
--------