Skip to main content

Array

Struct Array 

Source
pub struct Array<B: Backend, T: Element>(/* private fields */);
Expand description

An array of element type T on backend B, with a shape known at run time (and fixed within a traced program).

On Native it holds shared elements, so clone is cheap; on Trace it is a traced value.

Implementations§

Source§

impl<B: Backend, T: Element> Array<B, T>

Source

pub fn i(&self, index: impl IntoIndices<B>) -> Array<B, T>

The elements at index, like x[index] in JAX.

Run-time indices out of bounds are clamped (as in JAX); a static integer out of bounds panics.

Source

pub fn get(&self, index: impl IntoIndices<B>) -> Scalar<B, T>

The element at index, which must select a single element.

§Panics

Panics if the index selects more than one element.

Source

pub fn at(&self, index: impl IntoIndices<B>) -> At<'_, B, T>

Updates of the elements at index, like x.at[index] in JAX. The updates return new arrays; out-of-bounds updates are dropped.

Source

pub fn into_at(self, index: impl IntoIndices<B>) -> At<'static, B, T>

Array::at taking the array: an update of one element then writes in place when the array’s elements are not shared, instead of copying them (Native; the result is the same).

§Examples
use ruxla_core::{Native, jnp};

let grid = jnp::zeros::<Native, f32>([3, 3]).into_at((1i64, 2i64)).set(1.0f32);
assert_eq!(grid.get((1i64, 2i64)).value(), 1.0);
Source

pub fn at_mut(&mut self, index: impl IntoIndices<B>) -> AtMut<'_, B, T>

Updates of the elements at index that replace this array (like x = x.at[index].set(v) in JAX). Natively, an update of one element writes in place when the elements are not shared, without moving the array; traced, it records the same scatter as Array::at.

§Examples
use ruxla_core::{Native, jnp};

let mut grid = jnp::zeros::<Native, f32>([3, 3]);
grid.at_mut((1i64, 2i64)).set(1.0f32);
grid.at_mut((1i64, 2i64)).add(0.5f32);
assert_eq!(grid.get((1i64, 2i64)).value(), 1.5);
Source§

impl<B: Backend, T: Numeric> Array<B, T>

Source

pub fn dot(&self, other: &Array<B, T>) -> Array<B, T>

Matrix product (jnp.matmul).

Source

pub fn sum(&self, axes: impl Into<Axes>) -> Array<B, T>

Sums over axes (jnp.sum).

Source§

impl<B: Backend, T: ComplexFloat> Array<B, T>

Source

pub fn complex(re: &Array<B, T::Real>, im: &Array<B, T::Real>) -> Self

Complex numbers from their real and imaginary parts (lax.complex; the shapes must be equal).

Source

pub fn real(&self) -> Array<B, T::Real>

The real parts.

Source

pub fn imag(&self) -> Array<B, T::Real>

The imaginary parts.

Source

pub fn conj(&self) -> Self

The complex conjugates.

Source

pub fn angle(&self) -> Array<B, T::Real>

The arguments (atan2(imag, real), as jnp.angle).

Source§

impl<B: Backend, T: Numeric> Array<B, T>

Source

pub fn abs(&self) -> Array<B, T::Real>

|x| (signed integers wrap around; unsigned integers are returned unchanged; the magnitude of a complex number is real).

Source

pub fn sign(&self) -> Self

-1, 0, or 1 (x / |x| for complex numbers).

Source

pub fn square(&self) -> Self

x * x.

Source

pub fn integer_pow(&self, y: i32) -> Self

x^y for a static integer y (lax.integer_pow).

Source§

impl<B: Backend, T: Inexact> Array<B, T>

Source

pub fn exp(&self) -> Self

e^x.

Source

pub fn expm1(&self) -> Self

e^x - 1.

Source

pub fn ln(&self) -> Self

Natural logarithm (the principal value for complex numbers).

Source

pub fn ln_1p(&self) -> Self

log(1 + x).

Source

pub fn sqrt(&self) -> Self

Square root (the principal value for complex numbers).

Source

pub fn rsqrt(&self) -> Self

1 / sqrt(x).

Source

pub fn sin(&self) -> Self

Sine.

Source

pub fn cos(&self) -> Self

Cosine.

Source

pub fn tan(&self) -> Self

Tangent.

Source

pub fn tanh(&self) -> Self

Hyperbolic tangent.

Source

pub fn logistic(&self) -> Self

The logistic sigmoid.

Source§

impl<B: Backend, T: Float> Array<B, T>

Source

pub fn floor(&self) -> Self

Round toward negative infinity.

Source

pub fn ceil(&self) -> Self

Round toward positive infinity.

Source

pub fn round(&self) -> Self

Round to the nearest integer, halfway cases away from zero.

Source

pub fn round_even(&self) -> Self

Round to the nearest integer, halfway cases to even.

Source

pub fn cbrt(&self) -> Self

Cube root.

Source

pub fn erf_inv(&self) -> Self

The inverse error function.

Source

pub fn lgamma(&self) -> Self

The logarithm of the absolute value of the gamma function.

Source

pub fn digamma(&self) -> Self

The digamma function.

Source

pub fn erf(&self) -> Self

The error function.

Source

pub fn erfc(&self) -> Self

The complementary error function.

Source

pub fn is_finite(&self) -> Array<B, bool>

Whether each element is neither infinite nor NaN.

Source§

impl<B: Backend, T: Element> Array<B, T>

Source

pub fn from_vec(data: Vec<T>, shape: impl Into<Shape>) -> Self

A constant array from its elements in row-major order.

§Panics

Panics if the number of elements does not match the shape.

Source

pub fn from_slice(data: &[T], shape: impl Into<Shape>) -> Self

A constant array from a copy of its elements in row-major order (like Array::from_vec, without a Vec).

§Examples
use ruxla_core::{Array, I32, Native};

let table = Array::<Native, i32>::from_slice(&[1, 0, 3, 2], [4]);
assert_eq!(table.get(I32::new(2)).value(), 3);
§Panics

Panics if the number of elements does not match the shape.

Source

pub fn constant(x: &NativeArray<T>) -> Self

A constant array.

Source

pub fn from_repr(r: B::Array<T>) -> Self

Wraps a backend value.

Source

pub fn repr(&self) -> &B::Array<T>

Returns the backend value.

Source

pub fn shape(&self) -> Shape

Returns the shape.

Source

pub fn ndim(&self) -> usize

Returns the number of dimensions.

Source

pub fn size(&self) -> usize

Returns the number of elements.

Source

pub fn to_scalar(&self) -> Scalar<B, T>

The only element of an array of rank 0.

§Panics

Panics if the rank is not 0.

Source

pub fn cast<U: Element>(&self) -> Array<B, U>

Converts to another element type.

Source

pub fn reshape(&self, shape: impl Into<Shape>) -> Self

Changes the shape, keeping the elements in row-major order.

§Panics

Panics if the sizes differ.

Source

pub fn transpose(&self, perm: &[usize]) -> Self

Permutes the dimensions: dimension i of the result is dimension perm[i] of self.

Source

pub fn broadcast_to(&self, shape: impl Into<Shape>) -> Self

Broadcasts to shape with NumPy’s rules.

§Panics

Panics if the shapes are not compatible.

Source

pub fn reduce_sum(&self, axes: &[usize]) -> Self

Sums over axes (lax.reduce_sum; integers wrap around).

Source

pub fn reduce_max(&self, axes: &[usize]) -> Self

The maximum over axes, propagating NaN (lax.reduce_max).

Source

pub fn reduce_min(&self, axes: &[usize]) -> Self

The minimum over axes, propagating NaN (lax.reduce_min).

Source§

impl<T: Element> Array<Native, T>

Source

pub fn to_vec(&self) -> Vec<T>

Returns the elements in row-major order.

Source

pub fn native(&self) -> &NativeArray<T>

Returns the native array.

Source§

impl<B: Backend, T: Element> Array<B, T>

Source

pub fn eq(&self, other: impl ArrayLike<B, T>) -> Array<B, bool>

self == other, elementwise with broadcasting.

Source

pub fn ne(&self, other: impl ArrayLike<B, T>) -> Array<B, bool>

self != other.

Source

pub fn lt(&self, other: impl ArrayLike<B, T>) -> Array<B, bool>

self < other.

Source

pub fn le(&self, other: impl ArrayLike<B, T>) -> Array<B, bool>

self <= other.

Source

pub fn gt(&self, other: impl ArrayLike<B, T>) -> Array<B, bool>

self > other.

Source

pub fn ge(&self, other: impl ArrayLike<B, T>) -> Array<B, bool>

self >= other.

Trait Implementations§

Source§

impl<B: Backend, T: Numeric> Add<&Array<B, T>> for Scalar<B, T>

Source§

type Output = Array<B, T>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &Array<B, T>) -> Array<B, T>

Performs the + operation. Read more
Source§

impl<B: Backend> Add<Array<B, Complex<f32>>> for c64

Source§

type Output = Array<B, Complex<f32>>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Array<B, c64>) -> Array<B, c64>

Performs the + operation. Read more
Source§

impl<B: Backend> Add<Array<B, Complex<f64>>> for c128

Source§

type Output = Array<B, Complex<f64>>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Array<B, c128>) -> Array<B, c128>

Performs the + operation. Read more
Source§

impl<B: Backend, T: Numeric> Add<Array<B, T>> for Scalar<B, T>

Source§

type Output = Array<B, T>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Array<B, T>) -> Array<B, T>

Performs the + operation. Read more
Source§

impl<B: Backend> Add<Array<B, bf16>> for bf16

Source§

type Output = Array<B, bf16>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Array<B, bf16>) -> Array<B, bf16>

Performs the + operation. Read more
Source§

impl<B: Backend> Add<Array<B, f16>> for f16

Source§

type Output = Array<B, f16>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Array<B, f16>) -> Array<B, f16>

Performs the + operation. Read more
Source§

impl<B: Backend> Add<Array<B, f32>> for f32

Source§

type Output = Array<B, f32>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Array<B, f32>) -> Array<B, f32>

Performs the + operation. Read more
Source§

impl<B: Backend> Add<Array<B, f64>> for f64

Source§

type Output = Array<B, f64>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Array<B, f64>) -> Array<B, f64>

Performs the + operation. Read more
Source§

impl<B: Backend> Add<Array<B, i8>> for i8

Source§

type Output = Array<B, i8>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Array<B, i8>) -> Array<B, i8>

Performs the + operation. Read more
Source§

impl<B: Backend> Add<Array<B, i16>> for i16

Source§

type Output = Array<B, i16>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Array<B, i16>) -> Array<B, i16>

Performs the + operation. Read more
Source§

impl<B: Backend> Add<Array<B, i32>> for i32

Source§

type Output = Array<B, i32>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Array<B, i32>) -> Array<B, i32>

Performs the + operation. Read more
Source§

impl<B: Backend> Add<Array<B, i64>> for i64

Source§

type Output = Array<B, i64>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Array<B, i64>) -> Array<B, i64>

Performs the + operation. Read more
Source§

impl<B: Backend> Add<Array<B, u8>> for u8

Source§

type Output = Array<B, u8>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Array<B, u8>) -> Array<B, u8>

Performs the + operation. Read more
Source§

impl<B: Backend> Add<Array<B, u16>> for u16

Source§

type Output = Array<B, u16>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Array<B, u16>) -> Array<B, u16>

Performs the + operation. Read more
Source§

impl<B: Backend> Add<Array<B, u32>> for u32

Source§

type Output = Array<B, u32>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Array<B, u32>) -> Array<B, u32>

Performs the + operation. Read more
Source§

impl<B: Backend> Add<Array<B, u64>> for u64

Source§

type Output = Array<B, u64>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Array<B, u64>) -> Array<B, u64>

Performs the + operation. Read more
Source§

impl<B: Backend, T: Numeric, R: ArrayLike<B, T>> Add<R> for Array<B, T>

Source§

type Output = Array<B, T>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: R) -> Array<B, T>

Performs the + operation. Read more
Source§

impl<B: Backend, T: Numeric, R: ArrayLike<B, T>> Add<R> for &Array<B, T>

Source§

type Output = Array<B, T>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: R) -> Array<B, T>

Performs the + operation. Read more
Source§

impl<B: Backend, T: Element> ArrayLike<B, T> for Array<B, T>

Source§

fn into_array(self) -> Array<B, T>

Converts to an array.
Source§

fn with_array<R>(self, f: impl FnOnce(&Array<B, T>) -> R) -> R

Calls f with the array, without copying a borrowed array.
Source§

impl<B: Backend, T: Element> ArrayLike<B, T> for &Array<B, T>

Source§

fn into_array(self) -> Array<B, T>

Converts to an array.
Source§

fn with_array<R>(self, f: impl FnOnce(&Array<B, T>) -> R) -> R

Calls f with the array, without copying a borrowed array.
Source§

impl<B: Backend, T: Element> BitAnd<&Array<B, T>> for Scalar<B, T>

Source§

type Output = Array<B, T>

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: &Array<B, T>) -> Array<B, T>

Performs the & operation. Read more
Source§

impl<B: Backend, T: Element> BitAnd<Array<B, T>> for Scalar<B, T>

Source§

type Output = Array<B, T>

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: Array<B, T>) -> Array<B, T>

Performs the & operation. Read more
Source§

impl<B: Backend, T: Element, R: ArrayLike<B, T>> BitAnd<R> for Array<B, T>

Source§

type Output = Array<B, T>

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: R) -> Array<B, T>

Performs the & operation. Read more
Source§

impl<B: Backend, T: Element, R: ArrayLike<B, T>> BitAnd<R> for &Array<B, T>

Source§

type Output = Array<B, T>

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: R) -> Array<B, T>

Performs the & operation. Read more
Source§

impl<B: Backend, T: Element> BitOr<&Array<B, T>> for Scalar<B, T>

Source§

type Output = Array<B, T>

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: &Array<B, T>) -> Array<B, T>

Performs the | operation. Read more
Source§

impl<B: Backend, T: Element> BitOr<Array<B, T>> for Scalar<B, T>

Source§

type Output = Array<B, T>

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: Array<B, T>) -> Array<B, T>

Performs the | operation. Read more
Source§

impl<B: Backend, T: Element, R: ArrayLike<B, T>> BitOr<R> for Array<B, T>

Source§

type Output = Array<B, T>

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: R) -> Array<B, T>

Performs the | operation. Read more
Source§

impl<B: Backend, T: Element, R: ArrayLike<B, T>> BitOr<R> for &Array<B, T>

Source§

type Output = Array<B, T>

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: R) -> Array<B, T>

Performs the | operation. Read more
Source§

impl<B: Backend, T: Element> BitXor<&Array<B, T>> for Scalar<B, T>

Source§

type Output = Array<B, T>

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: &Array<B, T>) -> Array<B, T>

Performs the ^ operation. Read more
Source§

impl<B: Backend, T: Element> BitXor<Array<B, T>> for Scalar<B, T>

Source§

type Output = Array<B, T>

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: Array<B, T>) -> Array<B, T>

Performs the ^ operation. Read more
Source§

impl<B: Backend, T: Element, R: ArrayLike<B, T>> BitXor<R> for Array<B, T>

Source§

type Output = Array<B, T>

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: R) -> Array<B, T>

Performs the ^ operation. Read more
Source§

impl<B: Backend, T: Element, R: ArrayLike<B, T>> BitXor<R> for &Array<B, T>

Source§

type Output = Array<B, T>

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: R) -> Array<B, T>

Performs the ^ operation. Read more
Source§

impl<B: Backend, T: Element> Clone for Array<B, T>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<B: Backend, T: Element> Debug for Array<B, T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<B: Backend, T: Numeric> Div<&Array<B, T>> for Scalar<B, T>

Source§

type Output = Array<B, T>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &Array<B, T>) -> Array<B, T>

Performs the / operation. Read more
Source§

impl<B: Backend> Div<Array<B, Complex<f32>>> for c64

Source§

type Output = Array<B, Complex<f32>>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Array<B, c64>) -> Array<B, c64>

Performs the / operation. Read more
Source§

impl<B: Backend> Div<Array<B, Complex<f64>>> for c128

Source§

type Output = Array<B, Complex<f64>>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Array<B, c128>) -> Array<B, c128>

Performs the / operation. Read more
Source§

impl<B: Backend, T: Numeric> Div<Array<B, T>> for Scalar<B, T>

Source§

type Output = Array<B, T>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Array<B, T>) -> Array<B, T>

Performs the / operation. Read more
Source§

impl<B: Backend> Div<Array<B, bf16>> for bf16

Source§

type Output = Array<B, bf16>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Array<B, bf16>) -> Array<B, bf16>

Performs the / operation. Read more
Source§

impl<B: Backend> Div<Array<B, f16>> for f16

Source§

type Output = Array<B, f16>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Array<B, f16>) -> Array<B, f16>

Performs the / operation. Read more
Source§

impl<B: Backend> Div<Array<B, f32>> for f32

Source§

type Output = Array<B, f32>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Array<B, f32>) -> Array<B, f32>

Performs the / operation. Read more
Source§

impl<B: Backend> Div<Array<B, f64>> for f64

Source§

type Output = Array<B, f64>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Array<B, f64>) -> Array<B, f64>

Performs the / operation. Read more
Source§

impl<B: Backend> Div<Array<B, i8>> for i8

Source§

type Output = Array<B, i8>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Array<B, i8>) -> Array<B, i8>

Performs the / operation. Read more
Source§

impl<B: Backend> Div<Array<B, i16>> for i16

Source§

type Output = Array<B, i16>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Array<B, i16>) -> Array<B, i16>

Performs the / operation. Read more
Source§

impl<B: Backend> Div<Array<B, i32>> for i32

Source§

type Output = Array<B, i32>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Array<B, i32>) -> Array<B, i32>

Performs the / operation. Read more
Source§

impl<B: Backend> Div<Array<B, i64>> for i64

Source§

type Output = Array<B, i64>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Array<B, i64>) -> Array<B, i64>

Performs the / operation. Read more
Source§

impl<B: Backend> Div<Array<B, u8>> for u8

Source§

type Output = Array<B, u8>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Array<B, u8>) -> Array<B, u8>

Performs the / operation. Read more
Source§

impl<B: Backend> Div<Array<B, u16>> for u16

Source§

type Output = Array<B, u16>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Array<B, u16>) -> Array<B, u16>

Performs the / operation. Read more
Source§

impl<B: Backend> Div<Array<B, u32>> for u32

Source§

type Output = Array<B, u32>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Array<B, u32>) -> Array<B, u32>

Performs the / operation. Read more
Source§

impl<B: Backend> Div<Array<B, u64>> for u64

Source§

type Output = Array<B, u64>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Array<B, u64>) -> Array<B, u64>

Performs the / operation. Read more
Source§

impl<B: Backend, T: Numeric, R: ArrayLike<B, T>> Div<R> for Array<B, T>

Source§

type Output = Array<B, T>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: R) -> Array<B, T>

Performs the / operation. Read more
Source§

impl<B: Backend, T: Numeric, R: ArrayLike<B, T>> Div<R> for &Array<B, T>

Source§

type Output = Array<B, T>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: R) -> Array<B, T>

Performs the / operation. Read more
Source§

impl<B: Backend, T: Element> From<Scalar<B, T>> for Array<B, T>

Source§

fn from(s: Scalar<B, T>) -> Self

Converts to this type from the input type.
Source§

impl<B: Backend, T: Numeric> Mul<&Array<B, T>> for Scalar<B, T>

Source§

type Output = Array<B, T>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Array<B, T>) -> Array<B, T>

Performs the * operation. Read more
Source§

impl<B: Backend> Mul<Array<B, Complex<f32>>> for c64

Source§

type Output = Array<B, Complex<f32>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Array<B, c64>) -> Array<B, c64>

Performs the * operation. Read more
Source§

impl<B: Backend> Mul<Array<B, Complex<f64>>> for c128

Source§

type Output = Array<B, Complex<f64>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Array<B, c128>) -> Array<B, c128>

Performs the * operation. Read more
Source§

impl<B: Backend, T: Numeric> Mul<Array<B, T>> for Scalar<B, T>

Source§

type Output = Array<B, T>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Array<B, T>) -> Array<B, T>

Performs the * operation. Read more
Source§

impl<B: Backend> Mul<Array<B, bf16>> for bf16

Source§

type Output = Array<B, bf16>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Array<B, bf16>) -> Array<B, bf16>

Performs the * operation. Read more
Source§

impl<B: Backend> Mul<Array<B, f16>> for f16

Source§

type Output = Array<B, f16>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Array<B, f16>) -> Array<B, f16>

Performs the * operation. Read more
Source§

impl<B: Backend> Mul<Array<B, f32>> for f32

Source§

type Output = Array<B, f32>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Array<B, f32>) -> Array<B, f32>

Performs the * operation. Read more
Source§

impl<B: Backend> Mul<Array<B, f64>> for f64

Source§

type Output = Array<B, f64>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Array<B, f64>) -> Array<B, f64>

Performs the * operation. Read more
Source§

impl<B: Backend> Mul<Array<B, i8>> for i8

Source§

type Output = Array<B, i8>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Array<B, i8>) -> Array<B, i8>

Performs the * operation. Read more
Source§

impl<B: Backend> Mul<Array<B, i16>> for i16

Source§

type Output = Array<B, i16>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Array<B, i16>) -> Array<B, i16>

Performs the * operation. Read more
Source§

impl<B: Backend> Mul<Array<B, i32>> for i32

Source§

type Output = Array<B, i32>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Array<B, i32>) -> Array<B, i32>

Performs the * operation. Read more
Source§

impl<B: Backend> Mul<Array<B, i64>> for i64

Source§

type Output = Array<B, i64>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Array<B, i64>) -> Array<B, i64>

Performs the * operation. Read more
Source§

impl<B: Backend> Mul<Array<B, u8>> for u8

Source§

type Output = Array<B, u8>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Array<B, u8>) -> Array<B, u8>

Performs the * operation. Read more
Source§

impl<B: Backend> Mul<Array<B, u16>> for u16

Source§

type Output = Array<B, u16>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Array<B, u16>) -> Array<B, u16>

Performs the * operation. Read more
Source§

impl<B: Backend> Mul<Array<B, u32>> for u32

Source§

type Output = Array<B, u32>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Array<B, u32>) -> Array<B, u32>

Performs the * operation. Read more
Source§

impl<B: Backend> Mul<Array<B, u64>> for u64

Source§

type Output = Array<B, u64>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Array<B, u64>) -> Array<B, u64>

Performs the * operation. Read more
Source§

impl<B: Backend, T: Numeric, R: ArrayLike<B, T>> Mul<R> for Array<B, T>

Source§

type Output = Array<B, T>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: R) -> Array<B, T>

Performs the * operation. Read more
Source§

impl<B: Backend, T: Numeric, R: ArrayLike<B, T>> Mul<R> for &Array<B, T>

Source§

type Output = Array<B, T>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: R) -> Array<B, T>

Performs the * operation. Read more
Source§

impl<B: Backend, T: Numeric> Neg for Array<B, T>

Source§

type Output = Array<B, T>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self

Performs the unary - operation. Read more
Source§

impl<B: Backend, T: Numeric> Neg for &Array<B, T>

Source§

type Output = Array<B, T>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Array<B, T>

Performs the unary - operation. Read more
Source§

impl<B: Backend, T: Element> Not for Array<B, T>

Source§

type Output = Array<B, T>

The resulting type after applying the ! operator.
Source§

fn not(self) -> Self

Performs the unary ! operation. Read more
Source§

impl<B: Backend, T: Element> Not for &Array<B, T>

Source§

type Output = Array<B, T>

The resulting type after applying the ! operator.
Source§

fn not(self) -> Array<B, T>

Performs the unary ! operation. Read more
Source§

impl<B: Backend, T: Num> Rem<&Array<B, T>> for Scalar<B, T>

Source§

type Output = Array<B, T>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: &Array<B, T>) -> Array<B, T>

Performs the % operation. Read more
Source§

impl<B: Backend, T: Num> Rem<Array<B, T>> for Scalar<B, T>

Source§

type Output = Array<B, T>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: Array<B, T>) -> Array<B, T>

Performs the % operation. Read more
Source§

impl<B: Backend, T: Num, R: ArrayLike<B, T>> Rem<R> for Array<B, T>

Source§

type Output = Array<B, T>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: R) -> Array<B, T>

Performs the % operation. Read more
Source§

impl<B: Backend, T: Num, R: ArrayLike<B, T>> Rem<R> for &Array<B, T>

Source§

type Output = Array<B, T>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: R) -> Array<B, T>

Performs the % operation. Read more
Source§

impl<B: Backend, T: Numeric> Sub<&Array<B, T>> for Scalar<B, T>

Source§

type Output = Array<B, T>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &Array<B, T>) -> Array<B, T>

Performs the - operation. Read more
Source§

impl<B: Backend> Sub<Array<B, Complex<f32>>> for c64

Source§

type Output = Array<B, Complex<f32>>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Array<B, c64>) -> Array<B, c64>

Performs the - operation. Read more
Source§

impl<B: Backend> Sub<Array<B, Complex<f64>>> for c128

Source§

type Output = Array<B, Complex<f64>>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Array<B, c128>) -> Array<B, c128>

Performs the - operation. Read more
Source§

impl<B: Backend, T: Numeric> Sub<Array<B, T>> for Scalar<B, T>

Source§

type Output = Array<B, T>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Array<B, T>) -> Array<B, T>

Performs the - operation. Read more
Source§

impl<B: Backend> Sub<Array<B, bf16>> for bf16

Source§

type Output = Array<B, bf16>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Array<B, bf16>) -> Array<B, bf16>

Performs the - operation. Read more
Source§

impl<B: Backend> Sub<Array<B, f16>> for f16

Source§

type Output = Array<B, f16>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Array<B, f16>) -> Array<B, f16>

Performs the - operation. Read more
Source§

impl<B: Backend> Sub<Array<B, f32>> for f32

Source§

type Output = Array<B, f32>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Array<B, f32>) -> Array<B, f32>

Performs the - operation. Read more
Source§

impl<B: Backend> Sub<Array<B, f64>> for f64

Source§

type Output = Array<B, f64>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Array<B, f64>) -> Array<B, f64>

Performs the - operation. Read more
Source§

impl<B: Backend> Sub<Array<B, i8>> for i8

Source§

type Output = Array<B, i8>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Array<B, i8>) -> Array<B, i8>

Performs the - operation. Read more
Source§

impl<B: Backend> Sub<Array<B, i16>> for i16

Source§

type Output = Array<B, i16>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Array<B, i16>) -> Array<B, i16>

Performs the - operation. Read more
Source§

impl<B: Backend> Sub<Array<B, i32>> for i32

Source§

type Output = Array<B, i32>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Array<B, i32>) -> Array<B, i32>

Performs the - operation. Read more
Source§

impl<B: Backend> Sub<Array<B, i64>> for i64

Source§

type Output = Array<B, i64>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Array<B, i64>) -> Array<B, i64>

Performs the - operation. Read more
Source§

impl<B: Backend> Sub<Array<B, u8>> for u8

Source§

type Output = Array<B, u8>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Array<B, u8>) -> Array<B, u8>

Performs the - operation. Read more
Source§

impl<B: Backend> Sub<Array<B, u16>> for u16

Source§

type Output = Array<B, u16>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Array<B, u16>) -> Array<B, u16>

Performs the - operation. Read more
Source§

impl<B: Backend> Sub<Array<B, u32>> for u32

Source§

type Output = Array<B, u32>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Array<B, u32>) -> Array<B, u32>

Performs the - operation. Read more
Source§

impl<B: Backend> Sub<Array<B, u64>> for u64

Source§

type Output = Array<B, u64>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Array<B, u64>) -> Array<B, u64>

Performs the - operation. Read more
Source§

impl<B: Backend, T: Numeric, R: ArrayLike<B, T>> Sub<R> for Array<B, T>

Source§

type Output = Array<B, T>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: R) -> Array<B, T>

Performs the - operation. Read more
Source§

impl<B: Backend, T: Numeric, R: ArrayLike<B, T>> Sub<R> for &Array<B, T>

Source§

type Output = Array<B, T>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: R) -> Array<B, T>

Performs the - operation. Read more
Source§

impl<B: Backend, T: Element> Tree<B> for Array<B, T>

Source§

type On<C: Backend> = Array<C, T>

The same structure on backend C.
Source§

fn flatten(&self, leaves: &mut Vec<B::Leaf>)

Appends the leaves, in order.
Source§

fn unflatten_like(&self, leaves: &mut dyn Iterator<Item = B::Leaf>) -> Self

Builds a value of the same structure from leaves.
Source§

fn rebuild<C: Backend>( &self, leaves: &mut dyn Iterator<Item = C::Leaf>, ) -> Array<C, T>

Builds a value of the same structure on backend C from leaves (static fields are copied from self).
Source§

fn def(&self) -> TreeDef

Describes the structure.
Source§

fn select(pred: Bool<B>, on_true: &Self, on_false: &Self) -> Self

Selects on_true or on_false leaf by leaf.

Auto Trait Implementations§

§

impl<B, T> Freeze for Array<B, T>
where <B as Backend>::Array<T>: Freeze,

§

impl<B, T> RefUnwindSafe for Array<B, T>
where <B as Backend>::Array<T>: RefUnwindSafe,

§

impl<B, T> Send for Array<B, T>
where <B as Backend>::Array<T>: Send,

§

impl<B, T> Sync for Array<B, T>
where <B as Backend>::Array<T>: Sync,

§

impl<B, T> Unpin for Array<B, T>
where <B as Backend>::Array<T>: Unpin,

§

impl<B, T> UnsafeUnpin for Array<B, T>
where <B as Backend>::Array<T>: UnsafeUnpin,

§

impl<B, T> UnwindSafe for Array<B, T>
where <B as Backend>::Array<T>: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.