#[non_exhaustive]pub struct SparseVector {
pub values: Vec<f32>,
pub indices: Vec<i32>,
/* private fields */
}Expand description
A sparse vector.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.values: Vec<f32>Required. The values of the vector.
indices: Vec<i32>Required. The corresponding indices for the values.
Implementations§
Source§impl SparseVector
impl SparseVector
pub fn new() -> Self
Sourcepub fn set_values<T, V>(self, v: T) -> Self
pub fn set_values<T, V>(self, v: T) -> Self
Sourcepub fn set_indices<T, V>(self, v: T) -> Self
pub fn set_indices<T, V>(self, v: T) -> Self
Trait Implementations§
Source§impl Clone for SparseVector
impl Clone for SparseVector
Source§fn clone(&self) -> SparseVector
fn clone(&self) -> SparseVector
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SparseVector
impl Debug for SparseVector
Source§impl Default for SparseVector
impl Default for SparseVector
Source§fn default() -> SparseVector
fn default() -> SparseVector
Returns the “default value” for a type. Read more
Source§impl Message for SparseVector
impl Message for SparseVector
Source§impl PartialEq for SparseVector
impl PartialEq for SparseVector
impl StructuralPartialEq for SparseVector
Auto Trait Implementations§
impl Freeze for SparseVector
impl RefUnwindSafe for SparseVector
impl Send for SparseVector
impl Sync for SparseVector
impl Unpin for SparseVector
impl UnsafeUnpin for SparseVector
impl UnwindSafe for SparseVector
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