carray 3.0.1 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +520 -0
- data/README.md +2 -2
- data/carray.gemspec +1 -1
- data/ext/ca_axis_dispatch.c +33 -4
- data/ext/ca_axis_group.c +202 -96
- data/ext/ca_categorical_iterator.c +108 -54
- data/ext/ca_kernel_iterator.c +317 -51
- data/ext/ca_kernel_iterator.h +142 -35
- data/ext/ca_obj_array.c +62 -20
- data/ext/ca_obj_block.c +4 -4
- data/ext/ca_obj_const_string.c +85 -26
- data/ext/ca_obj_face.c +24 -0
- data/ext/ca_obj_face.h +15 -0
- data/ext/ca_obj_fixlen_string.c +18 -5
- data/ext/ca_obj_meld.c +123 -25
- data/ext/ca_obj_object.c +8 -0
- data/ext/ca_obj_select.c +49 -34
- data/ext/ca_obj_stack.c +3 -8
- data/ext/ca_obj_stride.c +72 -1
- data/ext/ca_obj_string.c +8 -4
- data/ext/ca_obj_window.c +8 -2
- data/ext/ca_op_ipower.c +1 -2
- data/ext/ca_rng_normal.h +42 -0
- data/ext/ca_rng_xoshiro256pp.h +105 -0
- data/ext/ca_sweep_engine.c +307 -143
- data/ext/ca_sweep_engine.h +26 -5
- data/ext/carray.h +21 -2
- data/ext/carray_access.c +32 -20
- data/ext/carray_address_basis.c +590 -0
- data/ext/carray_broadcast.c +3 -3
- data/ext/carray_call_cfunc.c +667 -483
- data/ext/carray_cast.c +115 -41
- data/ext/carray_copy.c +55 -30
- data/ext/carray_core.c +83 -3
- data/ext/carray_count.c +9 -10
- data/ext/carray_factorize.c +46 -25
- data/ext/carray_internal.h +17 -0
- data/ext/carray_kernels_reduce_aggregate.c +168 -0
- data/ext/carray_kernels_reduce_cumulative.c +270 -1
- data/ext/carray_kernels_reduce_extreme.c +554 -8
- data/ext/carray_kernels_scan.c +4 -4
- data/ext/carray_kernels_search.c +94 -14
- data/ext/carray_loop.c +7 -1
- data/ext/carray_mask.c +23 -8
- data/ext/carray_median_percentile.c +55 -0
- data/ext/carray_operator.c +4 -4
- data/ext/carray_order.c +1 -1
- data/ext/carray_random.c +384 -40
- data/ext/carray_slab.c +13 -0
- data/ext/carray_sort.c +20 -22
- data/ext/mk_call_cfunc.rb +103 -116
- data/ext/mkkernel.rb +297 -29
- data/ext/ruby_carray.c +10 -1
- data/ext/version.h +4 -4
- data/lib/carray/autoload_carray.rb +5 -3
- data/lib/carray/autoload_method_extension.rb +12 -0
- data/lib/carray/axis_group.rb +77 -0
- data/lib/carray/basics.rb +4 -0
- data/lib/carray/block_iterator.rb +92 -16
- data/lib/carray/categorical.rb +150 -33
- data/lib/carray/categorical_iterator.rb +207 -80
- data/lib/carray/const_string.rb +131 -27
- data/lib/carray/construct.rb +40 -0
- data/lib/carray/data_type_extension.rb +3 -0
- data/lib/carray/data_type_limits.rb +91 -0
- data/lib/carray/fixlen_string.rb +1 -1
- data/lib/carray/frame/csv_parser.rb +11 -4
- data/lib/carray/frame/frame.rb +81 -10
- data/lib/carray/frame/group.rb +36 -3
- data/lib/carray/frame/io.rb +67 -15
- data/lib/carray/frame/records.rb +18 -4
- data/lib/carray/frame/verbs.rb +14 -11
- data/lib/carray/inspect.rb +42 -9
- data/lib/carray/iterator.rb +143 -0
- data/lib/carray/lazy.rb +0 -37
- data/lib/carray/mask_gap_fill.rb +3 -1
- data/lib/carray/methods/discovery_along.rb +74 -0
- data/lib/carray/methods/factorize.rb +50 -0
- data/lib/carray/methods/is_in.rb +13 -2
- data/lib/carray/methods/locate_addr.rb +75 -2
- data/lib/carray/methods/mask_duplicates.rb +35 -1
- data/lib/carray/methods/nunique.rb +22 -1
- data/lib/carray/methods/repeat.rb +110 -0
- data/lib/carray/methods/unique.rb +41 -1
- data/lib/carray/rng.rb +86 -0
- data/lib/carray/slab_iterator.rb +58 -13
- data/lib/carray/string_operation_extension.rb +5 -1
- data/lib/carray/time.rb +18 -2
- data/lib/carray/window_iterator.rb +142 -20
- data/lib/carray.rb +2 -0
- data/yard-stubs/ca_obj_block.rb +2 -7
- data/yard-stubs/ca_obj_window.rb +10 -2
- data/yard-stubs/carray_access.rb +1 -1
- data/yard-stubs/carray_broadcast.rb +1 -1
- data/yard-stubs/carray_core.rb +0 -80
- data/yard-stubs/carray_count.rb +7 -2
- data/yard-stubs/carray_lazy.rb +205 -0
- data/yard-stubs/carray_math.rb +1486 -3
- data/yard-stubs/carray_median_percentile.rb +16 -2
- data/yard-stubs/carray_order.rb +9 -69
- data/yard-stubs/carray_slab.rb +9 -7
- data/yard-stubs/carray_sort.rb +7 -5
- metadata +9 -1
data/yard-stubs/carray_math.rb
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
# DOCUMENTATION ONLY — DO NOT REQUIRE.
|
|
2
2
|
# Stubs for the elementwise arithmetic generated by ext/mkkernel.rb --
|
|
3
|
-
# the
|
|
4
|
-
#
|
|
5
|
-
#
|
|
3
|
+
# the arithmetic, bitwise and logical operators, the comparison and
|
|
4
|
+
# predicate forms, the transcendental and angle functions, and the
|
|
5
|
+
# destructive counterpart of each. These generated kernels carry no C
|
|
6
|
+
# docstring, and lib/carray/lazy.rb redefines many of them through
|
|
7
|
+
# define_method for lazy dispatch, so neither side is visible to YARD
|
|
8
|
+
# and the documentation lives here.
|
|
9
|
+
#
|
|
10
|
+
# Every method below dispatches lazily: applied to a lazy view it
|
|
11
|
+
# builds a node in the expression tree instead of evaluating, and the
|
|
12
|
+
# eager and lazy paths are required to agree element for element.
|
|
13
|
+
#
|
|
14
|
+
# See yard-stubs/README.md and yard-stubs/STYLE.md.
|
|
6
15
|
|
|
7
16
|
class CArray
|
|
8
17
|
# @!group Elementwise math
|
|
@@ -128,5 +137,1479 @@ class CArray
|
|
|
128
137
|
# @return [CArray] same `data_type` as `self`.
|
|
129
138
|
def frac; end
|
|
130
139
|
|
|
140
|
+
# @overload +(other)
|
|
141
|
+
# Returns the element-wise sum of `self` and `other`.
|
|
142
|
+
#
|
|
143
|
+
# Works on every numeric and complex `data_type`, and on `:object`
|
|
144
|
+
# (where each element receives Ruby `+`, so `Rational` and
|
|
145
|
+
# `BigDecimal` stay exact). Boolean arrays participate as their 0/1
|
|
146
|
+
# storage and promote to `:int64`, so a difference can reach `-1`.
|
|
147
|
+
# Masked elements stay masked.
|
|
148
|
+
# @param other [CArray, Numeric] addend, broadcast to `self.shape`.
|
|
149
|
+
# @return [CArray] result of the promoted `data_type` of the two
|
|
150
|
+
# operands.
|
|
151
|
+
# @example
|
|
152
|
+
# CA_INT32([1, 2]) + 10 # => [ 11, 12 ]
|
|
153
|
+
def +(other); end
|
|
154
|
+
|
|
155
|
+
# @overload add(other)
|
|
156
|
+
# Alias of {#+}.
|
|
157
|
+
# @param other [CArray, Numeric] addend.
|
|
158
|
+
# @return [CArray]
|
|
159
|
+
def add(other); end
|
|
160
|
+
|
|
161
|
+
# @overload -(other)
|
|
162
|
+
# Returns the element-wise difference of `self` and `other`.
|
|
163
|
+
# Follows {#+} in every respect.
|
|
164
|
+
# @param other [CArray, Numeric] subtrahend, broadcast to `self.shape`.
|
|
165
|
+
# @return [CArray] result of the promoted `data_type` of the two
|
|
166
|
+
# operands.
|
|
167
|
+
def -(other); end
|
|
168
|
+
|
|
169
|
+
# @overload sub(other)
|
|
170
|
+
# Alias of {#-}.
|
|
171
|
+
# @param other [CArray, Numeric] subtrahend.
|
|
172
|
+
# @return [CArray]
|
|
173
|
+
def sub(other); end
|
|
174
|
+
|
|
175
|
+
# @overload *(other)
|
|
176
|
+
# Returns the element-wise product of `self` and `other`.
|
|
177
|
+
#
|
|
178
|
+
# A `:cmplx64` product is formed in double precision before being
|
|
179
|
+
# rounded back, because the two products a complex multiply
|
|
180
|
+
# subtracts can cancel; the extra width is spent on accuracy, not
|
|
181
|
+
# speed. Otherwise as {#+}.
|
|
182
|
+
# @param other [CArray, Numeric] multiplier, broadcast to `self.shape`.
|
|
183
|
+
# @return [CArray] result of the promoted `data_type` of the two
|
|
184
|
+
# operands.
|
|
185
|
+
def *(other); end
|
|
186
|
+
|
|
187
|
+
# @overload mul(other)
|
|
188
|
+
# Alias of {#*}.
|
|
189
|
+
# @param other [CArray, Numeric] multiplier.
|
|
190
|
+
# @return [CArray]
|
|
191
|
+
def mul(other); end
|
|
192
|
+
|
|
193
|
+
# @overload **(other)
|
|
194
|
+
# Returns `self` raised element-wise to the power `other`.
|
|
195
|
+
#
|
|
196
|
+
# The result keeps the promoted `data_type` of the operands, so an
|
|
197
|
+
# integer base with a negative integer exponent truncates toward
|
|
198
|
+
# zero rather than producing a fraction (`2 ** -1` is `0`). Cast to
|
|
199
|
+
# a float `data_type` first when a fractional power is wanted.
|
|
200
|
+
# Masked elements stay masked.
|
|
201
|
+
# @param other [CArray, Numeric] exponent, broadcast to `self.shape`.
|
|
202
|
+
# @return [CArray] result of the promoted `data_type` of the two
|
|
203
|
+
# operands.
|
|
204
|
+
# @example
|
|
205
|
+
# CA_INT32([2, 3]) ** 3 # => [ 8, 27 ]
|
|
206
|
+
# CA_INT32([2]) ** -1 # => [ 0 ]
|
|
207
|
+
def **(other); end
|
|
208
|
+
|
|
209
|
+
# @overload power(other)
|
|
210
|
+
# Alias of {#**}.
|
|
211
|
+
# @param other [CArray, Numeric] exponent.
|
|
212
|
+
# @return [CArray]
|
|
213
|
+
def power(other); end
|
|
214
|
+
|
|
215
|
+
# @overload rcp_mul(other)
|
|
216
|
+
# Returns `other` divided element-wise by `self` -- the reciprocal
|
|
217
|
+
# of {#/} in operand order, so that scaling a constant by an array
|
|
218
|
+
# needs no temporary.
|
|
219
|
+
# @param other [CArray, Numeric] dividend, broadcast to `self.shape`.
|
|
220
|
+
# @return [CArray] result of the promoted `data_type` of the two
|
|
221
|
+
# operands.
|
|
222
|
+
# @raise [ZeroDivisionError] when an integer element of `self` is `0`.
|
|
223
|
+
# @example
|
|
224
|
+
# CA_DOUBLE([1.0, 2.0, 4.0]).rcp_mul(2.0) # => [ 2.0, 1.0, 0.5 ]
|
|
225
|
+
def rcp_mul(other); end
|
|
226
|
+
|
|
227
|
+
# @overload -@
|
|
228
|
+
# Returns the element-wise negation of `self`, keeping `self`'s
|
|
229
|
+
# `data_type`. A boolean array promotes to `:int64`. An `:object`
|
|
230
|
+
# array delegates to each element's `#-@`.
|
|
231
|
+
# @return [CArray]
|
|
232
|
+
def -@; end
|
|
233
|
+
|
|
234
|
+
# @overload neg
|
|
235
|
+
# Alias of {#-@}.
|
|
236
|
+
# @return [CArray]
|
|
237
|
+
def neg; end
|
|
238
|
+
|
|
239
|
+
# @overload abs
|
|
240
|
+
# Returns the element-wise magnitude of `self`.
|
|
241
|
+
#
|
|
242
|
+
# A numeric array keeps its `data_type`; a complex array returns the
|
|
243
|
+
# real magnitude at that complex type's own width, so a `:cmplx64`
|
|
244
|
+
# yields `:float32` just as {#real} and {#imag} do. For the form
|
|
245
|
+
# that keeps a complex array complex (magnitude with a zero
|
|
246
|
+
# imaginary part) use {#abs_i}, which also accepts `:object`.
|
|
247
|
+
# @return [CArray] `self`'s `data_type` for numeric input; the real
|
|
248
|
+
# component type for complex input.
|
|
249
|
+
# @raise [CArray::DataTypeError] for a boolean or `:object` array.
|
|
250
|
+
# @example
|
|
251
|
+
# CA_CMPLX64([Complex(3, 4)]).abs # => [ 5.0 ] (:float32)
|
|
252
|
+
def abs; end
|
|
253
|
+
|
|
254
|
+
# @overload abs_i
|
|
255
|
+
# Returns the element-wise magnitude of `self`, keeping `self`'s
|
|
256
|
+
# `data_type` -- a complex array stays complex (imaginary part
|
|
257
|
+
# zero), a boolean promotes to `:int64`, and an `:object` array
|
|
258
|
+
# delegates to each element's `#abs`. See {#abs} for the form that
|
|
259
|
+
# returns a real magnitude from a complex array.
|
|
260
|
+
# @return [CArray] same `data_type` as `self` (`:int64` for boolean).
|
|
261
|
+
def abs_i; end
|
|
262
|
+
|
|
263
|
+
# @overload square
|
|
264
|
+
# Returns `self * self` element-wise, keeping `self`'s `data_type`
|
|
265
|
+
# (a boolean promotes to `:int64`).
|
|
266
|
+
# @return [CArray]
|
|
267
|
+
def square; end
|
|
268
|
+
|
|
269
|
+
# @overload rcp
|
|
270
|
+
# Returns the element-wise reciprocal `1 / self`, keeping `self`'s
|
|
271
|
+
# `data_type`. On an integer array the quotient is an integer, so
|
|
272
|
+
# every element but `±1` becomes `0`; cast first when that is not
|
|
273
|
+
# wanted.
|
|
274
|
+
# @return [CArray] same `data_type` as `self`.
|
|
275
|
+
# @raise [ZeroDivisionError] when an integer element is `0`.
|
|
276
|
+
# @raise [CArray::DataTypeError] for a boolean array.
|
|
277
|
+
def rcp; end
|
|
278
|
+
|
|
279
|
+
# @overload rsqrt
|
|
280
|
+
# Returns the element-wise reciprocal square root `1 / sqrt(self)`.
|
|
281
|
+
# A float array keeps its width and a complex array stays complex;
|
|
282
|
+
# an integer array promotes to `:float64`.
|
|
283
|
+
# @return [CArray] `:float64`, or `self`'s own float/complex type.
|
|
284
|
+
# @raise [CArray::DataTypeError] for a boolean array.
|
|
285
|
+
# @example
|
|
286
|
+
# CA_DOUBLE([4.0, 16.0]).rsqrt # => [ 0.5, 0.25 ]
|
|
287
|
+
def rsqrt; end
|
|
288
|
+
|
|
289
|
+
# @overload sign
|
|
290
|
+
# Returns `-1`, `0`, or `1` element-wise according to the sign of
|
|
291
|
+
# each element, keeping `self`'s `data_type` (so a float array
|
|
292
|
+
# yields `-1.0` / `0.0` / `1.0`).
|
|
293
|
+
# @return [CArray] same `data_type` as `self`.
|
|
294
|
+
# @raise [CArray::DataTypeError] for an `:object` array.
|
|
295
|
+
# @example
|
|
296
|
+
# CA_DOUBLE([-3.0, 0.0, 2.0]).sign # => [ -1.0, 0.0, 1.0 ]
|
|
297
|
+
def sign; end
|
|
298
|
+
|
|
299
|
+
# @overload zero
|
|
300
|
+
# Returns an array of the same shape and `data_type` as `self` with
|
|
301
|
+
# every element set to zero. The mask is carried over.
|
|
302
|
+
# @return [CArray]
|
|
303
|
+
def zero; end
|
|
304
|
+
|
|
305
|
+
# @overload one
|
|
306
|
+
# Returns an array of the same shape and `data_type` as `self` with
|
|
307
|
+
# every element set to one. The mask is carried over.
|
|
308
|
+
# @return [CArray]
|
|
309
|
+
def one; end
|
|
310
|
+
|
|
311
|
+
# @overload conj
|
|
312
|
+
# Returns the element-wise complex conjugate. A real array is
|
|
313
|
+
# returned with its values unchanged (a boolean promotes to
|
|
314
|
+
# `:int64`), so the operation is safe to apply without testing for
|
|
315
|
+
# a complex `data_type`.
|
|
316
|
+
# @return [CArray] same `data_type` as `self`.
|
|
317
|
+
def conj; end
|
|
318
|
+
|
|
319
|
+
# @overload arg
|
|
320
|
+
# Returns the element-wise argument (phase angle, in radians) of
|
|
321
|
+
# `self`, in `(-pi, pi]`.
|
|
322
|
+
#
|
|
323
|
+
# A complex array yields its real component type (`:cmplx64` ->
|
|
324
|
+
# `:float32`); a float array keeps its width; an integer array
|
|
325
|
+
# promotes to `:float64`, because a negative element has argument
|
|
326
|
+
# `pi` and would otherwise be truncated.
|
|
327
|
+
# @return [CArray] `:float64` for integer input, otherwise the real
|
|
328
|
+
# component type of `self`.
|
|
329
|
+
# @raise [CArray::DataTypeError] for a boolean or `:object` array.
|
|
330
|
+
# @example
|
|
331
|
+
# CA_DOUBLE([-1.0, 1.0]).arg # => [ 3.141592653589793, 0.0 ]
|
|
332
|
+
def arg; end
|
|
333
|
+
|
|
334
|
+
# @overload imag_i
|
|
335
|
+
# Returns the element-wise imaginary part, keeping `self`'s
|
|
336
|
+
# `data_type` -- a complex array stays complex (real part zero) and
|
|
337
|
+
# a real array yields zeros. See {#imag} for the real-valued form.
|
|
338
|
+
# @return [CArray] same `data_type` as `self` (`:int64` for boolean).
|
|
339
|
+
def imag_i; end
|
|
340
|
+
|
|
341
|
+
# @overload floor
|
|
342
|
+
# Returns the element-wise largest integral value not greater than
|
|
343
|
+
# each element, keeping `self`'s `data_type` (a `:float64` stays
|
|
344
|
+
# `:float64`). Integer arrays are returned unchanged; an `:object`
|
|
345
|
+
# array delegates to each element's `#floor`.
|
|
346
|
+
# @return [CArray] same `data_type` as `self`.
|
|
347
|
+
# @raise [CArray::DataTypeError] for a complex array.
|
|
348
|
+
def floor; end
|
|
349
|
+
|
|
350
|
+
# @overload ceil
|
|
351
|
+
# Returns the element-wise smallest integral value not less than
|
|
352
|
+
# each element, keeping `self`'s `data_type`. Otherwise as {#floor}.
|
|
353
|
+
# @return [CArray] same `data_type` as `self`.
|
|
354
|
+
# @raise [CArray::DataTypeError] for a complex array.
|
|
355
|
+
def ceil; end
|
|
356
|
+
|
|
357
|
+
# @overload trunc
|
|
358
|
+
# Returns each element with its fractional part removed (rounded
|
|
359
|
+
# toward zero), keeping `self`'s `data_type`. This is the companion
|
|
360
|
+
# of {#frac}: `self.trunc + self.frac == self`.
|
|
361
|
+
# @return [CArray] same `data_type` as `self`.
|
|
362
|
+
# @raise [CArray::DataTypeError] for a complex array.
|
|
363
|
+
def trunc; end
|
|
364
|
+
|
|
365
|
+
# @overload sqrt
|
|
366
|
+
# Returns the element-wise square root.
|
|
367
|
+
#
|
|
368
|
+
# A float array keeps its width (a `:float32` is computed and
|
|
369
|
+
# returned in single precision), a complex array stays complex, and
|
|
370
|
+
# an integer array promotes to `:float64`. A negative element of a
|
|
371
|
+
# real array yields `NaN`; take `.to_type(:cmplx128)` first to get
|
|
372
|
+
# the complex root instead.
|
|
373
|
+
# @return [CArray] `:float64` for integer input, otherwise `self`'s
|
|
374
|
+
# own float or complex type.
|
|
375
|
+
# @raise [CArray::DataTypeError] for a boolean array.
|
|
376
|
+
def sqrt; end
|
|
377
|
+
|
|
378
|
+
# @overload exp
|
|
379
|
+
# Returns `e` raised element-wise to each element of `self`.
|
|
380
|
+
# Type behaviour as {#sqrt}.
|
|
381
|
+
# @return [CArray]
|
|
382
|
+
# @raise [CArray::DataTypeError] for a boolean array.
|
|
383
|
+
def exp; end
|
|
384
|
+
|
|
385
|
+
# @overload exp2
|
|
386
|
+
# Returns `2` raised element-wise to each element of `self`.
|
|
387
|
+
# Type behaviour as {#sqrt}.
|
|
388
|
+
# @return [CArray]
|
|
389
|
+
# @raise [CArray::DataTypeError] for a boolean array.
|
|
390
|
+
def exp2; end
|
|
391
|
+
|
|
392
|
+
# @overload exp10
|
|
393
|
+
# Returns `10` raised element-wise to each element of `self`.
|
|
394
|
+
# Type behaviour as {#sqrt}.
|
|
395
|
+
# @return [CArray]
|
|
396
|
+
# @raise [CArray::DataTypeError] for a boolean array.
|
|
397
|
+
def exp10; end
|
|
398
|
+
|
|
399
|
+
# @overload expm1
|
|
400
|
+
# Returns `exp(self) - 1` element-wise, accurate for elements near
|
|
401
|
+
# zero where computing the subtraction directly would cancel.
|
|
402
|
+
# Real `data_type`s only.
|
|
403
|
+
# @return [CArray] `:float64` for integer input, otherwise `self`'s
|
|
404
|
+
# own float type.
|
|
405
|
+
# @raise [CArray::DataTypeError] for a boolean or complex array.
|
|
406
|
+
def expm1; end
|
|
407
|
+
|
|
408
|
+
# @overload log
|
|
409
|
+
# Returns the element-wise natural logarithm. Type behaviour as
|
|
410
|
+
# {#sqrt}. A negative element of a real array yields `NaN` and a
|
|
411
|
+
# zero element yields `-Infinity`.
|
|
412
|
+
#
|
|
413
|
+
# The complex branch is computed in double precision even for
|
|
414
|
+
# `:cmplx64`: the real part of `log(z)` is `log|z|`, which vanishes
|
|
415
|
+
# on the unit circle, so measuring `|z|` at the narrower width
|
|
416
|
+
# would round away what the logarithm then needs.
|
|
417
|
+
# @return [CArray]
|
|
418
|
+
# @raise [CArray::DataTypeError] for a boolean array.
|
|
419
|
+
def log; end
|
|
420
|
+
|
|
421
|
+
# @overload log2
|
|
422
|
+
# Returns the element-wise base-2 logarithm. Real `data_type`s only.
|
|
423
|
+
# @return [CArray] `:float64` for integer input, otherwise `self`'s
|
|
424
|
+
# own float type.
|
|
425
|
+
# @raise [CArray::DataTypeError] for a boolean or complex array.
|
|
426
|
+
def log2; end
|
|
427
|
+
|
|
428
|
+
# @overload log10
|
|
429
|
+
# Returns the element-wise base-10 logarithm. Real `data_type`s only.
|
|
430
|
+
# @return [CArray] `:float64` for integer input, otherwise `self`'s
|
|
431
|
+
# own float type.
|
|
432
|
+
# @raise [CArray::DataTypeError] for a boolean or complex array.
|
|
433
|
+
def log10; end
|
|
434
|
+
|
|
435
|
+
# @overload log1p
|
|
436
|
+
# Returns `log(1 + self)` element-wise, accurate for elements near
|
|
437
|
+
# zero. Real `data_type`s only.
|
|
438
|
+
# @return [CArray] `:float64` for integer input, otherwise `self`'s
|
|
439
|
+
# own float type.
|
|
440
|
+
# @raise [CArray::DataTypeError] for a boolean or complex array.
|
|
441
|
+
def log1p; end
|
|
442
|
+
|
|
443
|
+
# @overload logb
|
|
444
|
+
# Returns the exponent of each element in the floating-point radix,
|
|
445
|
+
# as a floating-point value: `8.0` yields `3.0` and `0.5` yields
|
|
446
|
+
# `-1.0`. Real `data_type`s only.
|
|
447
|
+
# @return [CArray] `:float64` for integer input, otherwise `self`'s
|
|
448
|
+
# own float type.
|
|
449
|
+
# @raise [CArray::DataTypeError] for a boolean or complex array.
|
|
450
|
+
# @example
|
|
451
|
+
# CA_DOUBLE([8.0, 1.0, 0.5]).logb # => [ 3.0, 0.0, -1.0 ]
|
|
452
|
+
def logb; end
|
|
453
|
+
|
|
454
|
+
# @overload sin
|
|
455
|
+
# Returns the element-wise sine, the argument taken in radians.
|
|
456
|
+
# Type behaviour as {#sqrt}.
|
|
457
|
+
# @return [CArray]
|
|
458
|
+
# @raise [CArray::DataTypeError] for a boolean array.
|
|
459
|
+
def sin; end
|
|
460
|
+
|
|
461
|
+
# @overload cos
|
|
462
|
+
# Returns the element-wise cosine, the argument taken in radians.
|
|
463
|
+
# Type behaviour as {#sqrt}.
|
|
464
|
+
# @return [CArray]
|
|
465
|
+
# @raise [CArray::DataTypeError] for a boolean array.
|
|
466
|
+
def cos; end
|
|
467
|
+
|
|
468
|
+
# @overload tan
|
|
469
|
+
# Returns the element-wise tangent, the argument taken in radians.
|
|
470
|
+
# Type behaviour as {#sqrt}.
|
|
471
|
+
# @return [CArray]
|
|
472
|
+
# @raise [CArray::DataTypeError] for a boolean array.
|
|
473
|
+
def tan; end
|
|
474
|
+
|
|
475
|
+
# @overload asin
|
|
476
|
+
# Returns the element-wise arc sine, in radians. Type behaviour as
|
|
477
|
+
# {#sqrt}. An element of a real array outside `[-1, 1]` yields
|
|
478
|
+
# `NaN`; a complex array has no such restriction.
|
|
479
|
+
# @return [CArray]
|
|
480
|
+
# @raise [CArray::DataTypeError] for a boolean array.
|
|
481
|
+
def asin; end
|
|
482
|
+
|
|
483
|
+
# @overload acos
|
|
484
|
+
# Returns the element-wise arc cosine, in radians. Otherwise as
|
|
485
|
+
# {#asin}.
|
|
486
|
+
# @return [CArray]
|
|
487
|
+
# @raise [CArray::DataTypeError] for a boolean array.
|
|
488
|
+
def acos; end
|
|
489
|
+
|
|
490
|
+
# @overload atan
|
|
491
|
+
# Returns the element-wise arc tangent, in radians, in
|
|
492
|
+
# `(-pi/2, pi/2)`. For the two-argument form that resolves the
|
|
493
|
+
# quadrant see {#atan2}.
|
|
494
|
+
# @return [CArray]
|
|
495
|
+
# @raise [CArray::DataTypeError] for a boolean array.
|
|
496
|
+
def atan; end
|
|
497
|
+
|
|
498
|
+
# @overload sinh
|
|
499
|
+
# Returns the element-wise hyperbolic sine. Type behaviour as
|
|
500
|
+
# {#sqrt}.
|
|
501
|
+
# @return [CArray]
|
|
502
|
+
# @raise [CArray::DataTypeError] for a boolean array.
|
|
503
|
+
def sinh; end
|
|
504
|
+
|
|
505
|
+
# @overload cosh
|
|
506
|
+
# Returns the element-wise hyperbolic cosine. Type behaviour as
|
|
507
|
+
# {#sqrt}.
|
|
508
|
+
# @return [CArray]
|
|
509
|
+
# @raise [CArray::DataTypeError] for a boolean array.
|
|
510
|
+
def cosh; end
|
|
511
|
+
|
|
512
|
+
# @overload tanh
|
|
513
|
+
# Returns the element-wise hyperbolic tangent. Type behaviour as
|
|
514
|
+
# {#sqrt}.
|
|
515
|
+
# @return [CArray]
|
|
516
|
+
# @raise [CArray::DataTypeError] for a boolean array.
|
|
517
|
+
def tanh; end
|
|
518
|
+
|
|
519
|
+
# @overload asinh
|
|
520
|
+
# Returns the element-wise inverse hyperbolic sine. Type behaviour
|
|
521
|
+
# as {#sqrt}.
|
|
522
|
+
# @return [CArray]
|
|
523
|
+
# @raise [CArray::DataTypeError] for a boolean array.
|
|
524
|
+
def asinh; end
|
|
525
|
+
|
|
526
|
+
# @overload acosh
|
|
527
|
+
# Returns the element-wise inverse hyperbolic cosine. Type
|
|
528
|
+
# behaviour as {#sqrt}. An element of a real array below `1` yields
|
|
529
|
+
# `NaN`.
|
|
530
|
+
# @return [CArray]
|
|
531
|
+
# @raise [CArray::DataTypeError] for a boolean array.
|
|
532
|
+
def acosh; end
|
|
533
|
+
|
|
534
|
+
# @overload atanh
|
|
535
|
+
# Returns the element-wise inverse hyperbolic tangent. Type
|
|
536
|
+
# behaviour as {#sqrt}. An element of a real array outside
|
|
537
|
+
# `(-1, 1)` yields `NaN` or `±Infinity`.
|
|
538
|
+
# @return [CArray]
|
|
539
|
+
# @raise [CArray::DataTypeError] for a boolean array.
|
|
540
|
+
def atanh; end
|
|
541
|
+
|
|
542
|
+
# @overload atan2(other)
|
|
543
|
+
# Returns the element-wise arc tangent of `self / other` in
|
|
544
|
+
# radians, using the signs of both to place the result in the
|
|
545
|
+
# correct quadrant, in `(-pi, pi]`. `self` is the ordinate.
|
|
546
|
+
#
|
|
547
|
+
# Unlike the one-argument transcendentals, the two-argument float
|
|
548
|
+
# functions do not promote integers: they accept float and
|
|
549
|
+
# `:object` arrays only.
|
|
550
|
+
# @param other [CArray, Numeric] the abscissa, broadcast to
|
|
551
|
+
# `self.shape`.
|
|
552
|
+
# @return [CArray] `self`'s own float type.
|
|
553
|
+
# @raise [CArray::DataTypeError] for an integer, boolean, or
|
|
554
|
+
# complex array.
|
|
555
|
+
def atan2(other); end
|
|
556
|
+
|
|
557
|
+
# @overload hypot(other)
|
|
558
|
+
# Returns `sqrt(self ** 2 + other ** 2)` element-wise, computed
|
|
559
|
+
# without the overflow that squaring the operands directly would
|
|
560
|
+
# cause. Accepts float and `:object` arrays only, as {#atan2}.
|
|
561
|
+
# @param other [CArray, Numeric] the other leg, broadcast to
|
|
562
|
+
# `self.shape`.
|
|
563
|
+
# @return [CArray] `self`'s own float type.
|
|
564
|
+
# @raise [CArray::DataTypeError] for an integer, boolean, or
|
|
565
|
+
# complex array.
|
|
566
|
+
def hypot(other); end
|
|
567
|
+
|
|
568
|
+
# @overload copysign(other)
|
|
569
|
+
# Returns each element of `self` with the magnitude it already has
|
|
570
|
+
# and the sign of the matching element of `other`. The sign of a
|
|
571
|
+
# zero is respected, so `copysign` distinguishes `-0.0` from `0.0`.
|
|
572
|
+
# Accepts float and `:object` arrays only, as {#atan2}.
|
|
573
|
+
# @param other [CArray, Numeric] sign source, broadcast to
|
|
574
|
+
# `self.shape`.
|
|
575
|
+
# @return [CArray] `self`'s own float type.
|
|
576
|
+
# @raise [CArray::DataTypeError] for an integer, boolean, or
|
|
577
|
+
# complex array.
|
|
578
|
+
def copysign(other); end
|
|
579
|
+
|
|
580
|
+
# @overload nextafter(other)
|
|
581
|
+
# Returns the next representable value after each element of `self`
|
|
582
|
+
# in the direction of `other`, stepping by one unit in the last
|
|
583
|
+
# place of `self`'s own float type. Accepts float and `:object`
|
|
584
|
+
# arrays only, as {#atan2}.
|
|
585
|
+
# @param other [CArray, Numeric] direction, broadcast to
|
|
586
|
+
# `self.shape`.
|
|
587
|
+
# @return [CArray] `self`'s own float type.
|
|
588
|
+
# @raise [CArray::DataTypeError] for an integer, boolean, or
|
|
589
|
+
# complex array.
|
|
590
|
+
def nextafter(other); end
|
|
591
|
+
|
|
592
|
+
# @overload logaddexp(other)
|
|
593
|
+
# Returns `log(exp(self) + exp(other))` element-wise, computed
|
|
594
|
+
# without the overflow that exponentiating large elements directly
|
|
595
|
+
# would cause -- the usual way to add probabilities held as
|
|
596
|
+
# logarithms. Accepts float and `:object` arrays only, as {#atan2}.
|
|
597
|
+
# @param other [CArray, Numeric] the other log-value, broadcast to
|
|
598
|
+
# `self.shape`.
|
|
599
|
+
# @return [CArray] `self`'s own float type.
|
|
600
|
+
# @raise [CArray::DataTypeError] for an integer, boolean, or
|
|
601
|
+
# complex array.
|
|
602
|
+
def logaddexp(other); end
|
|
603
|
+
|
|
604
|
+
# @overload deg
|
|
605
|
+
# Returns each element converted from radians to degrees.
|
|
606
|
+
# @return [CArray] `:float64` for integer input, otherwise `self`'s
|
|
607
|
+
# own float type.
|
|
608
|
+
# @raise [CArray::DataTypeError] for a boolean or complex array.
|
|
609
|
+
def deg; end
|
|
610
|
+
|
|
611
|
+
# @overload rad
|
|
612
|
+
# Returns each element converted from degrees to radians.
|
|
613
|
+
# @return [CArray] `:float64` for integer input, otherwise `self`'s
|
|
614
|
+
# own float type.
|
|
615
|
+
# @raise [CArray::DataTypeError] for a boolean or complex array.
|
|
616
|
+
def rad; end
|
|
617
|
+
|
|
618
|
+
# @overload deg_180
|
|
619
|
+
# Returns each element, taken in degrees, wrapped into the interval
|
|
620
|
+
# `(-180, 180]`.
|
|
621
|
+
# @return [CArray] `:float64` for integer input, otherwise `self`'s
|
|
622
|
+
# own float type.
|
|
623
|
+
# @raise [CArray::DataTypeError] for a boolean or complex array.
|
|
624
|
+
# @example
|
|
625
|
+
# CA_DOUBLE([270.0]).deg_180 # => [ -90.0 ]
|
|
626
|
+
def deg_180; end
|
|
627
|
+
|
|
628
|
+
# @overload deg_360
|
|
629
|
+
# Returns each element, taken in degrees, wrapped into the interval
|
|
630
|
+
# `[0, 360)`.
|
|
631
|
+
# @return [CArray] `:float64` for integer input, otherwise `self`'s
|
|
632
|
+
# own float type.
|
|
633
|
+
# @raise [CArray::DataTypeError] for a boolean or complex array.
|
|
634
|
+
# @example
|
|
635
|
+
# CA_DOUBLE([-10.0]).deg_360 # => [ 350.0 ]
|
|
636
|
+
def deg_360; end
|
|
637
|
+
|
|
638
|
+
# @overload rad_pi
|
|
639
|
+
# Returns each element, taken in radians, wrapped into the interval
|
|
640
|
+
# `(-pi, pi]` -- the radian counterpart of {#deg_180}.
|
|
641
|
+
# @return [CArray] `:float64` for integer input, otherwise `self`'s
|
|
642
|
+
# own float type.
|
|
643
|
+
# @raise [CArray::DataTypeError] for a boolean or complex array.
|
|
644
|
+
def rad_pi; end
|
|
645
|
+
|
|
646
|
+
# @overload rad_2pi
|
|
647
|
+
# Returns each element, taken in radians, wrapped into the interval
|
|
648
|
+
# `[0, 2*pi)` -- the radian counterpart of {#deg_360}.
|
|
649
|
+
# @return [CArray] `:float64` for integer input, otherwise `self`'s
|
|
650
|
+
# own float type.
|
|
651
|
+
# @raise [CArray::DataTypeError] for a boolean or complex array.
|
|
652
|
+
def rad_2pi; end
|
|
653
|
+
|
|
654
|
+
# @overload pmax(other)
|
|
655
|
+
# Returns the element-wise larger of `self` and `other`, ignoring
|
|
656
|
+
# `NaN`: where one element is `NaN` the other is returned, and only
|
|
657
|
+
# two `NaN`s give `NaN`. This is C's `fmax`. For the form that lets
|
|
658
|
+
# a `NaN` win see {#maximum}.
|
|
659
|
+
# @param other [CArray, Numeric] the other operand, broadcast to
|
|
660
|
+
# `self.shape`.
|
|
661
|
+
# @return [CArray] result of the promoted `data_type` of the two
|
|
662
|
+
# operands (`:int64` for boolean).
|
|
663
|
+
# @raise [CArray::DataTypeError] for a complex array, which has no
|
|
664
|
+
# ordering.
|
|
665
|
+
# @example
|
|
666
|
+
# CA_DOUBLE([Float::NAN]).pmax(1.0) # => [ 1.0 ]
|
|
667
|
+
def pmax(other); end
|
|
668
|
+
|
|
669
|
+
# @overload pmin(other)
|
|
670
|
+
# Returns the element-wise smaller of `self` and `other`, ignoring
|
|
671
|
+
# `NaN`. The counterpart of {#pmax}.
|
|
672
|
+
# @param other [CArray, Numeric] the other operand.
|
|
673
|
+
# @return [CArray]
|
|
674
|
+
# @raise [CArray::DataTypeError] for a complex array.
|
|
675
|
+
def pmin(other); end
|
|
676
|
+
|
|
677
|
+
# @overload fmax(other)
|
|
678
|
+
# Alias of {#pmax}, under the name C gives it.
|
|
679
|
+
# @param other [CArray, Numeric] the other operand.
|
|
680
|
+
# @return [CArray]
|
|
681
|
+
def fmax(other); end
|
|
682
|
+
|
|
683
|
+
# @overload fmin(other)
|
|
684
|
+
# Alias of {#pmin}, under the name C gives it.
|
|
685
|
+
# @param other [CArray, Numeric] the other operand.
|
|
686
|
+
# @return [CArray]
|
|
687
|
+
def fmin(other); end
|
|
688
|
+
|
|
689
|
+
# @overload maximum(other)
|
|
690
|
+
# Returns the element-wise larger of `self` and `other`,
|
|
691
|
+
# propagating `NaN`: where either element is `NaN` the result is
|
|
692
|
+
# `NaN`. Use this when a `NaN` must not be silently dropped, and
|
|
693
|
+
# {#pmax} when it should be skipped.
|
|
694
|
+
# @param other [CArray, Numeric] the other operand, broadcast to
|
|
695
|
+
# `self.shape`.
|
|
696
|
+
# @return [CArray] result of the promoted `data_type` of the two
|
|
697
|
+
# operands (`:int64` for boolean).
|
|
698
|
+
# @raise [CArray::DataTypeError] for a complex array.
|
|
699
|
+
# @example
|
|
700
|
+
# CA_DOUBLE([Float::NAN]).maximum(1.0) # => [ NaN ]
|
|
701
|
+
def maximum(other); end
|
|
702
|
+
|
|
703
|
+
# @overload minimum(other)
|
|
704
|
+
# Returns the element-wise smaller of `self` and `other`,
|
|
705
|
+
# propagating `NaN`. The counterpart of {#maximum}.
|
|
706
|
+
# @param other [CArray, Numeric] the other operand.
|
|
707
|
+
# @return [CArray]
|
|
708
|
+
# @raise [CArray::DataTypeError] for a complex array.
|
|
709
|
+
def minimum(other); end
|
|
710
|
+
|
|
711
|
+
# @overload fma(a, b)
|
|
712
|
+
# Returns `self * a + b` element-wise, evaluated as one fused
|
|
713
|
+
# operation so no temporary array is built for the product.
|
|
714
|
+
# @param a [CArray, Numeric] multiplier, broadcast to `self.shape`.
|
|
715
|
+
# @param b [CArray, Numeric] addend, broadcast to `self.shape`.
|
|
716
|
+
# @return [CArray] result of the promoted `data_type` of the three
|
|
717
|
+
# operands.
|
|
718
|
+
# @example
|
|
719
|
+
# CA_DOUBLE([2.0]).fma(3.0, 4.0) # => [ 10.0 ]
|
|
720
|
+
def fma(a, b); end
|
|
721
|
+
|
|
722
|
+
# @overload fms(a, b)
|
|
723
|
+
# Returns `self * a - b` element-wise, the subtracting counterpart
|
|
724
|
+
# of {#fma}.
|
|
725
|
+
# @param a [CArray, Numeric] multiplier.
|
|
726
|
+
# @param b [CArray, Numeric] subtrahend.
|
|
727
|
+
# @return [CArray]
|
|
728
|
+
# @example
|
|
729
|
+
# CA_DOUBLE([2.0]).fms(3.0, 4.0) # => [ 2.0 ]
|
|
730
|
+
def fms(a, b); end
|
|
731
|
+
|
|
732
|
+
# @overload eq(other)
|
|
733
|
+
# Returns a boolean array that is true where `self` and `other` are
|
|
734
|
+
# equal element-wise. Distinct from {#==}, which compares two
|
|
735
|
+
# arrays as wholes and returns a single `true` or `false`.
|
|
736
|
+
#
|
|
737
|
+
# Accepts every numeric, complex, boolean, `:fixlen` (byte
|
|
738
|
+
# comparison) and `:object` (Ruby `==`) `data_type`. A masked
|
|
739
|
+
# element yields a masked result rather than `false`. Floating
|
|
740
|
+
# point equality is exact here; for a tolerant comparison see
|
|
741
|
+
# {#is_close} (absolute) or {#is_equiv} (relative).
|
|
742
|
+
# @param other [CArray, Numeric, Object] comparand, broadcast to
|
|
743
|
+
# `self.shape`.
|
|
744
|
+
# @return [CArray] `:boolean`, same shape as `self`.
|
|
745
|
+
# @example
|
|
746
|
+
# CA_DOUBLE([1.0, 2.0]).eq(2.0) # => [ false, true ]
|
|
747
|
+
def eq(other); end
|
|
748
|
+
|
|
749
|
+
# @overload ne(other)
|
|
750
|
+
# Returns a boolean array that is true where `self` and `other`
|
|
751
|
+
# differ element-wise. The negation of {#eq}.
|
|
752
|
+
# @param other [CArray, Numeric, Object] comparand.
|
|
753
|
+
# @return [CArray] `:boolean`.
|
|
754
|
+
def ne(other); end
|
|
755
|
+
|
|
756
|
+
# @overload <(other)
|
|
757
|
+
# Returns a boolean array that is true where each element of `self`
|
|
758
|
+
# is less than the matching element of `other`.
|
|
759
|
+
#
|
|
760
|
+
# Accepts numeric, boolean, `:fixlen` (byte order, shorter first on
|
|
761
|
+
# a common prefix) and `:object` (Ruby `<`) `data_type`s. Complex
|
|
762
|
+
# arrays have no ordering and raise.
|
|
763
|
+
# @param other [CArray, Numeric, Object] comparand, broadcast to
|
|
764
|
+
# `self.shape`.
|
|
765
|
+
# @return [CArray] `:boolean`, same shape as `self`.
|
|
766
|
+
# @raise [TypeError] for a complex array.
|
|
767
|
+
def <(other); end
|
|
768
|
+
|
|
769
|
+
# @overload lt(other)
|
|
770
|
+
# Alias of {#<}.
|
|
771
|
+
# @param other [CArray, Numeric, Object] comparand.
|
|
772
|
+
# @return [CArray] `:boolean`.
|
|
773
|
+
def lt(other); end
|
|
774
|
+
|
|
775
|
+
# @overload <=(other)
|
|
776
|
+
# Returns a boolean array that is true where each element of `self`
|
|
777
|
+
# is less than or equal to the matching element of `other`.
|
|
778
|
+
# Otherwise as {#<}.
|
|
779
|
+
# @param other [CArray, Numeric, Object] comparand.
|
|
780
|
+
# @return [CArray] `:boolean`.
|
|
781
|
+
# @raise [TypeError] for a complex array.
|
|
782
|
+
def <=(other); end
|
|
783
|
+
|
|
784
|
+
# @overload le(other)
|
|
785
|
+
# Alias of {#<=}.
|
|
786
|
+
# @param other [CArray, Numeric, Object] comparand.
|
|
787
|
+
# @return [CArray] `:boolean`.
|
|
788
|
+
def le(other); end
|
|
789
|
+
|
|
790
|
+
# @overload >(other)
|
|
791
|
+
# Returns a boolean array that is true where each element of `self`
|
|
792
|
+
# is greater than the matching element of `other`. Otherwise as
|
|
793
|
+
# {#<}.
|
|
794
|
+
# @param other [CArray, Numeric, Object] comparand.
|
|
795
|
+
# @return [CArray] `:boolean`.
|
|
796
|
+
# @raise [TypeError] for a complex array.
|
|
797
|
+
def >(other); end
|
|
798
|
+
|
|
799
|
+
# @overload gt(other)
|
|
800
|
+
# Alias of {#>}.
|
|
801
|
+
# @param other [CArray, Numeric, Object] comparand.
|
|
802
|
+
# @return [CArray] `:boolean`.
|
|
803
|
+
def gt(other); end
|
|
804
|
+
|
|
805
|
+
# @overload >=(other)
|
|
806
|
+
# Returns a boolean array that is true where each element of `self`
|
|
807
|
+
# is greater than or equal to the matching element of `other`.
|
|
808
|
+
# Otherwise as {#<}.
|
|
809
|
+
# @param other [CArray, Numeric, Object] comparand.
|
|
810
|
+
# @return [CArray] `:boolean`.
|
|
811
|
+
# @raise [TypeError] for a complex array.
|
|
812
|
+
def >=(other); end
|
|
813
|
+
|
|
814
|
+
# @overload ge(other)
|
|
815
|
+
# Alias of {#>=}.
|
|
816
|
+
# @param other [CArray, Numeric, Object] comparand.
|
|
817
|
+
# @return [CArray] `:boolean`.
|
|
818
|
+
def ge(other); end
|
|
819
|
+
|
|
820
|
+
# @overload feq(other)
|
|
821
|
+
# Returns a boolean array that is true where `self` and `other`
|
|
822
|
+
# agree element-wise to within the machine epsilon of `self`'s
|
|
823
|
+
# float type, scaled by the larger of the two magnitudes. Use it
|
|
824
|
+
# instead of {#eq} when comparing computed floating-point values.
|
|
825
|
+
# For an explicit tolerance see {#is_close} and {#is_equiv}.
|
|
826
|
+
# @param other [CArray, Numeric] comparand, broadcast to
|
|
827
|
+
# `self.shape`.
|
|
828
|
+
# @return [CArray] `:boolean`.
|
|
829
|
+
# @raise [TypeError] for any non-float `data_type`.
|
|
830
|
+
def feq(other); end
|
|
831
|
+
|
|
832
|
+
# @overload is_close(other, tolerance)
|
|
833
|
+
# Returns a boolean array that is true where `self` and `other`
|
|
834
|
+
# agree element-wise within an **absolute** tolerance:
|
|
835
|
+
# `|self - other| <= tolerance`. Complex arrays compare by the
|
|
836
|
+
# magnitude of the difference.
|
|
837
|
+
# @param other [CArray, Numeric] comparand, broadcast to
|
|
838
|
+
# `self.shape`.
|
|
839
|
+
# @param tolerance [Numeric] largest accepted absolute difference.
|
|
840
|
+
# @return [CArray] `:boolean`.
|
|
841
|
+
# @example
|
|
842
|
+
# CA_DOUBLE([1000.0]).is_close(1001.0, 1.0) # => [ true ]
|
|
843
|
+
def is_close(other, tolerance); end
|
|
844
|
+
|
|
845
|
+
# @overload is_equiv(other, tolerance)
|
|
846
|
+
# Returns a boolean array that is true where `self` and `other`
|
|
847
|
+
# agree element-wise within a **relative** tolerance:
|
|
848
|
+
# `|self - other| / max(|self|, |other|) <= tolerance`, with
|
|
849
|
+
# exactly equal elements always true. Prefer this to {#is_close}
|
|
850
|
+
# when the elements span several orders of magnitude.
|
|
851
|
+
# @param other [CArray, Numeric] comparand, broadcast to
|
|
852
|
+
# `self.shape`.
|
|
853
|
+
# @param tolerance [Numeric] largest accepted relative difference.
|
|
854
|
+
# @return [CArray] `:boolean`.
|
|
855
|
+
# @example
|
|
856
|
+
# CA_DOUBLE([1000.0]).is_equiv(1001.0, 0.01) # => [ true ]
|
|
857
|
+
# CA_DOUBLE([0.001]).is_equiv(0.002, 0.01) # => [ false ]
|
|
858
|
+
def is_equiv(other, tolerance); end
|
|
859
|
+
|
|
860
|
+
# @overload is_nan
|
|
861
|
+
# Returns a boolean array that is true where an element is `NaN`.
|
|
862
|
+
# @return [CArray] `:boolean`, same shape as `self`.
|
|
863
|
+
# @raise [CArray::DataTypeError] for a boolean array.
|
|
864
|
+
# @raise [NoMethodError] for an `:object` array whose elements do
|
|
865
|
+
# not respond to `#nan?`.
|
|
866
|
+
def is_nan; end
|
|
867
|
+
|
|
868
|
+
# @overload is_inf
|
|
869
|
+
# Returns a boolean array that is true where an element is
|
|
870
|
+
# positive or negative infinity.
|
|
871
|
+
# @return [CArray] `:boolean`.
|
|
872
|
+
# @raise [CArray::DataTypeError] for a boolean array.
|
|
873
|
+
def is_inf; end
|
|
874
|
+
|
|
875
|
+
# @overload is_finite
|
|
876
|
+
# Returns a boolean array that is true where an element is neither
|
|
877
|
+
# `NaN` nor infinite.
|
|
878
|
+
# @return [CArray] `:boolean`.
|
|
879
|
+
# @raise [CArray::DataTypeError] for a boolean array.
|
|
880
|
+
def is_finite; end
|
|
881
|
+
|
|
882
|
+
# @overload is_invalid
|
|
883
|
+
# Returns a boolean array that is true where an element is `NaN` or
|
|
884
|
+
# infinite -- the negation of {#is_finite}, in one pass. Pair it
|
|
885
|
+
# with {#mask_where} to mask the elements a computation cannot use.
|
|
886
|
+
# @return [CArray] `:boolean`.
|
|
887
|
+
# @example
|
|
888
|
+
# CA_DOUBLE([Float::NAN, 1.0/0, 1.0]).is_invalid # => [ true, true, false ]
|
|
889
|
+
def is_invalid; end
|
|
890
|
+
|
|
891
|
+
# @overload signbit
|
|
892
|
+
# Returns a boolean array that is true where an element carries a
|
|
893
|
+
# negative sign bit. A negative zero is true, which distinguishes
|
|
894
|
+
# `-0.0` from `0.0` where a `< 0` comparison cannot.
|
|
895
|
+
# @return [CArray] `:boolean`.
|
|
896
|
+
# @raise [CArray::DataTypeError] for a complex array.
|
|
897
|
+
# @example
|
|
898
|
+
# CA_DOUBLE([-1.0, 0.0, -0.0]).signbit # => [ true, false, true ]
|
|
899
|
+
def signbit; end
|
|
900
|
+
|
|
901
|
+
# @overload &(other)
|
|
902
|
+
# Returns the element-wise conjunction of `self` and `other`: a
|
|
903
|
+
# bitwise `AND` on integer arrays, a logical `AND` on boolean ones.
|
|
904
|
+
#
|
|
905
|
+
# On boolean arrays the masked elements follow three-valued
|
|
906
|
+
# (Kleene) logic rather than propagating blindly: an unknown
|
|
907
|
+
# element `AND` `false` is `false`, because the answer does not
|
|
908
|
+
# depend on the unknown. Only where the result genuinely depends on
|
|
909
|
+
# a masked element is the result masked. {#and} is the two-valued
|
|
910
|
+
# form that always propagates.
|
|
911
|
+
# @param other [CArray, Integer, true, false] the other operand,
|
|
912
|
+
# broadcast to `self.shape`.
|
|
913
|
+
# @return [CArray] `:boolean` for boolean operands, otherwise the
|
|
914
|
+
# promoted integer `data_type`.
|
|
915
|
+
# @raise [CArray::DataTypeError] for a float or complex array.
|
|
916
|
+
def &(other); end
|
|
917
|
+
|
|
918
|
+
# @overload bit_and(other)
|
|
919
|
+
# Alias of {#&}.
|
|
920
|
+
# @param other [CArray, Integer, true, false] the other operand.
|
|
921
|
+
# @return [CArray]
|
|
922
|
+
def bit_and(other); end
|
|
923
|
+
|
|
924
|
+
# @overload |(other)
|
|
925
|
+
# Returns the element-wise disjunction of `self` and `other`: a
|
|
926
|
+
# bitwise `OR` on integer arrays, a logical `OR` on boolean ones.
|
|
927
|
+
# Boolean operands follow Kleene logic as in {#&}, so an unknown
|
|
928
|
+
# element `OR` `true` is `true`.
|
|
929
|
+
# @param other [CArray, Integer, true, false] the other operand,
|
|
930
|
+
# broadcast to `self.shape`.
|
|
931
|
+
# @return [CArray] `:boolean` for boolean operands, otherwise the
|
|
932
|
+
# promoted integer `data_type`.
|
|
933
|
+
# @raise [CArray::DataTypeError] for a float or complex array.
|
|
934
|
+
def |(other); end
|
|
935
|
+
|
|
936
|
+
# @overload bit_or(other)
|
|
937
|
+
# Alias of {#|}.
|
|
938
|
+
# @param other [CArray, Integer, true, false] the other operand.
|
|
939
|
+
# @return [CArray]
|
|
940
|
+
def bit_or(other); end
|
|
941
|
+
|
|
942
|
+
# @overload ^(other)
|
|
943
|
+
# Returns the element-wise exclusive disjunction of `self` and
|
|
944
|
+
# `other`: a bitwise `XOR` on integer arrays, a logical `XOR` on
|
|
945
|
+
# boolean ones.
|
|
946
|
+
#
|
|
947
|
+
# Unlike {#&} and {#|} this has no Kleene shortcut -- an exclusive
|
|
948
|
+
# or always depends on both operands -- so a masked element always
|
|
949
|
+
# gives a masked result.
|
|
950
|
+
# @param other [CArray, Integer, true, false] the other operand,
|
|
951
|
+
# broadcast to `self.shape`.
|
|
952
|
+
# @return [CArray] `:boolean` for boolean operands, otherwise the
|
|
953
|
+
# promoted integer `data_type`.
|
|
954
|
+
# @raise [CArray::DataTypeError] for a float or complex array.
|
|
955
|
+
def ^(other); end
|
|
956
|
+
|
|
957
|
+
# @overload bit_xor(other)
|
|
958
|
+
# Alias of {#^}.
|
|
959
|
+
# @param other [CArray, Integer, true, false] the other operand.
|
|
960
|
+
# @return [CArray]
|
|
961
|
+
def bit_xor(other); end
|
|
962
|
+
|
|
963
|
+
# @overload <<(other)
|
|
964
|
+
# Returns each element of `self` shifted left by the matching
|
|
965
|
+
# number of bits in `other`. Integer `data_type`s only (a boolean
|
|
966
|
+
# promotes to `:int64`).
|
|
967
|
+
# @param other [CArray, Integer] shift counts, broadcast to
|
|
968
|
+
# `self.shape`.
|
|
969
|
+
# @return [CArray] the promoted integer `data_type`.
|
|
970
|
+
# @raise [CArray::DataTypeError] for a float or complex array.
|
|
971
|
+
def <<(other); end
|
|
972
|
+
|
|
973
|
+
# @overload bit_lshift(other)
|
|
974
|
+
# Alias of {#<<}.
|
|
975
|
+
# @param other [CArray, Integer] shift counts.
|
|
976
|
+
# @return [CArray]
|
|
977
|
+
def bit_lshift(other); end
|
|
978
|
+
|
|
979
|
+
# @overload >>(other)
|
|
980
|
+
# Returns each element of `self` shifted right by the matching
|
|
981
|
+
# number of bits in `other`. Otherwise as {#<<}.
|
|
982
|
+
# @param other [CArray, Integer] shift counts.
|
|
983
|
+
# @return [CArray] the promoted integer `data_type`.
|
|
984
|
+
# @raise [CArray::DataTypeError] for a float or complex array.
|
|
985
|
+
def >>(other); end
|
|
986
|
+
|
|
987
|
+
# @overload bit_rshift(other)
|
|
988
|
+
# Alias of {#>>}.
|
|
989
|
+
# @param other [CArray, Integer] shift counts.
|
|
990
|
+
# @return [CArray]
|
|
991
|
+
def bit_rshift(other); end
|
|
992
|
+
|
|
993
|
+
# @overload bit_neg
|
|
994
|
+
# Returns the element-wise complement: a bitwise `NOT` on integer
|
|
995
|
+
# arrays, a logical negation on boolean ones. Aliased as `~`.
|
|
996
|
+
# @return [CArray] same `data_type` as `self`.
|
|
997
|
+
# @raise [CArray::DataTypeError] for a float or complex array.
|
|
998
|
+
def bit_neg; end
|
|
999
|
+
|
|
1000
|
+
# @overload not
|
|
1001
|
+
# Returns the element-wise logical negation of a boolean array.
|
|
1002
|
+
# Masked elements stay masked -- the negation of an unknown is
|
|
1003
|
+
# still unknown.
|
|
1004
|
+
# @return [CArray] `:boolean`.
|
|
1005
|
+
# @raise [CArray::DataTypeError] for any `data_type` other than
|
|
1006
|
+
# `:boolean` or `:object`.
|
|
1007
|
+
def not; end
|
|
1008
|
+
|
|
1009
|
+
# @overload and(other)
|
|
1010
|
+
# Returns the two-valued logical `AND` of two boolean arrays.
|
|
1011
|
+
#
|
|
1012
|
+
# Where {#&} applies Kleene logic, this form propagates the mask
|
|
1013
|
+
# unconditionally: if either element is masked the result is
|
|
1014
|
+
# masked, even when the unmasked element alone would settle the
|
|
1015
|
+
# answer. Use it when an unknown operand should make the result
|
|
1016
|
+
# unknown regardless.
|
|
1017
|
+
# @param other [CArray, true, false] the other operand, broadcast
|
|
1018
|
+
# to `self.shape`.
|
|
1019
|
+
# @return [CArray] `:boolean`.
|
|
1020
|
+
# @raise [CArray::DataTypeError] for any `data_type` other than
|
|
1021
|
+
# `:boolean` or `:object`.
|
|
1022
|
+
def and(other); end
|
|
1023
|
+
|
|
1024
|
+
# @overload or(other)
|
|
1025
|
+
# Returns the two-valued logical `OR` of two boolean arrays,
|
|
1026
|
+
# propagating the mask unconditionally as {#and} does.
|
|
1027
|
+
# @param other [CArray, true, false] the other operand.
|
|
1028
|
+
# @return [CArray] `:boolean`.
|
|
1029
|
+
# @raise [CArray::DataTypeError] for any `data_type` other than
|
|
1030
|
+
# `:boolean` or `:object`.
|
|
1031
|
+
def or(other); end
|
|
1032
|
+
|
|
1033
|
+
# @overload xor(other)
|
|
1034
|
+
# Returns the logical exclusive `OR` of two boolean arrays,
|
|
1035
|
+
# propagating the mask as {#and} does.
|
|
1036
|
+
# @param other [CArray, true, false] the other operand.
|
|
1037
|
+
# @return [CArray] `:boolean`.
|
|
1038
|
+
# @raise [CArray::DataTypeError] for any `data_type` other than
|
|
1039
|
+
# `:boolean` or `:object`.
|
|
1040
|
+
def xor(other); end
|
|
1041
|
+
|
|
1042
|
+
# @overload abs!
|
|
1043
|
+
# Applies {#abs} to `self` in place, keeping `self`'s
|
|
1044
|
+
# `data_type`.
|
|
1045
|
+
# @return [self]
|
|
1046
|
+
# @raise [RuntimeError] for a boolean array.
|
|
1047
|
+
def abs!; end
|
|
1048
|
+
|
|
1049
|
+
# @overload abs_i!
|
|
1050
|
+
# Applies {#abs_i} to `self` in place, keeping `self`'s
|
|
1051
|
+
# `data_type`.
|
|
1052
|
+
# @return [self]
|
|
1053
|
+
# @raise [CArray::DataTypeError] for a boolean array.
|
|
1054
|
+
def abs_i!; end
|
|
1055
|
+
|
|
1056
|
+
# @overload acos!
|
|
1057
|
+
# Applies {#acos} to `self` in place, keeping `self`'s
|
|
1058
|
+
# `data_type`.
|
|
1059
|
+
# @return [self]
|
|
1060
|
+
# @raise [CArray::DataTypeError] for an integer or boolean array,
|
|
1061
|
+
# whose `data_type` cannot hold the widened result -- {#acos} promotes
|
|
1062
|
+
# it instead of raising.
|
|
1063
|
+
def acos!; end
|
|
1064
|
+
|
|
1065
|
+
# @overload acosh!
|
|
1066
|
+
# Applies {#acosh} to `self` in place, keeping `self`'s
|
|
1067
|
+
# `data_type`.
|
|
1068
|
+
# @return [self]
|
|
1069
|
+
# @raise [CArray::DataTypeError] for an integer or boolean array,
|
|
1070
|
+
# whose `data_type` cannot hold the widened result -- {#acosh}
|
|
1071
|
+
# promotes it instead of raising.
|
|
1072
|
+
def acosh!; end
|
|
1073
|
+
|
|
1074
|
+
# @overload add!(other)
|
|
1075
|
+
# Applies {#add} to `self` in place, keeping `self`'s
|
|
1076
|
+
# `data_type`.
|
|
1077
|
+
# @param other [CArray, Numeric] the other operand, broadcast to
|
|
1078
|
+
# `self.shape`.
|
|
1079
|
+
# @return [self]
|
|
1080
|
+
# @raise [CArray::DataTypeError] for a boolean array.
|
|
1081
|
+
def add!(other); end
|
|
1082
|
+
|
|
1083
|
+
# @overload and!(other)
|
|
1084
|
+
# Applies {#and} to `self` in place, keeping `self`'s
|
|
1085
|
+
# `data_type`.
|
|
1086
|
+
# @param other [CArray, true, false] the other operand, broadcast
|
|
1087
|
+
# to `self.shape`.
|
|
1088
|
+
# @return [self]
|
|
1089
|
+
# @raise [CArray::DataTypeError] for an integer or float array.
|
|
1090
|
+
def and!(other); end
|
|
1091
|
+
|
|
1092
|
+
# @overload arg!
|
|
1093
|
+
# Applies {#arg} to `self` in place, keeping `self`'s
|
|
1094
|
+
# `data_type`.
|
|
1095
|
+
# @return [self]
|
|
1096
|
+
# @raise [RuntimeError] for an integer or boolean array, whose
|
|
1097
|
+
# `data_type` cannot hold the widened result -- {#arg} promotes it
|
|
1098
|
+
# instead of raising.
|
|
1099
|
+
def arg!; end
|
|
1100
|
+
|
|
1101
|
+
# @overload asin!
|
|
1102
|
+
# Applies {#asin} to `self` in place, keeping `self`'s
|
|
1103
|
+
# `data_type`.
|
|
1104
|
+
# @return [self]
|
|
1105
|
+
# @raise [CArray::DataTypeError] for an integer or boolean array,
|
|
1106
|
+
# whose `data_type` cannot hold the widened result -- {#asin} promotes
|
|
1107
|
+
# it instead of raising.
|
|
1108
|
+
def asin!; end
|
|
1109
|
+
|
|
1110
|
+
# @overload asinh!
|
|
1111
|
+
# Applies {#asinh} to `self` in place, keeping `self`'s
|
|
1112
|
+
# `data_type`.
|
|
1113
|
+
# @return [self]
|
|
1114
|
+
# @raise [CArray::DataTypeError] for an integer or boolean array,
|
|
1115
|
+
# whose `data_type` cannot hold the widened result -- {#asinh}
|
|
1116
|
+
# promotes it instead of raising.
|
|
1117
|
+
def asinh!; end
|
|
1118
|
+
|
|
1119
|
+
# @overload atan!
|
|
1120
|
+
# Applies {#atan} to `self` in place, keeping `self`'s
|
|
1121
|
+
# `data_type`.
|
|
1122
|
+
# @return [self]
|
|
1123
|
+
# @raise [CArray::DataTypeError] for an integer or boolean array,
|
|
1124
|
+
# whose `data_type` cannot hold the widened result -- {#atan} promotes
|
|
1125
|
+
# it instead of raising.
|
|
1126
|
+
def atan!; end
|
|
1127
|
+
|
|
1128
|
+
# @overload atan2!(other)
|
|
1129
|
+
# Applies {#atan2} to `self` in place, keeping `self`'s
|
|
1130
|
+
# `data_type`.
|
|
1131
|
+
# @param other [CArray, Numeric] the other operand, broadcast to
|
|
1132
|
+
# `self.shape`.
|
|
1133
|
+
# @return [self]
|
|
1134
|
+
# @raise [CArray::DataTypeError] for an integer or boolean array,
|
|
1135
|
+
# whose `data_type` cannot hold the widened result -- {#atan2}
|
|
1136
|
+
# promotes it instead of raising.
|
|
1137
|
+
def atan2!(other); end
|
|
1138
|
+
|
|
1139
|
+
# @overload atanh!
|
|
1140
|
+
# Applies {#atanh} to `self` in place, keeping `self`'s
|
|
1141
|
+
# `data_type`.
|
|
1142
|
+
# @return [self]
|
|
1143
|
+
# @raise [CArray::DataTypeError] for an integer or boolean array,
|
|
1144
|
+
# whose `data_type` cannot hold the widened result -- {#atanh}
|
|
1145
|
+
# promotes it instead of raising.
|
|
1146
|
+
def atanh!; end
|
|
1147
|
+
|
|
1148
|
+
# @overload bit_lshift!(other)
|
|
1149
|
+
# Applies {#bit_lshift} to `self` in place, keeping `self`'s
|
|
1150
|
+
# `data_type`.
|
|
1151
|
+
# @param other [CArray, Numeric] the other operand, broadcast to
|
|
1152
|
+
# `self.shape`.
|
|
1153
|
+
# @return [self]
|
|
1154
|
+
# @raise [CArray::DataTypeError] for a float or boolean array.
|
|
1155
|
+
def bit_lshift!(other); end
|
|
1156
|
+
|
|
1157
|
+
# @overload bit_neg!
|
|
1158
|
+
# Applies {#bit_neg} to `self` in place, keeping `self`'s
|
|
1159
|
+
# `data_type`.
|
|
1160
|
+
# @return [self]
|
|
1161
|
+
# @raise [CArray::DataTypeError] for a float array.
|
|
1162
|
+
def bit_neg!; end
|
|
1163
|
+
|
|
1164
|
+
# @overload bit_rshift!(other)
|
|
1165
|
+
# Applies {#bit_rshift} to `self` in place, keeping `self`'s
|
|
1166
|
+
# `data_type`.
|
|
1167
|
+
# @param other [CArray, Numeric] the other operand, broadcast to
|
|
1168
|
+
# `self.shape`.
|
|
1169
|
+
# @return [self]
|
|
1170
|
+
# @raise [CArray::DataTypeError] for a float or boolean array.
|
|
1171
|
+
def bit_rshift!(other); end
|
|
1172
|
+
|
|
1173
|
+
# @overload ceil!
|
|
1174
|
+
# Applies {#ceil} to `self` in place, keeping `self`'s
|
|
1175
|
+
# `data_type`.
|
|
1176
|
+
# @return [self]
|
|
1177
|
+
# @raise [CArray::DataTypeError] for a boolean array.
|
|
1178
|
+
def ceil!; end
|
|
1179
|
+
|
|
1180
|
+
# @overload conj!
|
|
1181
|
+
# Applies {#conj} to `self` in place, keeping `self`'s
|
|
1182
|
+
# `data_type`.
|
|
1183
|
+
# @return [self]
|
|
1184
|
+
# @raise [CArray::DataTypeError] for a boolean array.
|
|
1185
|
+
def conj!; end
|
|
1186
|
+
|
|
1187
|
+
# @overload copysign!(other)
|
|
1188
|
+
# Applies {#copysign} to `self` in place, keeping `self`'s
|
|
1189
|
+
# `data_type`.
|
|
1190
|
+
# @param other [CArray, Numeric] the other operand, broadcast to
|
|
1191
|
+
# `self.shape`.
|
|
1192
|
+
# @return [self]
|
|
1193
|
+
# @raise [CArray::DataTypeError] for an integer or boolean array,
|
|
1194
|
+
# whose `data_type` cannot hold the widened result -- {#copysign}
|
|
1195
|
+
# promotes it instead of raising.
|
|
1196
|
+
def copysign!(other); end
|
|
1197
|
+
|
|
1198
|
+
# @overload cos!
|
|
1199
|
+
# Applies {#cos} to `self` in place, keeping `self`'s
|
|
1200
|
+
# `data_type`.
|
|
1201
|
+
# @return [self]
|
|
1202
|
+
# @raise [CArray::DataTypeError] for an integer or boolean array,
|
|
1203
|
+
# whose `data_type` cannot hold the widened result -- {#cos} promotes
|
|
1204
|
+
# it instead of raising.
|
|
1205
|
+
def cos!; end
|
|
1206
|
+
|
|
1207
|
+
# @overload cosh!
|
|
1208
|
+
# Applies {#cosh} to `self` in place, keeping `self`'s
|
|
1209
|
+
# `data_type`.
|
|
1210
|
+
# @return [self]
|
|
1211
|
+
# @raise [CArray::DataTypeError] for an integer or boolean array,
|
|
1212
|
+
# whose `data_type` cannot hold the widened result -- {#cosh} promotes
|
|
1213
|
+
# it instead of raising.
|
|
1214
|
+
def cosh!; end
|
|
1215
|
+
|
|
1216
|
+
# @overload deg!
|
|
1217
|
+
# Applies {#deg} to `self` in place, keeping `self`'s
|
|
1218
|
+
# `data_type`.
|
|
1219
|
+
# @return [self]
|
|
1220
|
+
# @raise [CArray::DataTypeError] for an integer or boolean array,
|
|
1221
|
+
# whose `data_type` cannot hold the widened result -- {#deg} promotes
|
|
1222
|
+
# it instead of raising.
|
|
1223
|
+
def deg!; end
|
|
1224
|
+
|
|
1225
|
+
# @overload deg_180!
|
|
1226
|
+
# Applies {#deg_180} to `self` in place, keeping `self`'s
|
|
1227
|
+
# `data_type`.
|
|
1228
|
+
# @return [self]
|
|
1229
|
+
# @raise [CArray::DataTypeError] for an integer or boolean array,
|
|
1230
|
+
# whose `data_type` cannot hold the widened result -- {#deg_180}
|
|
1231
|
+
# promotes it instead of raising.
|
|
1232
|
+
def deg_180!; end
|
|
1233
|
+
|
|
1234
|
+
# @overload deg_360!
|
|
1235
|
+
# Applies {#deg_360} to `self` in place, keeping `self`'s
|
|
1236
|
+
# `data_type`.
|
|
1237
|
+
# @return [self]
|
|
1238
|
+
# @raise [CArray::DataTypeError] for an integer or boolean array,
|
|
1239
|
+
# whose `data_type` cannot hold the widened result -- {#deg_360}
|
|
1240
|
+
# promotes it instead of raising.
|
|
1241
|
+
def deg_360!; end
|
|
1242
|
+
|
|
1243
|
+
# @overload exp!
|
|
1244
|
+
# Applies {#exp} to `self` in place, keeping `self`'s
|
|
1245
|
+
# `data_type`.
|
|
1246
|
+
# @return [self]
|
|
1247
|
+
# @raise [CArray::DataTypeError] for an integer or boolean array,
|
|
1248
|
+
# whose `data_type` cannot hold the widened result -- {#exp} promotes
|
|
1249
|
+
# it instead of raising.
|
|
1250
|
+
def exp!; end
|
|
1251
|
+
|
|
1252
|
+
# @overload exp10!
|
|
1253
|
+
# Applies {#exp10} to `self` in place, keeping `self`'s
|
|
1254
|
+
# `data_type`.
|
|
1255
|
+
# @return [self]
|
|
1256
|
+
# @raise [CArray::DataTypeError] for an integer or boolean array,
|
|
1257
|
+
# whose `data_type` cannot hold the widened result -- {#exp10}
|
|
1258
|
+
# promotes it instead of raising.
|
|
1259
|
+
def exp10!; end
|
|
1260
|
+
|
|
1261
|
+
# @overload exp2!
|
|
1262
|
+
# Applies {#exp2} to `self` in place, keeping `self`'s
|
|
1263
|
+
# `data_type`.
|
|
1264
|
+
# @return [self]
|
|
1265
|
+
# @raise [CArray::DataTypeError] for an integer or boolean array,
|
|
1266
|
+
# whose `data_type` cannot hold the widened result -- {#exp2} promotes
|
|
1267
|
+
# it instead of raising.
|
|
1268
|
+
def exp2!; end
|
|
1269
|
+
|
|
1270
|
+
# @overload expm1!
|
|
1271
|
+
# Applies {#expm1} to `self` in place, keeping `self`'s
|
|
1272
|
+
# `data_type`.
|
|
1273
|
+
# @return [self]
|
|
1274
|
+
# @raise [CArray::DataTypeError] for an integer or boolean array,
|
|
1275
|
+
# whose `data_type` cannot hold the widened result -- {#expm1}
|
|
1276
|
+
# promotes it instead of raising.
|
|
1277
|
+
def expm1!; end
|
|
1278
|
+
|
|
1279
|
+
# @overload floor!
|
|
1280
|
+
# Applies {#floor} to `self` in place, keeping `self`'s
|
|
1281
|
+
# `data_type`.
|
|
1282
|
+
# @return [self]
|
|
1283
|
+
# @raise [CArray::DataTypeError] for a boolean array.
|
|
1284
|
+
def floor!; end
|
|
1285
|
+
|
|
1286
|
+
# @overload fma!(a, b)
|
|
1287
|
+
# Applies {#fma} to `self` in place, keeping `self`'s
|
|
1288
|
+
# `data_type`.
|
|
1289
|
+
# @param a [CArray, Numeric] first operand, broadcast to `self.shape`.
|
|
1290
|
+
# @param b [CArray, Numeric] second operand, broadcast to `self.shape`.
|
|
1291
|
+
# @return [self]
|
|
1292
|
+
# @raise [CArray::DataTypeError] for a boolean array.
|
|
1293
|
+
def fma!(a, b); end
|
|
1294
|
+
|
|
1295
|
+
# @overload fms!(a, b)
|
|
1296
|
+
# Applies {#fms} to `self` in place, keeping `self`'s
|
|
1297
|
+
# `data_type`.
|
|
1298
|
+
# @param a [CArray, Numeric] first operand, broadcast to `self.shape`.
|
|
1299
|
+
# @param b [CArray, Numeric] second operand, broadcast to `self.shape`.
|
|
1300
|
+
# @return [self]
|
|
1301
|
+
# @raise [CArray::DataTypeError] for a boolean array.
|
|
1302
|
+
def fms!(a, b); end
|
|
1303
|
+
|
|
1304
|
+
# @overload hypot!(other)
|
|
1305
|
+
# Applies {#hypot} to `self` in place, keeping `self`'s
|
|
1306
|
+
# `data_type`.
|
|
1307
|
+
# @param other [CArray, Numeric] the other operand, broadcast to
|
|
1308
|
+
# `self.shape`.
|
|
1309
|
+
# @return [self]
|
|
1310
|
+
# @raise [CArray::DataTypeError] for an integer or boolean array,
|
|
1311
|
+
# whose `data_type` cannot hold the widened result -- {#hypot}
|
|
1312
|
+
# promotes it instead of raising.
|
|
1313
|
+
def hypot!(other); end
|
|
1314
|
+
|
|
1315
|
+
# @overload imag_i!
|
|
1316
|
+
# Applies {#imag_i} to `self` in place, keeping `self`'s
|
|
1317
|
+
# `data_type`.
|
|
1318
|
+
# @return [self]
|
|
1319
|
+
# @raise [CArray::DataTypeError] for a boolean array.
|
|
1320
|
+
def imag_i!; end
|
|
1321
|
+
|
|
1322
|
+
# @overload log!
|
|
1323
|
+
# Applies {#log} to `self` in place, keeping `self`'s
|
|
1324
|
+
# `data_type`.
|
|
1325
|
+
# @return [self]
|
|
1326
|
+
# @raise [CArray::DataTypeError] for an integer or boolean array,
|
|
1327
|
+
# whose `data_type` cannot hold the widened result -- {#log} promotes
|
|
1328
|
+
# it instead of raising.
|
|
1329
|
+
def log!; end
|
|
1330
|
+
|
|
1331
|
+
# @overload log10!
|
|
1332
|
+
# Applies {#log10} to `self` in place, keeping `self`'s
|
|
1333
|
+
# `data_type`.
|
|
1334
|
+
# @return [self]
|
|
1335
|
+
# @raise [CArray::DataTypeError] for an integer or boolean array,
|
|
1336
|
+
# whose `data_type` cannot hold the widened result -- {#log10}
|
|
1337
|
+
# promotes it instead of raising.
|
|
1338
|
+
def log10!; end
|
|
1339
|
+
|
|
1340
|
+
# @overload log1p!
|
|
1341
|
+
# Applies {#log1p} to `self` in place, keeping `self`'s
|
|
1342
|
+
# `data_type`.
|
|
1343
|
+
# @return [self]
|
|
1344
|
+
# @raise [CArray::DataTypeError] for an integer or boolean array,
|
|
1345
|
+
# whose `data_type` cannot hold the widened result -- {#log1p}
|
|
1346
|
+
# promotes it instead of raising.
|
|
1347
|
+
def log1p!; end
|
|
1348
|
+
|
|
1349
|
+
# @overload log2!
|
|
1350
|
+
# Applies {#log2} to `self` in place, keeping `self`'s
|
|
1351
|
+
# `data_type`.
|
|
1352
|
+
# @return [self]
|
|
1353
|
+
# @raise [CArray::DataTypeError] for an integer or boolean array,
|
|
1354
|
+
# whose `data_type` cannot hold the widened result -- {#log2} promotes
|
|
1355
|
+
# it instead of raising.
|
|
1356
|
+
def log2!; end
|
|
1357
|
+
|
|
1358
|
+
# @overload logaddexp!(other)
|
|
1359
|
+
# Applies {#logaddexp} to `self` in place, keeping `self`'s
|
|
1360
|
+
# `data_type`.
|
|
1361
|
+
# @param other [CArray, Numeric] the other operand, broadcast to
|
|
1362
|
+
# `self.shape`.
|
|
1363
|
+
# @return [self]
|
|
1364
|
+
# @raise [CArray::DataTypeError] for an integer or boolean array,
|
|
1365
|
+
# whose `data_type` cannot hold the widened result -- {#logaddexp}
|
|
1366
|
+
# promotes it instead of raising.
|
|
1367
|
+
def logaddexp!(other); end
|
|
1368
|
+
|
|
1369
|
+
# @overload logb!
|
|
1370
|
+
# Applies {#logb} to `self` in place, keeping `self`'s
|
|
1371
|
+
# `data_type`.
|
|
1372
|
+
# @return [self]
|
|
1373
|
+
# @raise [CArray::DataTypeError] for an integer or boolean array,
|
|
1374
|
+
# whose `data_type` cannot hold the widened result -- {#logb} promotes
|
|
1375
|
+
# it instead of raising.
|
|
1376
|
+
def logb!; end
|
|
1377
|
+
|
|
1378
|
+
# @overload maximum!(other)
|
|
1379
|
+
# Applies {#maximum} to `self` in place, keeping `self`'s
|
|
1380
|
+
# `data_type`.
|
|
1381
|
+
# @param other [CArray, Numeric] the other operand, broadcast to
|
|
1382
|
+
# `self.shape`.
|
|
1383
|
+
# @return [self]
|
|
1384
|
+
# @raise [CArray::DataTypeError] for a boolean array.
|
|
1385
|
+
def maximum!(other); end
|
|
1386
|
+
|
|
1387
|
+
# @overload minimum!(other)
|
|
1388
|
+
# Applies {#minimum} to `self` in place, keeping `self`'s
|
|
1389
|
+
# `data_type`.
|
|
1390
|
+
# @param other [CArray, Numeric] the other operand, broadcast to
|
|
1391
|
+
# `self.shape`.
|
|
1392
|
+
# @return [self]
|
|
1393
|
+
# @raise [CArray::DataTypeError] for a boolean array.
|
|
1394
|
+
def minimum!(other); end
|
|
1395
|
+
|
|
1396
|
+
# @overload mul!(other)
|
|
1397
|
+
# Applies {#mul} to `self` in place, keeping `self`'s
|
|
1398
|
+
# `data_type`.
|
|
1399
|
+
# @param other [CArray, Numeric] the other operand, broadcast to
|
|
1400
|
+
# `self.shape`.
|
|
1401
|
+
# @return [self]
|
|
1402
|
+
# @raise [CArray::DataTypeError] for a boolean array.
|
|
1403
|
+
def mul!(other); end
|
|
1404
|
+
|
|
1405
|
+
# @overload neg!
|
|
1406
|
+
# Applies {#neg} to `self` in place, keeping `self`'s
|
|
1407
|
+
# `data_type`.
|
|
1408
|
+
# @return [self]
|
|
1409
|
+
# @raise [CArray::DataTypeError] for a boolean array.
|
|
1410
|
+
def neg!; end
|
|
1411
|
+
|
|
1412
|
+
# @overload nextafter!(other)
|
|
1413
|
+
# Applies {#nextafter} to `self` in place, keeping `self`'s
|
|
1414
|
+
# `data_type`.
|
|
1415
|
+
# @param other [CArray, Numeric] the other operand, broadcast to
|
|
1416
|
+
# `self.shape`.
|
|
1417
|
+
# @return [self]
|
|
1418
|
+
# @raise [CArray::DataTypeError] for an integer or boolean array,
|
|
1419
|
+
# whose `data_type` cannot hold the widened result -- {#nextafter}
|
|
1420
|
+
# promotes it instead of raising.
|
|
1421
|
+
def nextafter!(other); end
|
|
1422
|
+
|
|
1423
|
+
# @overload not!
|
|
1424
|
+
# Applies {#not} to `self` in place, keeping `self`'s
|
|
1425
|
+
# `data_type`.
|
|
1426
|
+
# @return [self]
|
|
1427
|
+
# @raise [CArray::DataTypeError] for an integer or float array.
|
|
1428
|
+
def not!; end
|
|
1429
|
+
|
|
1430
|
+
# @overload one!
|
|
1431
|
+
# Applies {#one} to `self` in place, keeping `self`'s
|
|
1432
|
+
# `data_type`.
|
|
1433
|
+
# @return [self]
|
|
1434
|
+
def one!; end
|
|
1435
|
+
|
|
1436
|
+
# @overload or!(other)
|
|
1437
|
+
# Applies {#or} to `self` in place, keeping `self`'s
|
|
1438
|
+
# `data_type`.
|
|
1439
|
+
# @param other [CArray, true, false] the other operand, broadcast
|
|
1440
|
+
# to `self.shape`.
|
|
1441
|
+
# @return [self]
|
|
1442
|
+
# @raise [CArray::DataTypeError] for an integer or float array.
|
|
1443
|
+
def or!(other); end
|
|
1444
|
+
|
|
1445
|
+
# @overload pmax!(other)
|
|
1446
|
+
# Applies {#pmax} to `self` in place, keeping `self`'s
|
|
1447
|
+
# `data_type`.
|
|
1448
|
+
# @param other [CArray, Numeric] the other operand, broadcast to
|
|
1449
|
+
# `self.shape`.
|
|
1450
|
+
# @return [self]
|
|
1451
|
+
# @raise [CArray::DataTypeError] for a boolean array.
|
|
1452
|
+
def pmax!(other); end
|
|
1453
|
+
|
|
1454
|
+
# @overload pmin!(other)
|
|
1455
|
+
# Applies {#pmin} to `self` in place, keeping `self`'s
|
|
1456
|
+
# `data_type`.
|
|
1457
|
+
# @param other [CArray, Numeric] the other operand, broadcast to
|
|
1458
|
+
# `self.shape`.
|
|
1459
|
+
# @return [self]
|
|
1460
|
+
# @raise [CArray::DataTypeError] for a boolean array.
|
|
1461
|
+
def pmin!(other); end
|
|
1462
|
+
|
|
1463
|
+
# @overload power!(other)
|
|
1464
|
+
# Applies {#power} to `self` in place, keeping `self`'s
|
|
1465
|
+
# `data_type`.
|
|
1466
|
+
# @param other [CArray, Numeric] the other operand, broadcast to
|
|
1467
|
+
# `self.shape`.
|
|
1468
|
+
# @return [self]
|
|
1469
|
+
# @raise [CArray::DataTypeError] for a boolean array.
|
|
1470
|
+
def power!(other); end
|
|
1471
|
+
|
|
1472
|
+
# @overload rad!
|
|
1473
|
+
# Applies {#rad} to `self` in place, keeping `self`'s
|
|
1474
|
+
# `data_type`.
|
|
1475
|
+
# @return [self]
|
|
1476
|
+
# @raise [CArray::DataTypeError] for an integer or boolean array,
|
|
1477
|
+
# whose `data_type` cannot hold the widened result -- {#rad} promotes
|
|
1478
|
+
# it instead of raising.
|
|
1479
|
+
def rad!; end
|
|
1480
|
+
|
|
1481
|
+
# @overload rad_2pi!
|
|
1482
|
+
# Applies {#rad_2pi} to `self` in place, keeping `self`'s
|
|
1483
|
+
# `data_type`.
|
|
1484
|
+
# @return [self]
|
|
1485
|
+
# @raise [CArray::DataTypeError] for an integer or boolean array,
|
|
1486
|
+
# whose `data_type` cannot hold the widened result -- {#rad_2pi}
|
|
1487
|
+
# promotes it instead of raising.
|
|
1488
|
+
def rad_2pi!; end
|
|
1489
|
+
|
|
1490
|
+
# @overload rad_pi!
|
|
1491
|
+
# Applies {#rad_pi} to `self` in place, keeping `self`'s
|
|
1492
|
+
# `data_type`.
|
|
1493
|
+
# @return [self]
|
|
1494
|
+
# @raise [CArray::DataTypeError] for an integer or boolean array,
|
|
1495
|
+
# whose `data_type` cannot hold the widened result -- {#rad_pi}
|
|
1496
|
+
# promotes it instead of raising.
|
|
1497
|
+
def rad_pi!; end
|
|
1498
|
+
|
|
1499
|
+
# @overload rcp!
|
|
1500
|
+
# Applies {#rcp} to `self` in place, keeping `self`'s
|
|
1501
|
+
# `data_type`.
|
|
1502
|
+
# @return [self]
|
|
1503
|
+
# @raise [CArray::DataTypeError] for a boolean array.
|
|
1504
|
+
def rcp!; end
|
|
1505
|
+
|
|
1506
|
+
# @overload rcp_mul!(other)
|
|
1507
|
+
# Applies {#rcp_mul} to `self` in place, keeping `self`'s
|
|
1508
|
+
# `data_type`.
|
|
1509
|
+
# @param other [CArray, Numeric] the other operand, broadcast to
|
|
1510
|
+
# `self.shape`.
|
|
1511
|
+
# @return [self]
|
|
1512
|
+
# @raise [CArray::DataTypeError] for a boolean array.
|
|
1513
|
+
def rcp_mul!(other); end
|
|
1514
|
+
|
|
1515
|
+
# @overload rsqrt!
|
|
1516
|
+
# Applies {#rsqrt} to `self` in place, keeping `self`'s
|
|
1517
|
+
# `data_type`.
|
|
1518
|
+
# @return [self]
|
|
1519
|
+
# @raise [CArray::DataTypeError] for an integer or boolean array,
|
|
1520
|
+
# whose `data_type` cannot hold the widened result -- {#rsqrt}
|
|
1521
|
+
# promotes it instead of raising.
|
|
1522
|
+
def rsqrt!; end
|
|
1523
|
+
|
|
1524
|
+
# @overload sign!
|
|
1525
|
+
# Applies {#sign} to `self` in place, keeping `self`'s
|
|
1526
|
+
# `data_type`.
|
|
1527
|
+
# @return [self]
|
|
1528
|
+
def sign!; end
|
|
1529
|
+
|
|
1530
|
+
# @overload sin!
|
|
1531
|
+
# Applies {#sin} to `self` in place, keeping `self`'s
|
|
1532
|
+
# `data_type`.
|
|
1533
|
+
# @return [self]
|
|
1534
|
+
# @raise [CArray::DataTypeError] for an integer or boolean array,
|
|
1535
|
+
# whose `data_type` cannot hold the widened result -- {#sin} promotes
|
|
1536
|
+
# it instead of raising.
|
|
1537
|
+
def sin!; end
|
|
1538
|
+
|
|
1539
|
+
# @overload sinh!
|
|
1540
|
+
# Applies {#sinh} to `self` in place, keeping `self`'s
|
|
1541
|
+
# `data_type`.
|
|
1542
|
+
# @return [self]
|
|
1543
|
+
# @raise [CArray::DataTypeError] for an integer or boolean array,
|
|
1544
|
+
# whose `data_type` cannot hold the widened result -- {#sinh} promotes
|
|
1545
|
+
# it instead of raising.
|
|
1546
|
+
def sinh!; end
|
|
1547
|
+
|
|
1548
|
+
# @overload sqrt!
|
|
1549
|
+
# Applies {#sqrt} to `self` in place, keeping `self`'s
|
|
1550
|
+
# `data_type`.
|
|
1551
|
+
# @return [self]
|
|
1552
|
+
# @raise [CArray::DataTypeError] for an integer or boolean array,
|
|
1553
|
+
# whose `data_type` cannot hold the widened result -- {#sqrt} promotes
|
|
1554
|
+
# it instead of raising.
|
|
1555
|
+
def sqrt!; end
|
|
1556
|
+
|
|
1557
|
+
# @overload square!
|
|
1558
|
+
# Applies {#square} to `self` in place, keeping `self`'s
|
|
1559
|
+
# `data_type`.
|
|
1560
|
+
# @return [self]
|
|
1561
|
+
# @raise [CArray::DataTypeError] for a boolean array.
|
|
1562
|
+
def square!; end
|
|
1563
|
+
|
|
1564
|
+
# @overload sub!(other)
|
|
1565
|
+
# Applies {#sub} to `self` in place, keeping `self`'s
|
|
1566
|
+
# `data_type`.
|
|
1567
|
+
# @param other [CArray, Numeric] the other operand, broadcast to
|
|
1568
|
+
# `self.shape`.
|
|
1569
|
+
# @return [self]
|
|
1570
|
+
# @raise [CArray::DataTypeError] for a boolean array.
|
|
1571
|
+
def sub!(other); end
|
|
1572
|
+
|
|
1573
|
+
# @overload tan!
|
|
1574
|
+
# Applies {#tan} to `self` in place, keeping `self`'s
|
|
1575
|
+
# `data_type`.
|
|
1576
|
+
# @return [self]
|
|
1577
|
+
# @raise [CArray::DataTypeError] for an integer or boolean array,
|
|
1578
|
+
# whose `data_type` cannot hold the widened result -- {#tan} promotes
|
|
1579
|
+
# it instead of raising.
|
|
1580
|
+
def tan!; end
|
|
1581
|
+
|
|
1582
|
+
# @overload tanh!
|
|
1583
|
+
# Applies {#tanh} to `self` in place, keeping `self`'s
|
|
1584
|
+
# `data_type`.
|
|
1585
|
+
# @return [self]
|
|
1586
|
+
# @raise [CArray::DataTypeError] for an integer or boolean array,
|
|
1587
|
+
# whose `data_type` cannot hold the widened result -- {#tanh} promotes
|
|
1588
|
+
# it instead of raising.
|
|
1589
|
+
def tanh!; end
|
|
1590
|
+
|
|
1591
|
+
# @overload trunc!
|
|
1592
|
+
# Applies {#trunc} to `self` in place, keeping `self`'s
|
|
1593
|
+
# `data_type`.
|
|
1594
|
+
# @return [self]
|
|
1595
|
+
# @raise [CArray::DataTypeError] for a boolean array.
|
|
1596
|
+
def trunc!; end
|
|
1597
|
+
|
|
1598
|
+
# @overload xor!(other)
|
|
1599
|
+
# Applies {#xor} to `self` in place, keeping `self`'s
|
|
1600
|
+
# `data_type`.
|
|
1601
|
+
# @param other [CArray, true, false] the other operand, broadcast
|
|
1602
|
+
# to `self.shape`.
|
|
1603
|
+
# @return [self]
|
|
1604
|
+
# @raise [CArray::DataTypeError] for an integer or float array.
|
|
1605
|
+
def xor!(other); end
|
|
1606
|
+
|
|
1607
|
+
# @overload zero!
|
|
1608
|
+
# Applies {#zero} to `self` in place, keeping `self`'s
|
|
1609
|
+
# `data_type`.
|
|
1610
|
+
# @return [self]
|
|
1611
|
+
def zero!; end
|
|
1612
|
+
|
|
1613
|
+
|
|
131
1614
|
# @!endgroup
|
|
132
1615
|
end
|