I'm trying to to numerically integrate a particularly nasty class of functions, for which initially i was using GSL, but the round off errors are too large for my desired tolerance. After a quick Google for arbitrary precision quadrature libraries i found quadpack++, which appears to do what i want, but i can't make it work, specifically i can't seem to pass a function of this form:
mpf MyClass::foo( mpf t, const mpf_array& fourier ){
// do stuf
}
as an input, which it wants in this form:
template<typename Real, class param_t>
class Function : public FtnBase<Real> {
public:
typedef Real defn_t(Real, param_t*);
defn_t& function_;
param_t* params_;
virtual Real operator() (Real x) {return function_(x, params_); }
Function(defn_t& function) : function_(function), params_(0) {}
Function(defn_t& function, param_t* params) : function_(function), params_(params) {}
~Function() {}
};
I am pretty new to C++ so it's probably something simple but i have tried every combination of pointers and std::bind i can think of based on Q1 and Q2 to no avail. Any help with this, or suggestions for better tested & documented arbitrary precision quadrature libraries would be greatly appreciated.