pub struct DiagonalView<S: Semiring> {
pub diag: Vec<S>,
}Expand description
A diagonal matrix view with entries diag.
Fields§
§diag: Vec<S>Diagonal entries; the view is diag.len() x diag.len().
Implementations§
Source§impl<S: Semiring> DiagonalView<S>
impl<S: Semiring> DiagonalView<S>
Sourcepub fn matvec(&self, v: &[S]) -> Result<Vec<S>, AlgebraError>
pub fn matvec(&self, v: &[S]) -> Result<Vec<S>, AlgebraError>
Apply to a vector: result[i] = diag[i] * v[i].
Sourcepub fn materialize(
&self,
limits: AlgebraLimits,
) -> Result<Matrix<S>, AlgebraError>
pub fn materialize( &self, limits: AlgebraLimits, ) -> Result<Matrix<S>, AlgebraError>
Materialize as a dense diagonal matrix, guarded by limits.
Trait Implementations§
Source§impl<S: Clone + Semiring> Clone for DiagonalView<S>
impl<S: Clone + Semiring> Clone for DiagonalView<S>
Source§fn clone(&self) -> DiagonalView<S>
fn clone(&self) -> DiagonalView<S>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<S: PartialEq + Semiring> StructuralPartialEq for DiagonalView<S>
Auto Trait Implementations§
impl<S> Freeze for DiagonalView<S>
impl<S> RefUnwindSafe for DiagonalView<S>where
S: RefUnwindSafe,
impl<S> Send for DiagonalView<S>where
S: Send,
impl<S> Sync for DiagonalView<S>where
S: Sync,
impl<S> Unpin for DiagonalView<S>where
S: Unpin,
impl<S> UnsafeUnpin for DiagonalView<S>
impl<S> UnwindSafe for DiagonalView<S>where
S: 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