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 Array
s.
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 Arraywhere
Array: From<ArrayExt<T>>,
impl<T: HasAfEnum> FromIterator<T> for Arraywhere
Array: From<ArrayExt<T>>,
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 PartialEq<Array> for Array
impl PartialEq<Array> for Array
source§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 RefUnwindSafe for Array
impl Send for Array
impl Sync for Array
impl Unpin for Array
impl UnwindSafe for Array
Blanket Implementations§
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
.