pub struct SparseView<'a, T, Format, Arch>where
T: 'a,
Format: SparseFormat,
Arch: SimdArch,{ /* private fields */ }Expand description
Format-parameterized sparse matrix view.
Implementations§
Source§impl<'a, T, Format, Arch> SparseView<'a, T, Format, Arch>where
T: 'a,
Format: SparseFormat,
Arch: SimdArch,
impl<'a, T, Format, Arch> SparseView<'a, T, Format, Arch>where
T: 'a,
Format: SparseFormat,
Arch: SimdArch,
Sourcepub fn new(
data: <Format as SparseFormat>::Storage<'a, T>,
) -> SparseView<'a, T, Format, Arch>
pub fn new( data: <Format as SparseFormat>::Storage<'a, T>, ) -> SparseView<'a, T, Format, Arch>
Create a SparseView from the format’s storage representation.
§Panics
If Arch cannot execute on this host.
Sourcepub fn storage(&self) -> &<Format as SparseFormat>::Storage<'a, T>
pub fn storage(&self) -> &<Format as SparseFormat>::Storage<'a, T>
Get a reference to the underlying storage representation.
Source§impl<'a, T, Arch> SparseView<'a, T, Csr, Arch>where
T: 'a,
Arch: SimdArch,
impl<'a, T, Arch> SparseView<'a, T, Csr, Arch>where
T: 'a,
Arch: SimdArch,
Source§impl<'a, T, Arch> SparseView<'a, T, Validated<Csr>, Arch>where
T: 'a,
Arch: SimdArch,
impl<'a, T, Arch> SparseView<'a, T, Validated<Csr>, Arch>where
T: 'a,
Arch: SimdArch,
Sourcepub fn try_from_csr(
data: CsrMatrix<T, &'a [T], &'a [i32]>,
) -> Result<SparseView<'a, T, Validated<Csr>, Arch>, SimdError>
pub fn try_from_csr( data: CsrMatrix<T, &'a [T], &'a [i32]>, ) -> Result<SparseView<'a, T, Validated<Csr>, Arch>, SimdError>
Validate CSR storage and create a SpMV-ready view.
Sourcepub fn from_validated_csr(
data: ValidatedData<CsrMatrix<T, &'a [T], &'a [i32]>>,
) -> SparseView<'a, T, Validated<Csr>, Arch>
pub fn from_validated_csr( data: ValidatedData<CsrMatrix<T, &'a [T], &'a [i32]>>, ) -> SparseView<'a, T, Validated<Csr>, Arch>
Create a SpMV-ready view from already-validated CSR storage.
§Panics
If Arch cannot execute on this host.
Source§impl<'a, T, const C: usize, Arch> SparseView<'a, T, SellP<C>, Arch>where
T: 'a,
Arch: SimdArch,
impl<'a, T, const C: usize, Arch> SparseView<'a, T, SellP<C>, Arch>where
T: 'a,
Arch: SimdArch,
Sourcepub fn from_sellp(
data: SellPMatrix<T, C, &'a [T], &'a [i32]>,
) -> SparseView<'a, T, SellP<C>, Arch>
pub fn from_sellp( data: SellPMatrix<T, C, &'a [T], &'a [i32]>, ) -> SparseView<'a, T, SellP<C>, Arch>
Source§impl<'a, T, const C: usize, Arch> SparseView<'a, T, Validated<SellP<C>>, Arch>where
T: 'a,
Arch: SimdArch,
impl<'a, T, const C: usize, Arch> SparseView<'a, T, Validated<SellP<C>>, Arch>where
T: 'a,
Arch: SimdArch,
Sourcepub fn try_from_sellp(
data: SellPMatrix<T, C, &'a [T], &'a [i32]>,
) -> Result<SparseView<'a, T, Validated<SellP<C>>, Arch>, SimdError>
pub fn try_from_sellp( data: SellPMatrix<T, C, &'a [T], &'a [i32]>, ) -> Result<SparseView<'a, T, Validated<SellP<C>>, Arch>, SimdError>
Validate SELL-p storage and create a SpMV-ready view.
Sourcepub fn from_validated_sellp(
data: ValidatedData<SellPMatrix<T, C, &'a [T], &'a [i32]>>,
) -> SparseView<'a, T, Validated<SellP<C>>, Arch>
pub fn from_validated_sellp( data: ValidatedData<SellPMatrix<T, C, &'a [T], &'a [i32]>>, ) -> SparseView<'a, T, Validated<SellP<C>>, Arch>
Create a SpMV-ready view from already-validated SELL-p storage.
§Panics
If Arch cannot execute on this host.
Source§impl<'a, T, const BM: usize, const BN: usize, Arch> SparseView<'a, T, BlockedCoo<BM, BN>, Arch>where
T: 'a,
Arch: SimdArch,
impl<'a, T, const BM: usize, const BN: usize, Arch> SparseView<'a, T, BlockedCoo<BM, BN>, Arch>where
T: 'a,
Arch: SimdArch,
Sourcepub fn from_blocked_coo(
data: BlockedCooMatrix<T, BM, BN, &'a [T], &'a [i32]>,
) -> SparseView<'a, T, BlockedCoo<BM, BN>, Arch>
pub fn from_blocked_coo( data: BlockedCooMatrix<T, BM, BN, &'a [T], &'a [i32]>, ) -> SparseView<'a, T, BlockedCoo<BM, BN>, Arch>
Create a SparseView over Blocked-COO data (generic BM, BN).
§Panics
If Arch cannot execute on this host.
Source§impl<'a, T, const BM: usize, const BN: usize, Arch> SparseView<'a, T, Validated<BlockedCoo<BM, BN>>, Arch>where
T: 'a,
Arch: SimdArch,
impl<'a, T, const BM: usize, const BN: usize, Arch> SparseView<'a, T, Validated<BlockedCoo<BM, BN>>, Arch>where
T: 'a,
Arch: SimdArch,
Sourcepub fn try_from_blocked_coo(
data: BlockedCooMatrix<T, BM, BN, &'a [T], &'a [i32]>,
) -> Result<SparseView<'a, T, Validated<BlockedCoo<BM, BN>>, Arch>, SimdError>
pub fn try_from_blocked_coo( data: BlockedCooMatrix<T, BM, BN, &'a [T], &'a [i32]>, ) -> Result<SparseView<'a, T, Validated<BlockedCoo<BM, BN>>, Arch>, SimdError>
Validate Blocked-COO storage and create a SpMV-ready view.
Sourcepub fn from_validated_blocked_coo(
data: ValidatedData<BlockedCooMatrix<T, BM, BN, &'a [T], &'a [i32]>>,
) -> SparseView<'a, T, Validated<BlockedCoo<BM, BN>>, Arch>
pub fn from_validated_blocked_coo( data: ValidatedData<BlockedCooMatrix<T, BM, BN, &'a [T], &'a [i32]>>, ) -> SparseView<'a, T, Validated<BlockedCoo<BM, BN>>, Arch>
Create a SpMV-ready view from already-validated Blocked-COO storage.
§Panics
If Arch cannot execute on this host.
Source§impl<'a, T, Arch> SparseView<'a, T, DenseWithMask, Arch>where
T: 'a,
Arch: SimdArch,
impl<'a, T, Arch> SparseView<'a, T, DenseWithMask, Arch>where
T: 'a,
Arch: SimdArch,
Sourcepub fn from_dense_with_mask(
data: DenseWithMaskMatrix<T, &'a [T], &'a [bool]>,
) -> SparseView<'a, T, DenseWithMask, Arch>
pub fn from_dense_with_mask( data: DenseWithMaskMatrix<T, &'a [T], &'a [bool]>, ) -> SparseView<'a, T, DenseWithMask, Arch>
Trait Implementations§
Source§impl<'a, T, Format, Arch> ComputeView for SparseView<'a, T, Format, Arch>where
Format: SparseFormat,
Arch: SimdArch,
impl<'a, T, Format, Arch> ComputeView for SparseView<'a, T, Format, Arch>where
Format: SparseFormat,
Arch: SimdArch,
Source§impl<'a, T, Arch> SparseOps<T> for SparseView<'a, T, Csr, Arch>
impl<'a, T, Arch> SparseOps<T> for SparseView<'a, T, Csr, Arch>
Source§fn sum_values(&self) -> T
fn sum_values(&self) -> T
Compute the sum of all elements stored in the sparse matrix.
Source§fn elementwise_mul_dense(&self, dense: &[T], out_values: &mut [T])
fn elementwise_mul_dense(&self, dense: &[T], out_values: &mut [T])
Elementwise multiply the sparse matrix values by corresponding entries
in a dense matrix, writing the results to
out_values.Source§impl<'a, T, const C: usize, Arch> SparseOps<T> for SparseView<'a, T, SellP<C>, Arch>
impl<'a, T, const C: usize, Arch> SparseOps<T> for SparseView<'a, T, SellP<C>, Arch>
Source§fn sum_values(&self) -> T
fn sum_values(&self) -> T
Compute the sum of all elements stored in the sparse matrix.
Source§fn elementwise_mul_dense(&self, dense: &[T], out_values: &mut [T])
fn elementwise_mul_dense(&self, dense: &[T], out_values: &mut [T])
Elementwise multiply the sparse matrix values by corresponding entries
in a dense matrix, writing the results to
out_values.Source§impl<'a, T, const BM: usize, const BN: usize, Arch> SparseOps<T> for SparseView<'a, T, BlockedCoo<BM, BN>, Arch>
impl<'a, T, const BM: usize, const BN: usize, Arch> SparseOps<T> for SparseView<'a, T, BlockedCoo<BM, BN>, Arch>
Source§fn sum_values(&self) -> T
fn sum_values(&self) -> T
Compute the sum of all elements stored in the sparse matrix.
Source§fn elementwise_mul_dense(&self, dense: &[T], out_values: &mut [T])
fn elementwise_mul_dense(&self, dense: &[T], out_values: &mut [T])
Elementwise multiply the sparse matrix values by corresponding entries
in a dense matrix, writing the results to
out_values.Source§impl<'a, T, Arch> SparseOps<T> for SparseView<'a, T, DenseWithMask, Arch>
impl<'a, T, Arch> SparseOps<T> for SparseView<'a, T, DenseWithMask, Arch>
Source§fn sum_values(&self) -> T
fn sum_values(&self) -> T
Compute the sum of all elements stored in the sparse matrix.
Source§fn elementwise_mul_dense(&self, dense: &[T], out_values: &mut [T])
fn elementwise_mul_dense(&self, dense: &[T], out_values: &mut [T])
Elementwise multiply the sparse matrix values by corresponding entries
in a dense matrix, writing the results to
out_values.Source§impl<'a, T, Arch> SparseSpMv<T> for SparseView<'a, T, Validated<Csr>, Arch>
impl<'a, T, Arch> SparseSpMv<T> for SparseView<'a, T, Validated<Csr>, Arch>
Source§impl<'a, T, Arch> SparseSpMv<T> for SparseView<'a, T, DenseWithMask, Arch>
impl<'a, T, Arch> SparseSpMv<T> for SparseView<'a, T, DenseWithMask, Arch>
Source§impl<'a, T, const BM: usize, const BN: usize, Arch> SparseSpMv<T> for SparseView<'a, T, Validated<BlockedCoo<BM, BN>>, Arch>
impl<'a, T, const BM: usize, const BN: usize, Arch> SparseSpMv<T> for SparseView<'a, T, Validated<BlockedCoo<BM, BN>>, Arch>
Source§impl<'a, T, const C: usize, Arch> SparseSpMv<T> for SparseView<'a, T, Validated<SellP<C>>, Arch>
impl<'a, T, const C: usize, Arch> SparseSpMv<T> for SparseView<'a, T, Validated<SellP<C>>, Arch>
Source§impl<'a, T, Format, Arch> SparseValidate for SparseView<'a, T, Format, Arch>where
T: 'a,
Format: SparseFormat,
Arch: SimdArch,
<Format as SparseFormat>::Storage<'a, T>: SparseValidate,
impl<'a, T, Format, Arch> SparseValidate for SparseView<'a, T, Format, Arch>where
T: 'a,
Format: SparseFormat,
Arch: SimdArch,
<Format as SparseFormat>::Storage<'a, T>: SparseValidate,
Source§impl<'a, T, Format, Arch> SparseViewShape for SparseView<'a, T, Format, Arch>where
T: 'a,
Format: SparseFormat,
Arch: SimdArch,
<Format as SparseFormat>::Storage<'a, T>: SparseShape,
impl<'a, T, Format, Arch> SparseViewShape for SparseView<'a, T, Format, Arch>where
T: 'a,
Format: SparseFormat,
Arch: SimdArch,
<Format as SparseFormat>::Storage<'a, T>: SparseShape,
Auto Trait Implementations§
impl<'a, T, Format, Arch> Freeze for SparseView<'a, T, Format, Arch>
impl<'a, T, Format, Arch> RefUnwindSafe for SparseView<'a, T, Format, Arch>
impl<'a, T, Format, Arch> Send for SparseView<'a, T, Format, Arch>
impl<'a, T, Format, Arch> Sync for SparseView<'a, T, Format, Arch>
impl<'a, T, Format, Arch> Unpin for SparseView<'a, T, Format, Arch>
impl<'a, T, Format, Arch> UnsafeUnpin for SparseView<'a, T, Format, Arch>
impl<'a, T, Format, Arch> UnwindSafe for SparseView<'a, T, Format, Arch>
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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