Css

Struct Css 

Source
pub struct Css<DS, IS> { /* private fields */ }
Expand description

Compressed Sparse Storage.

This struct represents a single sparse row, thtoUses the same logic and storage of a CSR Matrix without rows/pointers.

Implementations§

Source§

impl<DS, IS> Css<DS, IS>

Source

pub fn new(len: usize, data: DS, indcs: IS) -> Self

Source

pub fn len(&self) -> usize

The length of the vector.

§Examples
use mop_structs::doc_tests::css_array;
assert_eq!(css_array().len(), 10);
Source§

impl<T> Css<Vec<T>, Vec<usize>>

Source

pub fn new_rnd<F, R>(len: usize, nnz: usize, rng: &mut R, cb: F) -> Self
where F: FnMut(&mut R, usize) -> T, R: Rng,

Source

pub fn with_vec(len: usize, data: Vec<T>, indcs: Vec<usize>) -> Self

Source§

impl<DA, IA> Css<VecArray<DA>, VecArray<IA>>
where DA: Array, IA: Array<Item = usize>,

Source

pub fn new_rnd<F, R>(len: usize, nnz: usize, rng: &mut R, cb: F) -> Self
where F: FnMut(&mut R, usize) -> DA::Item, R: Rng,

Source

pub fn with_vec_array( len: usize, data: VecArray<DA>, indcs: VecArray<IA>, ) -> Self

Source§

impl<DS, IS> Css<DS, IS>
where DS: StDenseStoRef, IS: StDenseStoRef<Item = usize>,

Source

pub fn as_ref(&self) -> CssSlice<'_, DS::Item>

Source

pub fn data(&self) -> &[DS::Item]

Source

pub fn get(&self, idx: usize) -> Option<&DS::Item>

Source

pub fn indcs(&self) -> &[usize]

Source

pub fn iter(&self) -> impl Iterator<Item = (usize, &DS::Item)>

Source

pub fn nnz(&self) -> usize

Source§

impl<DS, IS> Css<DS, IS>
where DS: StDenseStoMut, IS: StDenseStoRef<Item = usize>,

Source

pub fn as_mut_slice(&mut self) -> CssSliceMut<'_, DS::Item>

Source

pub fn data_mut(&mut self) -> &mut [DS::Item]

Source

pub fn get_mut(&mut self, idx: usize) -> Option<&mut DS::Item>

Source

pub fn iter_mut(&mut self) -> impl Iterator<Item = (usize, &mut DS::Item)>

Source

pub fn split_at_mut( &mut self, idx: usize, ) -> (CssSliceMut<'_, DS::Item>, CssSliceMut<'_, DS::Item>)

Source

pub fn swap(&mut self, a: usize, b: usize)

Source§

impl<DS, IS> Css<DS, IS>
where DS: DynDenseStoRef,

Source

pub fn nnz_capacity(&self) -> usize

Source§

impl<DS, IS> Css<DS, IS>
where DS: DynDenseStoMut, IS: DynDenseStoMut<Item = usize>,

Source

pub fn clear(&mut self)

Source

pub fn extend(&mut self, other: &Self)
where DS::Item: Copy,

Source

pub fn set(&mut self, idx: usize, data: DS::Item)

Source

pub fn truncate(&mut self, until_idx: usize)

Trait Implementations§

Source§

impl<DS: Clone, IS: Clone> Clone for Css<DS, IS>

Source§

fn clone(&self) -> Css<DS, IS>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<DS: Debug, IS: Debug> Debug for Css<DS, IS>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<DS: Default, IS: Default> Default for Css<DS, IS>

Source§

fn default() -> Css<DS, IS>

Returns the “default value” for a type. Read more
Source§

impl<'de, DS, IS> Deserialize<'de> for Css<DS, IS>
where DS: Deserialize<'de>, IS: Deserialize<'de>,

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<DS: Hash, IS: Hash> Hash for Css<DS, IS>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<DS: PartialEq, IS: PartialEq> PartialEq for Css<DS, IS>

Source§

fn eq(&self, other: &Css<DS, IS>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<DS: PartialOrd, IS: PartialOrd> PartialOrd for Css<DS, IS>

Source§

fn partial_cmp(&self, other: &Css<DS, IS>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<DS, IS> Serialize for Css<DS, IS>
where DS: Serialize, IS: Serialize,

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<DS: Copy, IS: Copy> Copy for Css<DS, IS>

Source§

impl<DS, IS> StructuralPartialEq for Css<DS, IS>

Auto Trait Implementations§

§

impl<DS, IS> Freeze for Css<DS, IS>
where DS: Freeze, IS: Freeze,

§

impl<DS, IS> RefUnwindSafe for Css<DS, IS>

§

impl<DS, IS> Send for Css<DS, IS>
where DS: Send, IS: Send,

§

impl<DS, IS> Sync for Css<DS, IS>
where DS: Sync, IS: Sync,

§

impl<DS, IS> Unpin for Css<DS, IS>
where DS: Unpin, IS: Unpin,

§

impl<DS, IS> UnwindSafe for Css<DS, IS>
where DS: UnwindSafe, IS: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,