Boost logo

Ublas :

Subject: Re: [ublas] Does uBLAS work with dd_real and qd_real ?
From: Paul Leopardi (paul.leopardi_at_[hidden])
Date: 2010-03-28 05:45:24


Hi Ralf,
On Saturday 27 March 2010 05:45:05 Ralf Denzer wrote:
> PS: I set the values of all 4 doubles in
> the constructor explicitely to zero. This was
> needed for vector.clear() and matrix.clear().

That's exactly my issue. I have now contacted David H. Bailey and have suggested
the following patch to qd-2.3.9.
Best, Paul

diff -Nrup qd-2.3.9/include/qd/dd_real.h qd-2.3.9-patched/include/qd/dd_real.h
--- qd-2.3.9/include/qd/dd_real.h 2009-05-12 03:45:05.000000000 +1000
+++ qd-2.3.9-patched/include/qd/dd_real.h 2010-03-27 19:27:21.000000000 +1100
@@ -63,7 +63,7 @@ struct QD_API dd_real {
   double x[2];
 
   dd_real(double hi, double lo) { x[0] = hi; x[1] = lo; }
- dd_real() {}
+ dd_real() : x() { }
   dd_real(double h) { x[0] = h; x[1] = 0.0; }
   dd_real(int h) {
     x[0] = (static_cast<double>(h));
diff -Nrup qd-2.3.9/include/qd/qd_inline.h qd-2.3.9-patched/include/qd/qd_inline.h
--- qd-2.3.9/include/qd/qd_inline.h 2009-05-12 03:45:05.000000000 +1000
+++ qd-2.3.9-patched/include/qd/qd_inline.h 2010-03-27 20:02:27.000000000 +1100
@@ -40,7 +40,7 @@ inline qd_real::qd_real(double x0) {
   x[1] = x[2] = x[3] = 0.0;
 }
 
-inline qd_real::qd_real() { }
+inline qd_real::qd_real() : x() { }
 
 inline qd_real::qd_real(const dd_real &a) {
   x[0] = a._hi();