pub struct FixedKluMatrix<I: KluIndex, D: KluData> { /* private fields */ }
Expand description

A compressed column form SparsMatrix whose shape is fixed

Implementations

Obtain the allocation of the matrix data This function can be used with [from_raw] and KluMatrixSpec::reinit to reuse a matrix allocation.

Safety

This function invalidates any pointers into the matrix

Constructs a new matrix for the provided KluMatrixSpec<I>. alloc is used to store the data. If not enough space is available alloc is resized as required.

The matrix is always intially filled with zeros no matter the previous content of alloc

Returns

the constructed matrix if the matrix is not empty. If the matrix is empty None is retruned instead

Constructs a new matrix for the provided KluMatrixSpec<I> by allocating space where the data can be stored.

The matrix is intially filled with zeros.

Returns

the constructed matrix if the matrix is not empty. If the matrix is empty None is retruned instead

Returns a pointer to the matrix data

Safety

The returned pointer must never be dereferenced. Turing this data into any reference always causes undefined behaviour

This pointer point to data inside an UnsafeCell so you should use std::ptr methods to access it or turn it into &Cell<D> or &UnsafeCell<D>

Perform lu_factorization of the matrix using KLU If the matrix was already factorized previously and refactor_threshold is given, it is first attempted to refactorize the matrix. If this fails (either due to an KLU error or because the rcond is larger than the provided threshold) full factorization is preformed.

Calling to funciton is a prerequisite to calling [solve_linear_system]

solves the linear system Ax=b. The b vector is read from rhs at the beginning of the function. After the functin completes x was written into rhs

Note: This function assumes that [lu_factorize] was called first. If this is not the case this functions panics.

solves the linear system A^T x=b The b vector is read from rhs at the beginning of the function. After the functin completes x was written into rhs

Note: This function assumes that [lu_factorize] was called first. If this is not the case this functions panics.

Trait Implementations

Executes the destructor for this type. Read more

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.