pub struct Array {
pub shape: Vec<usize>,
pub data: Data,
}Fields§
§shape: Vec<usize>§data: DataImplementations§
Source§impl Array
impl Array
pub fn new(shape: Vec<usize>, data: Data) -> Array
pub fn scalar_i64(v: i64) -> Array
pub fn scalar_f64(v: f64) -> Array
pub fn scalar_bool(v: bool) -> Array
pub fn from_i64(values: Vec<i64>) -> Array
pub fn from_f64(values: Vec<f64>) -> Array
pub fn from_chars(values: Vec<char>) -> Array
pub fn empty(dtype: DType) -> Array
Sourcepub fn box_fill() -> Array
pub fn box_fill() -> Array
The element that fills a boxed array: J’s a:, a box holding an
empty numeric list.
pub fn dtype(&self) -> DType
pub fn rank(&self) -> usize
Sourcepub fn items(&self) -> usize
pub fn items(&self) -> usize
Number of items (major cells): leading axis length, 1 for a scalar.
pub fn cast(&self, to: DType) -> Option<Array>
Sourcepub fn cells(&self, frame_rank: usize) -> Vec<Array>
pub fn cells(&self, frame_rank: usize) -> Vec<Array>
Split into cells: the trailing cell_rank axes form the cell shape,
the leading axes form the frame.
Sourcepub fn cell_at(&self, frame_rank: usize, index: usize) -> Array
pub fn cell_at(&self, frame_rank: usize, index: usize) -> Array
One cell without materialising all of them.
pub fn as_i64_slice(&self) -> Option<&[i64]>
pub fn as_f64_slice(&self) -> Option<&[f64]>
Sourcepub fn as_ext_slice(&self) -> Option<&[Ext]>
pub fn as_ext_slice(&self) -> Option<&[Ext]>
The extended integers, if the array holds them.
Sourcepub fn as_rat_slice(&self) -> Option<&[Rat]>
pub fn as_rat_slice(&self) -> Option<&[Rat]>
The rationals, if the array holds them.
pub fn as_complex_slice(&self) -> Option<&[Cx]>
Sourcepub fn to_complex_vec(&self) -> Option<Vec<Cx>>
pub fn to_complex_vec(&self) -> Option<Vec<Cx>>
Numeric contents widened to complex. None for character or boxed data.
Sourcepub fn to_f64_vec(&self) -> Option<Vec<f64>>
pub fn to_f64_vec(&self) -> Option<Vec<f64>>
Numeric contents widened to f64. None for character data.
Sourcepub fn to_i64_vec(&self) -> Option<Vec<i64>>
pub fn to_i64_vec(&self) -> Option<Vec<i64>>
Numeric contents as i64 if exactly representable.
Trait Implementations§
impl StructuralPartialEq for Array
Auto Trait Implementations§
impl !RefUnwindSafe for Array
impl !UnwindSafe for Array
impl Freeze for Array
impl Send for Array
impl Sync for Array
impl Unpin for Array
impl UnsafeUnpin 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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more