1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
//! Iterative solvers for linear systems
//!
//! This module provides iterative methods for solving large linear systems Ax = b,
//! which are more efficient than direct methods for sparse or very large matrices.
//!
//! # Available Solvers
//!
//! - **Conjugate Gradient (CG)**: For symmetric positive definite systems
//! - **Preconditioned CG (PCG)**: CG with various preconditioners
//! - **GMRES**: For general non-symmetric systems
//! - **FGMRES**: Flexible GMRES with variable preconditioning
//! - **BiCGSTAB**: For non-symmetric systems with better stability
//! - **MINRES**: For symmetric indefinite systems
//!
//! # Preconditioners
//!
//! - **Identity**: No preconditioning
//! - **Jacobi**: Diagonal scaling
//! - **SSOR**: Symmetric Successive Over-Relaxation
//! - **Incomplete Cholesky (IC(0))**: For SPD matrices
//! - **Custom**: User-provided preconditioner function
//!
//! # Iterative Refinement
//!
//! For improving solutions from direct solvers or iterative methods.
//!
//! # Examples
//!
//! ```
//! use numrs2::prelude::*;
//! use numrs2::linalg::iterative_solvers::*;
//!
//! // Solve Ax = b using Conjugate Gradient
//! let a = Array::from_vec(vec![
//! 4.0, 1.0,
//! 1.0, 3.0,
//! ]).reshape(&[2, 2]);
//! let b = Array::from_vec(vec![1.0, 2.0]);
//!
//! let result = conjugate_gradient(&a, &b, None, Some(1e-6), Some(100));
//! assert!(result.is_ok());
//! ```
// Submodules
// Re-export core types
pub use ;
// Re-export helper functions (for internal use and testing)
pub use ;
// Re-export Conjugate Gradient methods
pub use ;
// Re-export GMRES methods
pub use ;
// Re-export BiCGSTAB
pub use bicgstab;
// Re-export MINRES
pub use minres;
// Re-export preconditioners
pub use ;
// Re-export iterative refinement
pub use ;