Misc. Fixes to Get Quad-Double and Double-Double Data Types Working with Eigen v.3
Submitted by David
Assigned to Nobody
Link to original bugzilla bug (#276)
Version: 3.0
Description
Created attachment 174
Patch file for the changes
I have been trying to get Eigen3 to work using the quad-double and double-double data types from the QD library (http://crd.lbl.gov/~dhbailey/mpdist/). There were several cast errors that emerged from this effort. Unfortunately, the QD library also needed to be patched to make this work, so the version on the above website will not compile, but I can send the corrected files if needed. Also, I don't see what was the standard method of casting, so I used static_cast<>.
Here's the NumTraits that I used to build Eigen with the quad-double library:
namespace Eigen
{
template<> struct NumTraits<dd_real>
{
typedef dd_real Real;
typedef dd_real NonInteger;
typedef dd_real Nested;
enum {
IsComplex = 0,
IsInteger = 0,
IsSigned = 1,
RequireInitialization = 0,
ReadCost = 1,
AddCost = 1,
MulCost = 1
};
static Real epsilon() { return std::numeric_limits<dd_real>::epsilon();}
static Real dummy_precision() { return epsilon();}
static Real highest() {return std::numeric_limits<dd_real>::max();}
static Real lowest() {return -std::numeric_limits<dd_real>::max();}
};
template<> struct NumTraits<qd_real>
{
typedef qd_real Real;
typedef qd_real NonInteger;
typedef qd_real Nested;
enum {
IsComplex = 0,
IsInteger = 0,
IsSigned = 1,
RequireInitialization = 0,
ReadCost = 1,
AddCost = 1,
MulCost = 1
};
static Real epsilon() { return std::numeric_limits<qd_real>::epsilon();}
static Real dummy_precision() { return epsilon();}
static Real highest() {return std::numeric_limits<qd_real>::max();}
static Real lowest() {return -std::numeric_limits<qd_real>::max();}
};
}
Attachment 174, "Patch file for the changes":
qd_eigen.patch