pub struct Vector { /* private fields */ }Implementations§
Source§impl Vector
impl Vector
pub fn new(size: usize) -> Self
pub fn from_slice(data: &[f64]) -> Self
pub fn zeros(size: usize) -> Self
pub fn ones(size: usize) -> Self
pub fn random(size: usize) -> Self
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn data(&self) -> &[f64]
pub fn data_mut(&mut self) -> &mut [f64]
pub fn get(&self, index: usize) -> f64
pub fn set(&mut self, index: usize, value: f64)
pub fn dot(&self, other: &Vector) -> f64
pub fn norm(&self) -> f64
pub fn normalize(&mut self)
pub fn add(&self, other: &Vector) -> Vector
pub fn subtract(&self, other: &Vector) -> Vector
pub fn scale(&self, scalar: f64) -> Vector
pub fn axpy(&mut self, alpha: f64, x: &Vector)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Vector
impl RefUnwindSafe for Vector
impl Send for Vector
impl Sync for Vector
impl Unpin for Vector
impl UnwindSafe for Vector
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