pub enum Array {
Bool(ArrayExt<bool>),
C32(ArrayExt<Complex<f32>>),
C64(ArrayExt<Complex<f64>>),
F32(ArrayExt<f32>),
F64(ArrayExt<f64>),
I16(ArrayExt<i16>),
I32(ArrayExt<i32>),
I64(ArrayExt<i64>),
U8(ArrayExt<u8>),
U16(ArrayExt<u16>),
U32(ArrayExt<u32>),
U64(ArrayExt<u64>),
}Expand description
A generic one-dimensional array which supports all variants of NumberType.
Variants§
Bool(ArrayExt<bool>)
C32(ArrayExt<Complex<f32>>)
C64(ArrayExt<Complex<f64>>)
F32(ArrayExt<f32>)
F64(ArrayExt<f64>)
I16(ArrayExt<i16>)
I32(ArrayExt<i32>)
I64(ArrayExt<i64>)
U8(ArrayExt<u8>)
U16(ArrayExt<u16>)
U32(ArrayExt<u32>)
U64(ArrayExt<u64>)
Implementations§
Source§impl Array
impl Array
Sourcepub fn type_cast<T: HasAfEnum>(&self) -> ArrayExt<T>
pub fn type_cast<T: HasAfEnum>(&self) -> ArrayExt<T>
Cast the values of this array into an ArrayExt<T>.
Sourcepub fn concatenate(left: &Array, right: &Array) -> Array
pub fn concatenate(left: &Array, right: &Array) -> Array
Concatenate two Arrays.
Sourcepub fn constant(value: Number, length: usize) -> Array
pub fn constant(value: Number, length: usize) -> Array
Construct a new Array with the given constant value and length.
Sourcepub fn random_normal(dtype: FloatType, length: usize) -> Array
pub fn random_normal(dtype: FloatType, length: usize) -> Array
Construct a new Array with a random normal distribution.
Sourcepub fn random_uniform(dtype: FloatType, length: usize) -> Array
pub fn random_uniform(dtype: FloatType, length: usize) -> Array
Construct a new Array with a uniform random distribution.
Sourcepub fn dtype(&self) -> NumberType
pub fn dtype(&self) -> NumberType
The NumberType of this Array.
Sourcepub fn cast_into(&self, dtype: NumberType) -> Array
pub fn cast_into(&self, dtype: NumberType) -> Array
Cast into an Array of a different NumberType.
Sourcepub fn and_const(&self, other: Number) -> Array
pub fn and_const(&self, other: Number) -> Array
Element-wise logical and, relative to a constant other.
Sourcepub fn is_infinite(&self) -> Array
pub fn is_infinite(&self) -> Array
Element-wise check for infinite values.
Sourcepub fn log(&self, base: &Array) -> Array
pub fn log(&self, base: &Array) -> Array
Compute the logarithm of this Array with respect to the given base.
Sourcepub fn log_const(&self, base: Number) -> Array
pub fn log_const(&self, base: Number) -> Array
Compute the logarithm of this Array with respect to the given constant base.
Sourcepub fn or_const(&self, other: Number) -> Array
pub fn or_const(&self, other: Number) -> Array
Element-wise logical or, relative to a constant other.
Sourcepub fn reduce_max(&self, stride: u64) -> Result<Array>
pub fn reduce_max(&self, stride: u64) -> Result<Array>
Find the maximum value of each stride of this Array
Sourcepub fn reduce_min(&self, stride: u64) -> Result<Array>
pub fn reduce_min(&self, stride: u64) -> Result<Array>
Find the maximum value of each stride of this Array
Sourcepub fn reduce_product(&self, stride: u64) -> Result<Array>
pub fn reduce_product(&self, stride: u64) -> Result<Array>
Compute the product of each stride of this Array
Sourcepub fn reduce_sum(&self, stride: u64) -> Result<Array>
pub fn reduce_sum(&self, stride: u64) -> Result<Array>
Compute the sum of each stride of a single block
Sourcepub fn set(&mut self, index: &ArrayExt<u64>, other: &Array) -> Result<()>
pub fn set(&mut self, index: &ArrayExt<u64>, other: &Array) -> Result<()>
Set the values at the specified coordinates to the corresponding values in other.
Sourcepub fn set_value(&mut self, offset: usize, value: Number) -> Result<()>
pub fn set_value(&mut self, offset: usize, value: Number) -> Result<()>
Set the value at the specified coordinate to value.
Sourcepub fn argsort(&self, ascending: bool) -> Result<(Self, ArrayExt<u64>)>
pub fn argsort(&self, ascending: bool) -> Result<(Self, ArrayExt<u64>)>
Compute the indices needed to sort this Array.
Sourcepub fn split(&self, at: usize) -> Result<(Array, Array)>
pub fn split(&self, at: usize) -> Result<(Array, Array)>
Split this Array into two new instances at the given pivot.
pub fn sin(&self) -> Array
pub fn asin(&self) -> Array
pub fn sinh(&self) -> Array
pub fn asinh(&self) -> Array
pub fn cos(&self) -> Array
pub fn acos(&self) -> Array
pub fn cosh(&self) -> Array
pub fn acosh(&self) -> Array
pub fn tan(&self) -> Array
pub fn atan(&self) -> Array
pub fn tanh(&self) -> Array
pub fn atanh(&self) -> Array
Trait Implementations§
Source§impl AddAssign<&Array> for Array
impl AddAssign<&Array> for Array
Source§fn add_assign(&mut self, other: &Array)
fn add_assign(&mut self, other: &Array)
+= operation. Read moreSource§impl AddAssign<Number> for Array
impl AddAssign<Number> for Array
Source§fn add_assign(&mut self, rhs: Number)
fn add_assign(&mut self, rhs: Number)
+= operation. Read moreSource§impl AsType<ArrayExt<Complex<f32>>> for Array
impl AsType<ArrayExt<Complex<f32>>> for Array
Source§impl AsType<ArrayExt<Complex<f64>>> for Array
impl AsType<ArrayExt<Complex<f64>>> for Array
Source§impl AsType<ArrayExt<bool>> for Array
impl AsType<ArrayExt<bool>> for Array
Source§impl AsType<ArrayExt<f32>> for Array
impl AsType<ArrayExt<f32>> for Array
Source§impl AsType<ArrayExt<f64>> for Array
impl AsType<ArrayExt<f64>> for Array
Source§impl AsType<ArrayExt<i16>> for Array
impl AsType<ArrayExt<i16>> for Array
Source§impl AsType<ArrayExt<i32>> for Array
impl AsType<ArrayExt<i32>> for Array
Source§impl AsType<ArrayExt<i64>> for Array
impl AsType<ArrayExt<i64>> for Array
Source§impl AsType<ArrayExt<u16>> for Array
impl AsType<ArrayExt<u16>> for Array
Source§impl AsType<ArrayExt<u32>> for Array
impl AsType<ArrayExt<u32>> for Array
Source§impl AsType<ArrayExt<u64>> for Array
impl AsType<ArrayExt<u64>> for Array
Source§impl AsType<ArrayExt<u8>> for Array
impl AsType<ArrayExt<u8>> for Array
Source§impl<'de> Deserialize<'de> for Array
impl<'de> Deserialize<'de> for Array
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Source§impl DivAssign<&Array> for Array
impl DivAssign<&Array> for Array
Source§fn div_assign(&mut self, other: &Array)
fn div_assign(&mut self, other: &Array)
/= operation. Read moreSource§impl DivAssign<Number> for Array
impl DivAssign<Number> for Array
Source§fn div_assign(&mut self, rhs: Number)
fn div_assign(&mut self, rhs: Number)
/= operation. Read moreSource§impl<T: HasAfEnum> FromIterator<T> for Array
impl<T: HasAfEnum> FromIterator<T> for Array
Source§fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
Source§impl FromStream for Array
impl FromStream for Array
Source§impl GetSize for Array
impl GetSize for Array
Source§fn get_stack_size() -> usize
fn get_stack_size() -> usize
Source§fn get_heap_size(&self) -> usize
fn get_heap_size(&self) -> usize
Source§impl<'en> IntoStream<'en> for Array
impl<'en> IntoStream<'en> for Array
Source§impl MulAssign<&Array> for Array
impl MulAssign<&Array> for Array
Source§fn mul_assign(&mut self, other: &Array)
fn mul_assign(&mut self, other: &Array)
*= operation. Read moreSource§impl MulAssign<Number> for Array
impl MulAssign<Number> for Array
Source§fn mul_assign(&mut self, rhs: Number)
fn mul_assign(&mut self, rhs: Number)
*= operation. Read moreSource§impl SubAssign<&Array> for Array
impl SubAssign<&Array> for Array
Source§fn sub_assign(&mut self, other: &Array)
fn sub_assign(&mut self, other: &Array)
-= operation. Read moreAuto Trait Implementations§
impl Freeze for Array
impl RefUnwindSafe for Array
impl Send for Array
impl Sync for Array
impl Unpin for Array
impl UnwindSafe for Array
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<F> Match for F
impl<F> Match for F
Source§fn matches<T>(&self) -> boolwhere
T: TryCastFrom<Self>,
fn matches<T>(&self) -> boolwhere
T: TryCastFrom<Self>,
true if self can be cast into the target type T.Source§impl<F, T> TryCastFrom<F> for Twhere
T: CastFrom<F>,
impl<F, T> TryCastFrom<F> for Twhere
T: CastFrom<F>,
Source§fn can_cast_from(_: &F) -> bool
fn can_cast_from(_: &F) -> bool
value can be cast into Self.Source§fn opt_cast_from(f: F) -> Option<T>
fn opt_cast_from(f: F) -> Option<T>
Some(Self) if the source value can be cast into Self, otherwise None.Source§impl<F, T> TryCastInto<T> for Fwhere
T: TryCastFrom<F>,
impl<F, T> TryCastInto<T> for Fwhere
T: TryCastFrom<F>,
Source§fn can_cast_into(&self) -> bool
fn can_cast_into(&self) -> bool
self can be cast into T.Source§fn opt_cast_into(self) -> Option<T>
fn opt_cast_into(self) -> Option<T>
Some(T) if self can be cast into T, otherwise None.Source§fn try_cast_into<Err, OnErr>(self, on_err: OnErr) -> Result<T, Err>where
OnErr: FnOnce(&Self) -> Err,
fn try_cast_into<Err, OnErr>(self, on_err: OnErr) -> Result<T, Err>where
OnErr: FnOnce(&Self) -> Err,
Ok(T) if self can be cast into T, otherwise calls on_err.