Struct FaerSparseMat

Source
pub struct FaerSparseMat<T: Scalar> { /* private fields */ }

Trait Implementations§

Source§

impl<T: Scalar> Add<&FaerSparseMat<T>> for FaerSparseMat<T>

Source§

type Output = FaerSparseMat<T>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &FaerSparseMat<T>) -> Self::Output

Performs the + operation. Read more
Source§

impl<T: Clone + Scalar> Clone for FaerSparseMat<T>

Source§

fn clone(&self) -> FaerSparseMat<T>

Returns a copy 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<T: Debug + Scalar> Debug for FaerSparseMat<T>

Source§

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

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

impl<T: Scalar> DefaultSolver for FaerSparseMat<T>

Source§

impl<T: Scalar> LinearSolver<FaerSparseMat<T>> for FaerSparseLU<T>

Source§

fn set_linearisation<C: NonLinearOpJacobian<T = T, V = FaerVec<T>, M = FaerSparseMat<T>>>( &mut self, op: &C, x: &FaerVec<T>, t: T, )

Source§

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, )

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>

Solve the problem Ax = b and return the solution x. panics if Self::set_linearisation has not been called previously
Source§

impl<T: Scalar> Matrix for FaerSparseMat<T>

Source§

type Sparsity = SymbolicSparseColMat<Own<usize>>

Source§

type SparsityRef<'a> = SymbolicSparseColMat<Ref<'a, usize>>

Source§

fn sparsity(&self) -> Option<Self::SparsityRef<'_>>

Return sparsity information (None if the matrix is dense)
Source§

fn context(&self) -> &FaerContext

Source§

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

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

fn add_column_to_vector(&self, j: IndexType, v: &mut Self::V)

Source§

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>

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)

Perform a matrix-vector multiplication y = alpha * self * x + beta * y.
Source§

fn zeros(nrows: IndexType, ncols: IndexType, ctx: Self::C) -> Self

Create a new matrix of shape nrows x ncols filled with zeros
Source§

fn copy_from(&mut self, other: &Self)

Copy the contents of other into self
Source§

fn from_diagonal(v: &FaerVec<T>) -> Self

Create a new diagonal matrix from a Vector holding the diagonal elements
Source§

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)

sets the values of column j to be equal to the values in v For sparse matrices, only the existing non-zero elements are updated
Source§

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

Create a new matrix from a sparsity pattern, the non-zero elements are not initialized
Source§

fn is_sparse() -> bool

Source§

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

fn 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>

Source§

impl<T: Scalar> MatrixSparsity<FaerSparseMat<T>> for SymbolicSparseColMat<IndexType>

Source§

impl<'a, T: Scalar> MatrixSparsityRef<'a, FaerSparseMat<T>> for SymbolicSparseColMatRef<'a, IndexType>

Source§

impl<'a, T: Scalar> Mul<Scale<T>> for &FaerSparseMat<T>

Source§

type Output = FaerSparseMat<T>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Scale<T>) -> Self::Output

Performs the * operation. Read more
Source§

impl<'a, T: Scalar> Mul<Scale<T>> for FaerSparseMat<T>

Source§

type Output = FaerSparseMat<T>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Scale<T>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: Scalar> Sub<&FaerSparseMat<T>> for FaerSparseMat<T>

Source§

type Output = FaerSparseMat<T>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &FaerSparseMat<T>) -> Self::Output

Performs the - operation. Read more

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> 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> ByRef<T> for T

Source§

fn by_ref(&self) -> &T

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> DistributionExt for T
where T: ?Sized,

Source§

fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> T
where Self: Distribution<T>,

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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

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

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<M, Rhs, Output> MatrixOpsByValue<Rhs, Output> for M
where M: MatrixCommon + Add<Rhs, Output = Output> + Sub<Rhs, Output = Output>,

Source§

impl<RefT, M> MatrixRef<M> for RefT
where M: MatrixCommon, RefT: Mul<Scale<<M as MatrixCommon>::T>, Output = M>,