Expand description

Provides a generic one-dimensional Array which wraps arrayfire::Array and supports all number_general::NumberType variants. Array and ArrayExt support basic math like Add, Sub, Mul, Div, and Rem, with hardware acceleration on systems which support CUDA or OpenCL. ArrayExt<bool> supports common logical operations and, not, or, and xor.

N-dimensional array functionality can be implemented using Coords and Offsets, which provide methods for indexing a one-dimensional Array or ArrayExt as an n-dimensional tensor.

Array supports (de)serialization without type hinting. ArrayExt<T> supports serialization for T: Serialize and deserialization for T: Deserialize.

Example usage:

let a = [1, 2, 3];
let b = [5];

let product = &Array::from(&a[..]) * &Array::from(&b[..]);
assert_eq!(product, Array::from_iter(vec![5, 10, 15]));
assert_eq!(product.sum(), Number::from(30))

This crate depends on ArrayFire version 3.8. You will have to install ArrayFire separately by following the instructions at https://arrayfire.org/docs/installing.htm in order to build this crate.

You can find detailed instructions for building the Rust arrayfire crate from crates.io at https://crates.io/crates/arrayfire.


Aggregate a [Stream] of numbers into a [Stream] of ArrayExts.

The error type used for Array which may fail recoverably.

A wrapper around af::Array which defines common operations.

A [Stream] of Coords, as constructed from an input stream of Coords.

Stream for merging two sorted CoordBlocks streams.

Return only the unique coordinates from a sorted stream of Coords.

A hardware-accelerated set of n-dimensional coordinates, all with the same dimension.

Struct for the ArrayTryStream::resize method.


A generic one-dimensional array which supports all variants of NumberType.


Defines common access methods for instance of ArrayExt.

Defines an absolute value method abs.

Defines cumulative boolean operations any and all.

Defines element-wise comparison operations.

Indexing operations for ArrayExt

Defines a general logarithm.

Defines common reduction operations min and max.

Defines the natural logarithm.

Defines an exponentiation method pow.

Defines common reduction operation product.

Defines a rounding method round.

Defines common reduction operation sum.

Methods to check for infinite or non-numeric array elements.

Trait to reduce the sum of a [Stream] of ArrayExts.

Trait to reduce the product of a [Stream] of ArrayExts.

Trait to reduce the sum of a [Stream] of ArrayExts.

Methods for handling a [Stream] of ArrayExts.

Convenience methods defining the base value of a reduce operation on an ArrayExt.

Trait defining the maximum of two numbers.

Trait defining the minimum of two numbers.

Trait defining the product of two numbers.

Trait defining the sum of two numbers.


Convert a coordinate to a linear offset.

The NumberType of the product of an Array with the given array_dtype.

Compute the maximum of each stride of a [Stream] of Arrays.

Compute the minimum of each stride of a [Stream] of Arrays.

Compute the product of each stride of a [Stream] of Arrays.

Compute the sum of each stride of a [Stream] of Arrays.

The NumberType of the sum of an Array with the given array_dtype.

Type Definitions

A complex number (an alias for num_complex::Complex.

An n-dimensional coordinate.

One-dimensional array indices corresponding to n-dimensional coordinates.

The result of an Array operation which may fail recoverably.