Search code examples
c++linear-algebranumerical-methodslong-double

Favorite/Best A.X=B Solver that Supports Long Doubles?


I am hoping to repeatedly hammer an X=B(A^-1) problem. That is, solve a linear system. For C++, which numerical solvers have support for 128bit long doubles (quads)?

Using C style arrays is a major plus as all my 2D data is stored as a single std::vector.

I was hoping to compile the code on linux with either GCC or ICC.


Solution

  • Many C++ linear algebra libraries are based on templates, including NT2, Boost.uBLAS, Eigen (see What are the most widely used C++ vector/matrix math/linear algebra libraries, and their cost and benefit tradeoffs? for links). Thus, they should be able to support quads if your compiler/library can do maths with quads. For instance, in Eigen the type Eigen::Matrix<long double, Dynamic, Dynamic> denotes a matrix of arbitrary size containing long doubles, and you can use the standard functions to solve with such matrices.