|
MTL5 -- Matrix Template Library C++ API
mtl:: -- C++20 header-only linear algebra for mixed-precision algorithm design
|
A vector whose elements form a FIELD – the requirement of every algorithm that divides by a vector element or by a scalar derived from one. More...
#include <vector.hpp>
A vector whose elements form a FIELD – the requirement of every algorithm that divides by a vector element or by a scalar derived from one.
The Krylov solvers in itl/ are that case (#503). Each of them computes a step length as a ratio in the element type – cg's beta = rho / rho_1 and alpha = rho / dot(p, q), and eight such ratios in qmr – so on an integral element type the division TRUNCATES and the iteration is nonsense from the first step, converging or not and returning a confident wrong answer. The integers are a ring, not a field: only 1 and -1 have inverses.
The vector counterpart of FieldMatrix, which #430 introduced for exactly this failure in the decompositions – lu_factor(dense2D<int>) used to compile and return truncated nonsense. Same defect, one level up.