MTL5 -- Matrix Template Library C++ API
mtl:: -- C++20 header-only linear algebra for mixed-precision algorithm design
Loading...
Searching...
No Matches
mtl::FieldVector Concept Reference

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>

Concept definition

template<typename T>
A vector whose elements form a FIELD – the requirement of every algorithm that divides by a vector el...
Definition vector.hpp:29
A type that forms a mathematical field: division is defined AND invertible.
Definition scalar.hpp:48
A 1D collection with indexed access.
Definition vector.hpp:11

Detailed Description

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.