Vector algorithms (sum, min, sort, etc).
arrayfire.algorithm.
accum
(a, dim=0)[source]¶
Cumulative sum of an array along a specified dimension
Multi dimensional arrayfire array.
Dimension along which the cumulative sum is required.
array of same size as a containing the cumulative sum along dim.
arrayfire.algorithm.
allTrueByKey
(keys, vals, dim=- 1)[source]¶
Calculate if all elements are true along a specified dimension according to a key.
One dimensional arrayfire array with reduction keys.
Multi dimensional arrayfire array that will be reduced.
Dimension along which the all true check will occur.
The reduced keys of all true check in vals along dimension dim.
Booleans denoting if all elements are true in vals along dimension dim according to keys
arrayfire.algorithm.
all_true
(a, dim=None)[source]¶
Check if all the elements along a specified dimension are true.
Multi dimensional arrayfire array.
Dimension along which the product is required.
Af.array containing True if all elements in a along the dimension are True. If dim is None, output is True if a does not have any zeros, else False.
arrayfire.algorithm.
anyTrueByKey
(keys, vals, dim=- 1)[source]¶
Calculate if any elements are true along a specified dimension according to a key.
One dimensional arrayfire array with reduction keys.
Multi dimensional arrayfire array that will be reduced.
Dimension along which the any true check will occur.
The reduced keys of any true check in vals along dimension dim.
Booleans denoting if any elements are true in vals along dimension dim according to keys.
arrayfire.algorithm.
any_true
(a, dim=None)[source]¶
Check if any the elements along a specified dimension are true.
Multi dimensional arrayfire array.
Dimension along which the product is required.
Af.array containing True if any elements in a along the dimension are True. If dim is None, output is True if a does not have any zeros, else False.
arrayfire.algorithm.
count
(a, dim=None)[source]¶
Count the number of non zero elements in an array along a specified dimension.
Multi dimensional arrayfire array.
Dimension along which the the non zero elements are to be counted.
The count of non zero elements in a along dim. If dim is None, the total number of non zero elements in a.
arrayfire.algorithm.
countByKey
(keys, vals, dim=- 1)[source]¶
Counts non-zero elements along a specified dimension according to a key.
One dimensional arrayfire array with reduction keys.
Multi dimensional arrayfire array that will be reduced.
Dimension along which to count elements.
The reduced keys of count in vals along dimension dim.
Count of non-zero elements in vals along dimension dim according to keys.
arrayfire.algorithm.
diff1
(a, dim=0)[source]¶
Find the first order differences along specified dimensions
Multi dimensional arrayfire array.
Dimension along which the differences are required.
Array whose length along dim is 1 less than that of a.
arrayfire.algorithm.
diff2
(a, dim=0)[source]¶
Find the second order differences along specified dimensions
Multi dimensional arrayfire array.
Dimension along which the differences are required.
Array whose length along dim is 2 less than that of a.
arrayfire.algorithm.
imax
(a, dim=None)[source]¶
Find the value and location of the maximum value along a specified dimension
Multi dimensional arrayfire array.
Dimension along which the maximum value is required.
val contains the maximum value of a along dim. idx contains the location of where val occurs in a along dim. If dim is None, val and idx value and location of global maximum.
arrayfire.algorithm.
imin
(a, dim=None)[source]¶
Find the value and location of the minimum value along a specified dimension
Multi dimensional arrayfire array.
Dimension along which the minimum value is required.
val contains the minimum value of a along dim. idx contains the location of where val occurs in a along dim. If dim is None, val and idx value and location of global minimum.
arrayfire.algorithm.
max
(a, dim=None)[source]¶
Find the maximum value of all the elements along a specified dimension.
Multi dimensional arrayfire array.
Dimension along which the maximum value is required.
The maximum value of all elements in a along dimension dim. If dim is None, maximum value of the entire Array is returned.
arrayfire.algorithm.
maxByKey
(keys, vals, dim=- 1)[source]¶
Calculate the max of elements along a specified dimension according to a key.
One dimensional arrayfire array with reduction keys.
Multi dimensional arrayfire array that will be reduced.
Dimension along which the max will occur.
The reduced keys of all elements in vals along dimension dim.
The max of all elements in vals along dimension dim according to keys.
arrayfire.algorithm.
min
(a, dim=None)[source]¶
Find the minimum value of all the elements along a specified dimension.
Multi dimensional arrayfire array.
Dimension along which the minimum value is required.
The minimum value of all elements in a along dimension dim. If dim is None, minimum value of the entire Array is returned.
arrayfire.algorithm.
minByKey
(keys, vals, dim=- 1)[source]¶
Calculate the min of elements along a specified dimension according to a key.
One dimensional arrayfire array with reduction keys.
Multi dimensional arrayfire array that will be reduced.
Dimension along which the min will occur.
The reduced keys of all elements in vals along dimension dim.
The min of all elements in vals along dimension dim according to keys
arrayfire.algorithm.
product
(a, dim=None, nan_val=None)[source]¶
Calculate the product of all the elements along a specified dimension.
Multi dimensional arrayfire array.
Dimension along which the product is required.
The value that replaces NaN in the array
The product of all elements in a along dimension dim. If dim is None, product of the entire Array is returned.
arrayfire.algorithm.
productByKey
(keys, vals, dim=- 1, nan_val=None)[source]¶
Calculate the product of elements along a specified dimension according to a key.
One dimensional arrayfire array with reduction keys.
Multi dimensional arrayfire array that will be reduced.
Dimension along which the product will occur.
The value that replaces NaN in the array
The reduced keys of all elements in vals along dimension dim.
The product of all elements in vals along dimension dim according to keys
arrayfire.algorithm.
scan
(a, dim=0, op=<BINARYOP.ADD: 0>, inclusive_scan=True)[source]¶
Generalized scan of an array.
Multi dimensional arrayfire array.
Dimension along which the scan is performed.
Binary option the scan algorithm uses. Can be one of: - af.BINARYOP.ADD - af.BINARYOP.MUL - af.BINARYOP.MIN - af.BINARYOP.MAX
Specifies if the scan is inclusive
will contain scan of input.
arrayfire.algorithm.
scan_by_key
(key, a, dim=0, op=<BINARYOP.ADD: 0>, inclusive_scan=True)[source]¶
Generalized scan by key of an array.
key array.
Multi dimensional arrayfire array.
Dimension along which the scan is performed.
Binary option the scan algorithm uses. Can be one of: - af.BINARYOP.ADD - af.BINARYOP.MUL - af.BINARYOP.MIN - af.BINARYOP.MAX
Specifies if the scan is inclusive
will contain scan of input.
arrayfire.algorithm.
set_intersect
(a, b, is_unique=False)[source]¶
Find the intersect of two arrays.
A 1D arrayfire array.
A 1D arrayfire array.
Specifies if the both inputs contain unique elements.
an array values after performing the intersect of a and b.
arrayfire.algorithm.
set_union
(a, b, is_unique=False)[source]¶
Find the union of two arrays.
A 1D arrayfire array.
A 1D arrayfire array.
Specifies if the both inputs contain unique elements.
an array values after performing the union of a and b.
arrayfire.algorithm.
set_unique
(a, is_sorted=False)[source]¶
Find the unique elements of an array.
A 1D arrayfire array.
Specifies if the input is pre-sorted.
an array containing the unique values from a
arrayfire.algorithm.
sort
(a, dim=0, is_ascending=True)[source]¶
Sort the array along a specified dimension
Multi dimensional arrayfire array.
Dimension along which sort is to be performed.
Specifies the direction of the sort
array containing the sorted values
arrayfire.algorithm.
sort_by_key
(ik, iv, dim=0, is_ascending=True)[source]¶
Sort an array based on specified keys
An Array containing the keys
An Array containing the values
Dimension along which sort is to be performed.
Specifies the direction of the sort
ok contains the values from ik in sorted order ov contains the values from iv after sorting them based on ik
arrayfire.algorithm.
sort_index
(a, dim=0, is_ascending=True)[source]¶
Sort the array along a specified dimension and get the indices.
Multi dimensional arrayfire array.
Dimension along which sort is to be performed.
Specifies the direction of the sort
val is an af.Array containing the sorted values. idx is an af.Array containing the original indices of val in a.
arrayfire.algorithm.
sum
(a, dim=None, nan_val=None)[source]¶
Calculate the sum of all the elements along a specified dimension.
Multi dimensional arrayfire array.
Dimension along which the sum is required.
The value that replaces NaN in the array
The sum of all elements in a along dimension dim. If dim is None, sum of the entire Array is returned.
arrayfire.algorithm.
sumByKey
(keys, vals, dim=- 1, nan_val=None)[source]¶
Calculate the sum of elements along a specified dimension according to a key.
One dimensional arrayfire array with reduction keys.
Multi dimensional arrayfire array that will be reduced.
Dimension along which the sum will occur.
The value that replaces NaN in the array
The reduced keys of all elements in vals along dimension dim.
The sum of all elements in vals along dimension dim according to keys
arrayfire.algorithm.
where
(a)[source]¶
Find the indices of non zero elements
Multi dimensional arrayfire array.
Linear indices for non zero elements.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4