![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
Preconditioned stabilized biconjugate gradients, for the linear systems a generator produces. More...
#include <algorithm>#include <cmath>#include <cstddef>#include <vector>#include "line/api/mc/ctmc_gmres.h"#include "line/num/number.h"#include "line/util/error.h"#include "line/util/matrix.h"Go to the source code of this file.
Classes | |
| struct | line::mc::BicgstabResult< T > |
| struct | line::mc::BicgstabMultiResult< T > |
Namespaces | |
| namespace | line |
| namespace | line::mc |
Functions | |
| template<class T> | |
| BicgstabResult< T > | line::mc::ctmc_bicgstab (const Matrix< T > &A, const std::vector< T > &b, double tol=1e-12, long maxit=0, const std::vector< T > &x0=std::vector< T >()) |
| Preconditioned stabilized biconjugate gradients, for the linear systems a generator produces. | |
| template<class T> | |
| BicgstabMultiResult< T > | line::mc::ctmc_bicgstab_multi (const Matrix< T > &A, const Matrix< T > &B, double tol=1e-12, long maxit=0) |
| Every column of B solved against the SAME equilibration, reordering and ILUT factorization, each column starting from the previous column's solution. | |
Preconditioned stabilized biconjugate gradients, for the linear systems a generator produces.
Templated port of matlab/src/api/mc/ctmc_bicgstab.m and jar/src/main/java/jline/api/mc/Ctmc_bicgstab.java. This is the short-recurrence counterpart of ctmc_gmres: work and storage per iteration are constant rather than growing with the Krylov dimension, so the method does not restart and does not lose the optimality that restarting costs GMRES. Where GMRES(m) stagnates because the useful subspace is wider than m, this converges; where it does not, GMRES(m) is the more robust of the two, hence the order in which ctmc_solve tries them.
The equilibration, the reverse Cuthill-McKee reordering and the ILUT preconditioner are those of ctmc_gmres, reused through detail::GmresPrepared rather than reimplemented, so both methods factorize the same matrix in the same order and a switch between them cannot move a reported metric for a reason other than the iteration itself.
The preconditioner is applied on the RIGHT, on the search directions p and s, so the recurrence carries the residual of the ORIGINAL system and the convergence test needs no unpreconditioning. This matches the choice made in ctmc_gmres and, as there, means the reported relres is the true relative residual rather than MATLAB's preconditioned one.
FLAG follows the MATLAB bicgstab convention: 0 converged, 1 iteration limit, 3 stagnation or divergence, 4 a scalar quantity became too small or too large to continue. ITER counts matrix-vector products with A: two per complete iteration, and one when the iteration converges at its half step, so an ODD count is normal. Counting products rather than iterations is what makes it comparable with the ITER of ctmc_gmres and across the four codebases.
GATED ON TRANSCENDENTAL ARITHMETIC, for the reason given in ctmc_gmres: the iteration stops on a residual tolerance and normalizes by a Euclidean norm, so at Rational it would run to the iteration limit with exploding denominators. The exact solve of the same system is ctmc_solve.
Definition in file ctmc_bicgstab.h.