pub struct Array<T> { /* private fields */ }Expand description
Array implements the core of the numbrs package
Implementations§
Source§impl<T> Array<T>
impl<T> Array<T>
Sourcepub fn constants(val: T, shape: &[usize]) -> Array<T>where
T: Clone,
pub fn constants(val: T, shape: &[usize]) -> Array<T>where
T: Clone,
Creates a new array with the given dimensions, filled with the given value.
This method implements similar functionality as ones() or zeros() in other
packages except the value supplied as the first argument to this function
is used to fill the entire array.
§Examples
let a = numbrs::Array::constants(0, &[10, 10, 10]);
let b = numbrs::Array::constants(21.1, &[10, 10, 3]);
assert_eq!(a.len(), 1000);
assert_eq!(b.len(), 300);Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Array<T>
impl<T> RefUnwindSafe for Array<T>where
T: RefUnwindSafe,
impl<T> Send for Array<T>where
T: Send,
impl<T> Sync for Array<T>where
T: Sync,
impl<T> Unpin for Array<T>where
T: Unpin,
impl<T> UnwindSafe for Array<T>where
T: UnwindSafe,
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