pub struct FaerSparseMat<T: Scalar> { /* private fields */ }
Trait Implementations§
Source§impl<T: Scalar> Add<&FaerSparseMat<T>> for FaerSparseMat<T>
impl<T: Scalar> Add<&FaerSparseMat<T>> for FaerSparseMat<T>
Source§type Output = FaerSparseMat<T>
type Output = FaerSparseMat<T>
The resulting type after applying the
+
operator.Source§impl<T: Clone + Scalar> Clone for FaerSparseMat<T>
impl<T: Clone + Scalar> Clone for FaerSparseMat<T>
Source§fn clone(&self) -> FaerSparseMat<T>
fn clone(&self) -> FaerSparseMat<T>
Returns a copy 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<T: Scalar> DefaultSolver for FaerSparseMat<T>
impl<T: Scalar> DefaultSolver for FaerSparseMat<T>
type LS = FaerSparseLU<T>
fn default_solver() -> Self::LS
Source§impl<T: Scalar> LinearSolver<FaerSparseMat<T>> for FaerSparseLU<T>
impl<T: Scalar> LinearSolver<FaerSparseMat<T>> for FaerSparseLU<T>
fn set_linearisation<C: NonLinearOpJacobian<T = T, V = FaerVec<T>, M = FaerSparseMat<T>>>( &mut self, op: &C, x: &FaerVec<T>, t: T, )
fn solve_in_place(&self, x: &mut FaerVec<T>) -> Result<(), DiffsolError>
Source§fn set_problem<C: NonLinearOpJacobian<T = T, V = FaerVec<T>, M = FaerSparseMat<T>, C = FaerContext>>(
&mut self,
op: &C,
)
fn set_problem<C: NonLinearOpJacobian<T = T, V = FaerVec<T>, M = FaerSparseMat<T>, C = FaerContext>>( &mut self, op: &C, )
Set the problem to be solved, any previous problem is discarded.
Any internal state of the solver is reset.
This function will normally set the sparsity pattern of the matrix to be solved.
Source§fn solve(&self, b: &M::V) -> Result<M::V, DiffsolError>
fn solve(&self, b: &M::V) -> Result<M::V, DiffsolError>
Solve the problem
Ax = b
and return the solution x
.
panics if Self::set_linearisation has not been called previouslySource§impl<T: Scalar> Matrix for FaerSparseMat<T>
impl<T: Scalar> Matrix for FaerSparseMat<T>
type Sparsity = SymbolicSparseColMat<Own<usize>>
type SparsityRef<'a> = SymbolicSparseColMat<Ref<'a, usize>>
Source§fn sparsity(&self) -> Option<Self::SparsityRef<'_>>
fn sparsity(&self) -> Option<Self::SparsityRef<'_>>
Return sparsity information (None if the matrix is dense)
fn context(&self) -> &FaerContext
Source§fn gather(&mut self, other: &Self, indices: &<Self::V as Vector>::Index)
fn gather(&mut self, other: &Self, indices: &<Self::V as Vector>::Index)
gather the values in the matrix
other
at the indices in indices
to the matrix self
for sparse matrices: the index idx_i
in indices
is an index into the data array for other
, and is copied to the index idx_i
in the data array for self
for dense matrices: the index idx_i
in indices
is the data index in column-major order for other
, and is copied to the index idx_i
in the data array for self
(again in column-major order) Read moreSource§fn set_data_with_indices(
&mut self,
dst_indices: &<Self::V as Vector>::Index,
src_indices: &<Self::V as Vector>::Index,
data: &Self::V,
)
fn set_data_with_indices( &mut self, dst_indices: &<Self::V as Vector>::Index, src_indices: &<Self::V as Vector>::Index, data: &Self::V, )
assign the values in the
data
vector to the matrix at the indices in dst_indices
from the indices in src_indices
dst_index can be obtained using the get_index
method on the Sparsity type
- for dense matrices, the dst_index is the data index in column-major order
- for sparse matrices, the dst_index is the index into the data arrayfn add_column_to_vector(&self, j: IndexType, v: &mut Self::V)
fn triplet_iter(&self) -> impl Iterator<Item = (IndexType, IndexType, Self::T)>
Source§fn try_from_triplets(
nrows: IndexType,
ncols: IndexType,
triplets: Vec<(IndexType, IndexType, T)>,
ctx: Self::C,
) -> Result<Self, DiffsolError>
fn try_from_triplets( nrows: IndexType, ncols: IndexType, triplets: Vec<(IndexType, IndexType, T)>, ctx: Self::C, ) -> Result<Self, DiffsolError>
Create a new matrix from a vector of triplets (i, j, value) where i and j are the row and column indices of the value
Source§fn gemv(&self, alpha: Self::T, x: &Self::V, beta: Self::T, y: &mut Self::V)
fn gemv(&self, alpha: Self::T, x: &Self::V, beta: Self::T, y: &mut Self::V)
Perform a matrix-vector multiplication
y = alpha * self * x + beta * y
.Source§fn zeros(nrows: IndexType, ncols: IndexType, ctx: Self::C) -> Self
fn zeros(nrows: IndexType, ncols: IndexType, ctx: Self::C) -> Self
Create a new matrix of shape
nrows
x ncols
filled with zerosSource§fn from_diagonal(v: &FaerVec<T>) -> Self
fn from_diagonal(v: &FaerVec<T>) -> Self
Create a new diagonal matrix from a Vector holding the diagonal elements
fn partition_indices_by_zero_diagonal( &self, ) -> (<Self::V as Vector>::Index, <Self::V as Vector>::Index)
Source§fn set_column(&mut self, j: IndexType, v: &Self::V)
fn set_column(&mut self, j: IndexType, v: &Self::V)
sets the values of column
j
to be equal to the values in v
For sparse matrices, only the existing non-zero elements are updatedSource§fn scale_add_and_assign(&mut self, x: &Self, beta: Self::T, y: &Self)
fn scale_add_and_assign(&mut self, x: &Self, beta: Self::T, y: &Self)
Perform the assignment self = x + beta * y where x and y are matrices and beta is a scalar
Panics if the sparsity of self, x, and y do not match (i.e. sparsity of self must be the union of the sparsity of x and y)
Source§fn new_from_sparsity(
nrows: IndexType,
ncols: IndexType,
sparsity: Option<Self::Sparsity>,
ctx: Self::C,
) -> Self
fn new_from_sparsity( nrows: IndexType, ncols: IndexType, sparsity: Option<Self::Sparsity>, ctx: Self::C, ) -> Self
Create a new matrix from a sparsity pattern, the non-zero elements are not initialized
fn is_sparse() -> bool
Source§fn split(
&self,
algebraic_indices: &<Self::V as Vector>::Index,
) -> [(Self, <Self::V as Vector>::Index); 4]
fn split( &self, algebraic_indices: &<Self::V as Vector>::Index, ) -> [(Self, <Self::V as Vector>::Index); 4]
Split the matrix into four submatrices, based on the indices in
algebraic_indices
Read morefn combine( ul: &Self, ur: &Self, ll: &Self, lr: &Self, algebraic_indices: &<Self::V as Vector>::Index, ) -> Self
Source§impl<T: Scalar> MatrixCommon for FaerSparseMat<T>
impl<T: Scalar> MatrixCommon for FaerSparseMat<T>
Source§impl<T: Scalar> MatrixSparsity<FaerSparseMat<T>> for SymbolicSparseColMat<IndexType>
impl<T: Scalar> MatrixSparsity<FaerSparseMat<T>> for SymbolicSparseColMat<IndexType>
fn union( self, other: SymbolicSparseColMatRef<'_, IndexType>, ) -> Result<SymbolicSparseColMat<IndexType>, DiffsolError>
fn as_ref(&self) -> SymbolicSparseColMatRef<'_, IndexType>
fn nrows(&self) -> IndexType
fn ncols(&self) -> IndexType
fn is_sparse() -> bool
fn indices(&self) -> Vec<(IndexType, IndexType)>
fn new_diagonal(n: IndexType) -> Self
fn try_from_indices( nrows: IndexType, ncols: IndexType, indices: Vec<(IndexType, IndexType)>, ) -> Result<Self, DiffsolError>
fn get_index( &self, indices: &[(IndexType, IndexType)], ctx: FaerContext, ) -> <<FaerSparseMat<T> as MatrixCommon>::V as Vector>::Index
Source§impl<'a, T: Scalar> MatrixSparsityRef<'a, FaerSparseMat<T>> for SymbolicSparseColMatRef<'a, IndexType>
impl<'a, T: Scalar> MatrixSparsityRef<'a, FaerSparseMat<T>> for SymbolicSparseColMatRef<'a, IndexType>
fn to_owned(&self) -> SymbolicSparseColMat<IndexType>
fn nrows(&self) -> IndexType
fn ncols(&self) -> IndexType
fn is_sparse() -> bool
fn split( &self, indices: &<<FaerSparseMat<T> as MatrixCommon>::V as Vector>::Index, ) -> [(SymbolicSparseColMat<IndexType>, <<FaerSparseMat<T> as MatrixCommon>::V as Vector>::Index); 4]
fn indices(&self) -> Vec<(IndexType, IndexType)>
Source§impl<T: Scalar> Sub<&FaerSparseMat<T>> for FaerSparseMat<T>
impl<T: Scalar> Sub<&FaerSparseMat<T>> for FaerSparseMat<T>
Source§type Output = FaerSparseMat<T>
type Output = FaerSparseMat<T>
The resulting type after applying the
-
operator.Auto Trait Implementations§
impl<T> Freeze for FaerSparseMat<T>
impl<T> RefUnwindSafe for FaerSparseMat<T>where
T: RefUnwindSafe,
impl<T> Send for FaerSparseMat<T>
impl<T> Sync for FaerSparseMat<T>
impl<T> Unpin for FaerSparseMat<T>where
T: Unpin,
impl<T> UnwindSafe for FaerSparseMat<T>where
T: 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
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>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§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 moreSource§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).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.