3

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.

Gabe
  • 79,868
  • 10
  • 131
  • 226
Mikhail
  • 7,123
  • 9
  • 56
  • 121
  • 1
    I think the 128bit aspect might be an issue. Most efficient lin alg packages (i.e. lapack and it's kin) achieve their high performance by calling to a blas library (like the intel mkl or the amd acml, etc). I've only seen blas libraries with support for single and double precision, not quad. Also, does your hardware support quad precision?? – Darren Engwirda Jun 28 '11 at 06:09
  • Well, the compiler seems to be able to use them for simple arithmetic. xmm has 128 bits right? I am using a Q6600 Intel processor at home and never expect to support anything earlier. – Mikhail Jun 28 '11 at 08:47
  • 3
    If you're talking about the xmm registers from the sse2 instruction set, then yes they are 128 bits wide, but no they are not quad precision, they offer 'vectorised' floating point operations, i.e. operating on 4 single's or 2 double's via a single asm instruction. Good blas libraries make use of sse2/sse3/sse4 etc. – Darren Engwirda Jun 28 '11 at 09:00

1 Answers1

4

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.

Community
  • 1
  • 1
Jitse Niesen
  • 4,292
  • 22
  • 22
  • Well, these appear to be sparse matrix solvers. So its not quite what I was looking for. Thanks for the help anyways! – Mikhail Jul 03 '11 at 07:56