37 #ifndef GMM_ITER_SOLVERS_H__
38 #define GMM_ITER_SOLVERS_H__
50 template <
typename FUNC,
typename T>
52 T tol = gmm::default_tol(T())) {
53 T c, Ga = G(a), Gb = G(b), Gc, d;
56 for (
int i = 0; i < 4; i++) {
57 if (d < tol)
return (b + a) / 2.0;
58 c = b - Gb * (b - a) / (Gb - Ga); Gc = G(c);
59 a = b; b = c; Ga = Gb; Gb = Gc;
63 while (Ga * Gb > 0.0) {
64 if (d < tol)
return (b + a) / 2.0;
65 c = b - Gb * (b - a) / (Gb - Ga); Gc = G(c);
66 a = b; b = c; Ga = Gb; Gb = Gc;
70 c = std::max(a, b); a = std::min(a, b); b = c;
72 c = b - (b - a) * (Gb / (Gb - Ga));
76 if (Gc*Gb > 0) { b = c; Gb = Gc; }
else { a = c; Ga = Gc; }
77 c = (b + a) / 2.0 ; Gc = G(c);
78 if (Gc*Gb > 0) { b = c; Gb = Gc; }
else { a = c; Ga = Gc; }
79 d = gmm::abs(b - a); c = (b + a) / 2.0;
if ((c == a) || (c == b)) d = 0.0;
105 #include "gmm_least_squares_cg.h"
T find_root(const FUNC &G, T a=T(0), T b=T(1), T tol=gmm::default_tol(T()))
mixed method to find a zero of a real function G, a priori between a and b.
Modified Gram-Schmidt orthogonalization.
Diagonal matrix preconditoner.
Incomplete Level 0 ILDLT Preconditioner.
incomplete LDL^t (cholesky) preconditioner with fill-in and threshold.
Incomplete LU without fill-in Preconditioner.
ILUT: Incomplete LU with threshold and K fill-in Preconditioner.
ILUTP: Incomplete LU with threshold and K fill-in Preconditioner and column pivoting.
Approximate inverse via MR iteration.
Implements BFGS (Broyden, Fletcher, Goldfarb, Shanno) algorithm.
BiCGStab iterative solver.
Conjugate gradient iterative solver.
Constrained conjugate gradient.
GMRES (Generalized Minimum Residual) iterative solver.
Quasi-Minimal Residual iterative solver.
Solve triangular linear system for dense matrices.