Struct fast_arrays::Array

source ·
pub struct Array<const D: usize> { /* private fields */ }

Implementations§

source§

impl<const D: usize> Array<D>

source

pub fn zeros(shape: &[usize; D]) -> Self

source

pub fn random_uniform( shape: &[usize; D], min: f32, max: f32, seed: Option<u64> ) -> Self

source

pub fn add(&self, other: &Self) -> Self

source

pub fn add_in_place(&mut self, other: &Self)

source

pub fn add_in_place_masked(&mut self, other: &Self, mask: &Mask<D>)

source

pub fn sub(&self, other: &Self) -> Self

source

pub fn sub_in_place(&mut self, other: &Self)

source

pub fn sub_in_place_masked(&mut self, other: &Self, mask: &Mask<D>)

source

pub fn mul(&self, other: &Self) -> Self

source

pub fn mul_in_place(&mut self, other: &Self)

source

pub fn mul_in_place_masked(&mut self, other: &Self, mask: &Mask<D>)

source

pub fn div(&self, other: &Self) -> Self

source

pub fn div_in_place(&mut self, other: &Self)

source

pub fn div_in_place_masked(&mut self, other: &Self, mask: &Mask<D>)

source

pub fn max(&self, other: &Self) -> Self

source

pub fn max_in_place(&mut self, other: &Self)

source

pub fn max_in_place_masked(&mut self, other: &Self, mask: &Mask<D>)

source

pub fn min(&self, other: &Self) -> Self

source

pub fn min_in_place(&mut self, other: &Self)

source

pub fn min_in_place_masked(&mut self, other: &Self, mask: &Mask<D>)

source

pub fn add_scalar(&self, scalar: f32) -> Self

source

pub fn add_scalar_in_place(&mut self, scalar: f32)

source

pub fn add_scalar_in_place_masked(&mut self, scalar: f32, mask: &Mask<D>)

source

pub fn sub_scalar(&self, scalar: f32) -> Self

source

pub fn sub_scalar_in_place(&mut self, scalar: f32)

source

pub fn sub_scalar_in_place_masked(&mut self, scalar: f32, mask: &Mask<D>)

source

pub fn mul_scalar(&self, scalar: f32) -> Self

source

pub fn mul_scalar_in_place(&mut self, scalar: f32)

source

pub fn mul_scalar_in_place_masked(&mut self, scalar: f32, mask: &Mask<D>)

source

pub fn div_scalar(&self, scalar: f32) -> Self

source

pub fn div_scalar_in_place(&mut self, scalar: f32)

source

pub fn div_scalar_in_place_masked(&mut self, scalar: f32, mask: &Mask<D>)

source

pub fn fmadd(&self, a: &Self, b: &Self) -> Self

source

pub fn fmadd_in_place(&mut self, a: &Self, b: &Self)

source

pub fn fmadd_in_place_masked(&mut self, a: &Self, b: &Self, mask: &Mask<D>)

source

pub fn sqrt(&self) -> Self

source

pub fn sqrt_in_place(&mut self)

source

pub fn sqrt_in_place_masked(&mut self, mask: &Mask<D>)

source

pub fn square(&self) -> Self

source

pub fn square_in_place(&mut self)

source

pub fn square_in_place_masked(&mut self, mask: &Mask<D>)

source

pub fn abs(&self) -> Self

source

pub fn abs_in_place(&mut self)

source

pub fn abs_in_place_masked(&mut self, mask: &Mask<D>)

source

pub fn sum(&self) -> f32

source

pub fn product(&self) -> f32

source

pub fn compare_equal(&self, other: &Self) -> Mask<D>

source

pub fn compare_scalar_equal(&self, scalar: f32) -> Mask<D>

source

pub fn compare_not_equal(&self, other: &Self) -> Mask<D>

source

pub fn compare_scalar_not_equal(&self, scalar: f32) -> Mask<D>

source

pub fn compare_greater_than(&self, other: &Self) -> Mask<D>

source

pub fn compare_scalar_greater_than(&self, scalar: f32) -> Mask<D>

source

pub fn compare_greater_than_or_equal(&self, other: &Self) -> Mask<D>

source

pub fn compare_scalar_greater_than_or_equal(&self, scalar: f32) -> Mask<D>

source

pub fn compare_less_than(&self, other: &Self) -> Mask<D>

source

pub fn compare_scalar_less_than(&self, scalar: f32) -> Mask<D>

source

pub fn compare_less_than_or_equal(&self, other: &Self) -> Mask<D>

source

pub fn compare_scalar_less_than_or_equal(&self, scalar: f32) -> Mask<D>

source

pub fn exp(&self) -> Self

source

pub fn exp_in_place(&mut self)

source§

impl Array<1>

source

pub fn get(&self, index: usize) -> f32

source

pub fn set(&mut self, index: usize, value: f32)

source

pub fn set_all(&mut self, value: f32)

source

pub fn dot_product(&self, other: &Self) -> f32

source§

impl Array<2>

source

pub fn from_vec(data: &Vec<f32>, shape: [usize; 2]) -> Self

source

pub fn vector_multiplication(&self, other: &Array<1>) -> Array<1>

source

pub fn matrix_multiplication(&self, matrix_b: &Self) -> Self

Trait Implementations§

source§

impl<const D: usize> Clone for Array<D>

source§

fn clone(&self) -> Array<D>

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl<const D: usize> From<Array<D>> for Vec<f32>

source§

fn from(value: Array<D>) -> Self

Converts to this type from the input type.
source§

impl From<Vec<f32>> for Array<1>

source§

fn from(value: Vec<f32>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<const D: usize> RefUnwindSafe for Array<D>

§

impl<const D: usize> Send for Array<D>

§

impl<const D: usize> Sync for Array<D>

§

impl<const D: usize> Unpin for Array<D>

§

impl<const D: usize> UnwindSafe for Array<D>

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
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.

source§

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

§

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>,

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V