-
-
Notifications
You must be signed in to change notification settings - Fork 809
/
Copy pathrepl.txt
128 lines (99 loc) · 4.62 KB
/
repl.txt
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
{{alias}}( start, stop, length[, options] )
Generates a linearly spaced array over a specified interval.
If the specified length is zero, the function returns an empty array.
If the specified length is one, the function returns an array containing
`stop`, but not `start`, when `endpoint` is true; otherwise, the function
returns an array containing `start`, but not `stop`.
For real-valued `start` and `stop`, if `start` is less than `stop`, the
output array will contain ascending values, and, if `start` is greater than
`stop`, the output array will contain descending values.
When the output array length is greater than one and `endpoint` is true, the
output array is guaranteed to include the `start` and `stop` values. Beware,
however, that values between `start` and `stop` are subject to floating-
point rounding errors.
If both `start` and `stop` are real-valued, the output array data type may
be any floating-point data type or 'generic'. However, if either `start` or
`stop` are complex numbers, the output array type must be a complex
floating-point data type or 'generic'.
When writing to a complex floating-point output array, real-valued `start`
and `stop` values are treated as complex numbers having a real component
equaling the provided value and having an imaginary component equaling zero.
When generating linearly spaced complex floating-point numbers, the real and
imaginary components are generated separately.
Parameters
----------
start: number|ComplexLike
Start of interval.
stop: number|ComplexLike
End of interval.
length: integer
Length of output array.
options: Object (optional)
Options.
options.dtype: string (optional)
Output array data type. Must be a floating-point data type or 'generic'.
If either `start` or `stop` is a complex number, the default output
array data type is 'complex128'; otherwise, the default output array
data type is 'float64'.
options.endpoint: boolean (optional)
Boolean indicating whether to include the `stop` value in the output
array. If false, the function generates `length + 1` linearly spaced
values over the interval `[start, stop]` and only writes `length` values
to the output array, thus excluding `stop` from the output array.
Accordingly, for a fixed `length`, the spacing between adjacent values
in the output array changes depending on the value of `endpoint`.
Default: true.
Returns
-------
arr: Array
Linearly spaced array.
Examples
--------
> var arr = {{alias}}( 0.0, 100.0, 6 )
<Float64Array>[ 0.0, 20.0, 40.0, 60.0, 80.0, 100.0 ]
> arr = {{alias}}( 0.0, 100.0, 5, { 'endpoint': false } )
<Float64Array>[ 0.0, 20.0, 40.0, 60.0, 80.0 ]
> arr = {{alias}}( 0.0, 100.0, 6, { 'dtype': 'generic' } )
[ 0.0, 20.0, 40.0, 60.0, 80.0, 100.0 ]
{{alias}}.assign( start, stop, out[, options] )
Generates a linearly spaced sequence over a specified interval and assigns
the results to a provided output array.
If the provided output array is empty, the function returns the provided
output array unchanged.
If the provided output array contains a single element, the function writes
the `stop` value, but not `start`, when `endpoint` is true; otherwise, the
function writes the `start` value, but not `stop`.
Parameters
----------
start: number|ComplexLike
Start of interval.
stop: number|ComplexLike
End of interval.
out: ArrayLikeObject
Output array.
options: Object (optional)
Options.
options.endpoint: boolean (optional)
Boolean indicating whether to include the `stop` value in the output
array. If false, the function generates `N+1` linearly spaced values
(where `N` is the length of the provided output array) over the interval
`[start, stop]` and only writes `N` values to the output array, thus
excluding `stop` from the output array. Accordingly, for a fixed `N`,
the spacing between adjacent values in the output array changes
depending on the value of `endpoint`. Default: true.
Returns
-------
out: ArrayLikeObject
Output array.
Examples
--------
> var arr = [ 0, 0, 0, 0, 0, 0 ];
> var out = {{alias}}.assign( 0, 100, arr )
[ 0, 20, 40, 60, 80, 100 ]
> var bool = ( arr === out )
true
> arr = [ 0, 0, 0, 0, 0 ];
> out = {{alias}}.assign( 0, 100, arr, { 'endpoint': false } )
[ 0, 20, 40, 60, 80 ]
See Also
--------