Struct CsrMatrix
pub struct CsrMatrix<S> { /* private fields */ }Description
Immutable compressed sparse row matrix.
Implementations§
§impl<S> CsrMatrix<S>where
S: Scalar + ComplexFloat + Sync,
impl<S> CsrMatrix<S>where
S: Scalar + ComplexFloat + Sync,
pub fn from_sorted_csr(
rows: usize,
columns: usize,
row_offsets: Vec<usize>,
column_indices: Vec<usize>,
values: Vec<S>,
) -> Result<CsrMatrix<S>, Diagnostic>
pub fn from_sorted_csr( rows: usize, columns: usize, row_offsets: Vec<usize>, column_indices: Vec<usize>, values: Vec<S>, ) -> Result<CsrMatrix<S>, Diagnostic>
Construct validated CSR storage with strictly ordered columns per row.
This is the single admission boundary for finalized sparse storage. Callers retain no mutable access to the admitted arrays, so row lookup and backend adapters may rely on the checked ordering thereafter.
§Errors
Returns EQ0806 for zero or inconsistent shape, invalid row offsets,
out-of-range or non-increasing columns, or a non-finite value.
pub fn multiply(&self, input: &[S]) -> Result<Vec<S>, Diagnostic>
pub fn multiply(&self, input: &[S]) -> Result<Vec<S>, Diagnostic>
Multiply by a dense vector.
§Errors
Returns EQ0802 for the wrong input size, non-finite input, or a non-finite result.
pub fn multiply_into(
&self,
input: &[S],
output: &mut [S],
) -> Result<(), Diagnostic>
pub fn multiply_into( &self, input: &[S], output: &mut [S], ) -> Result<(), Diagnostic>
Multiply into caller-owned storage without allocating.
§Errors
Returns EQ0802 for a shape mismatch, non-finite input, or a non-finite result.
Trait Implementations§
§impl<S> Clone for CsrMatrix<S>where
S: Clone,
impl<S> Clone for CsrMatrix<S>where
S: Clone,
§impl<S> CsrStorage<S> for CsrMatrix<S>
impl<S> CsrStorage<S> for CsrMatrix<S>
§impl<S> Debug for CsrMatrix<S>where
S: Debug,
impl<S> Debug for CsrMatrix<S>where
S: Debug,
§impl<S> LinearOperator for CsrMatrix<S>where
S: Scalar + ComplexFloat + Sync,
impl<S> LinearOperator for CsrMatrix<S>where
S: Scalar + ComplexFloat + Sync,
§fn apply(&self, input: &[S], output: &mut [S]) -> Result<(), Diagnostic>
fn apply(&self, input: &[S], output: &mut [S]) -> Result<(), Diagnostic>
Compute
output = self * input. Read more§fn row_action(&self) -> Option<&dyn RowLinearAction<Scalar = S>>
fn row_action(&self) -> Option<&dyn RowLinearAction<Scalar = S>>
Expose independently executable row ranges when the realization has
that capability. Read more
§fn diagonal(&self, output: &mut [S]) -> Result<DiagonalAvailability, Diagnostic>
fn diagonal(&self, output: &mut [S]) -> Result<DiagonalAvailability, Diagnostic>
Write the operator diagonal when it is naturally available. Read more
§fn orientation(&self) -> LinearOperatorOrientation
fn orientation(&self) -> LinearOperatorOrientation
Orientation represented by this callable action. Read more
§impl<S> OrientedLinearOperator for CsrMatrix<S>where
S: Scalar + ComplexFloat + Sync,
impl<S> OrientedLinearOperator for CsrMatrix<S>where
S: Scalar + ComplexFloat + Sync,
§fn supports_orientation(&self, _orientation: LinearOperatorOrientation) -> bool
fn supports_orientation(&self, _orientation: LinearOperatorOrientation) -> bool
Whether this exact action is available before numerical work begins.
§fn apply_oriented(
&self,
orientation: LinearOperatorOrientation,
input: &[S],
output: &mut [S],
) -> Result<(), Diagnostic>
fn apply_oriented( &self, orientation: LinearOperatorOrientation, input: &[S], output: &mut [S], ) -> Result<(), Diagnostic>
Apply the requested mathematical orientation. Read more
§impl<S> PartialEq for CsrMatrix<S>where
S: PartialEq,
impl<S> PartialEq for CsrMatrix<S>where
S: PartialEq,
§fn eq(&self, other: &CsrMatrix<S>) -> bool
fn eq(&self, other: &CsrMatrix<S>) -> bool
Tests for
self and other values to be equal, and is used by ==.§impl<S> RowLinearAction for CsrMatrix<S>where
S: Scalar + ComplexFloat + Sync,
impl<S> RowLinearAction for CsrMatrix<S>where
S: Scalar + ComplexFloat + Sync,
§fn apply_rows(
&self,
rows: Range<usize>,
input: &[S],
output: &mut [S],
) -> Result<(), Diagnostic>
fn apply_rows( &self, rows: Range<usize>, input: &[S], output: &mut [S], ) -> Result<(), Diagnostic>
Compute one contiguous output-row range without allocating. Read more
impl<S> StructuralPartialEq for CsrMatrix<S>
Auto Trait Implementations§
impl<S> Freeze for CsrMatrix<S>
impl<S> RefUnwindSafe for CsrMatrix<S>where
S: RefUnwindSafe,
impl<S> Send for CsrMatrix<S>where
S: Send,
impl<S> Sync for CsrMatrix<S>where
S: Sync,
impl<S> Unpin for CsrMatrix<S>where
S: Unpin,
impl<S> UnsafeUnpin for CsrMatrix<S>
impl<S> UnwindSafe for CsrMatrix<S>where
S: UnwindSafe,
Blanket Implementations§
Source§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
Signature links:§
§fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
Convert the given value into an approximately equivalent representation.
§impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
Signature links:§
§type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
Signature links:§
The error type produced by a failed conversion.
§fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
Convert the subject into an approximately equivalent representation.
Source§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T, Dst> ConvAsUtil<Dst> for T
impl<T, Dst> ConvAsUtil<Dst> for T
Signature links:§
§fn approx(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
fn approx(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
Approximate the subject with the default scheme.
§impl<T> ConvUtil for T
impl<T> ConvUtil for T
Signature links:§
§fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
Approximate the subject to a given type with the default scheme.
§fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst, Scheme>,
Scheme: ApproxScheme,
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst, Scheme>,
Scheme: ApproxScheme,
Approximate the subject to a given type with a specific scheme.
§fn into_as<Dst>(self) -> Dstwhere
Self: Sized + Into<Dst>,
fn into_as<Dst>(self) -> Dstwhere
Self: Sized + Into<Dst>,
Convert the subject to a given type.
§fn try_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + TryInto<Dst>,
fn try_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + TryInto<Dst>,
Attempt to convert the subject to a given type.
§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> Twhere
Self: Distribution<T>,
Source§impl<T> From<T> for T
impl<T> From<T> for T
§impl<T> Instrument for T
impl<T> Instrument for T
Signature links:§
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Signature links:§
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Signature links:§
Source§impl<T, U> Into<U> for Twhere
U: From<T>,
impl<T, U> Into<U> for Twhere
U: From<T>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
F: FnOnce(&Self) -> bool,
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§impl<T> Pointable for T
impl<T> Pointable for T
Signature links:§
Source§impl<T> Same for T
impl<T> Same for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Signature links:§
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Signature links:§
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.Source§impl<T> ToOwned for Twhere
T: Clone,
impl<T> ToOwned for Twhere
T: Clone,
§impl<Src> TryFrom<Src> for Src
impl<Src> TryFrom<Src> for Src
Signature links:§
Source§impl<T, U> TryFrom<U> for Twhere
U: Into<T>,
impl<T, U> TryFrom<U> for Twhere
U: Into<T>,
§impl<Src, Dst> TryInto<Dst> for Srcwhere
Dst: TryFrom<Src>,
impl<Src, Dst> TryInto<Dst> for Srcwhere
Dst: TryFrom<Src>,
Signature links:§
Source§impl<T, U> TryInto<U> for Twhere
U: TryFrom<T>,
impl<T, U> TryInto<U> for Twhere
U: TryFrom<T>,
§impl<Src> ValueFrom<Src> for Src
impl<Src> ValueFrom<Src> for Src
Signature links:§
§fn value_from(src: Src) -> Result<Src, <Src as ValueFrom<Src>>::Err>
fn value_from(src: Src) -> Result<Src, <Src as ValueFrom<Src>>::Err>
Convert the given value into an exactly equivalent representation.
§impl<Src, Dst> ValueInto<Dst> for Srcwhere
Dst: ValueFrom<Src>,
impl<Src, Dst> ValueInto<Dst> for Srcwhere
Dst: ValueFrom<Src>,
Signature links:§
§type Err = <Dst as ValueFrom<Src>>::Err
type Err = <Dst as ValueFrom<Src>>::Err
Signature links:§
The error type produced by a failed conversion.
§fn value_into(self) -> Result<Dst, <Src as ValueInto<Dst>>::Err>
fn value_into(self) -> Result<Dst, <Src as ValueInto<Dst>>::Err>
Convert the subject into an exactly equivalent representation.
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Signature links:§
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Signature links:§