pub struct IterSolver<T: Scalar> { /* private fields */ }Expand description
RAII handle for the AOCL-Sparse iterative-solver suite.
Configure the solver type and tolerances with IterSolver::set_option
(e.g. set_option("iterative method", "cg") or "gmres"), then call
IterSolver::solve with the system matrix and right-hand side.
Implementations§
Source§impl<T: Scalar> IterSolver<T>
impl<T: Scalar> IterSolver<T>
Sourcepub fn set_option(&mut self, name: &str, value: &str) -> Result<()>
pub fn set_option(&mut self, name: &str, value: &str) -> Result<()>
Set a string-keyed solver option. See AOCL-Sparse’s
aoclsparse_itsol_option_set for the full option list. Common
keys: "iterative method" ("cg"/"gmres"/"pcg"), "cg iteration limit", "cg rel tolerance", "gmres preconditioner".
Sourcepub fn solve(
&mut self,
mat: &SparseMatrix<T>,
descr: &MatDescr,
b: &[T],
x: &mut [T],
) -> Result<Box<[T; 100]>>where
T: Default,
pub fn solve(
&mut self,
mat: &SparseMatrix<T>,
descr: &MatDescr,
b: &[T],
x: &mut [T],
) -> Result<Box<[T; 100]>>where
T: Default,
Solve A · x = b. On entry x should hold an initial guess (zero
is fine if you have nothing better); on success it contains the
approximate solution. Returns the solver’s rinfo[100] array of
statistics (iteration counts, residual norms, etc.).
Trait Implementations§
Source§impl<T: Scalar> Debug for IterSolver<T>
impl<T: Scalar> Debug for IterSolver<T>
Auto Trait Implementations§
impl<T> Freeze for IterSolver<T>
impl<T> RefUnwindSafe for IterSolver<T>where
T: RefUnwindSafe,
impl<T> !Send for IterSolver<T>
impl<T> !Sync for IterSolver<T>
impl<T> Unpin for IterSolver<T>where
T: Unpin,
impl<T> UnsafeUnpin for IterSolver<T>
impl<T> UnwindSafe for IterSolver<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