math icon indicating copy to clipboard operation
math copied to clipboard

Interpolations with (different) boost units

Open sebweb3r opened this issue 5 years ago • 2 comments

Hey,

we (a physics group) are using the boost math (Barycentric Rational Interpolation and others) with boost units for our code. We have the problem, that the interpolation expects the same type for x and y data. In physics we quiet often have different units.

Could you extend the templates for different types/units for x and y.

Thanks in advance.

sebweb3r avatar Feb 07 '20 12:02 sebweb3r

Yes, I think that's fine. Could you give me a main I could try to get working?

BTW, I recommend pchip or makima interpolation over barycentric rational for almost all uses (log(N) complexity rather than O(N), with less spurious oscillations).

NAThompson avatar Feb 07 '20 13:02 NAThompson

i think something like this would be nice: https://github.com/L0ric0/boostorg-mat-issue-314

it could be that i was wrong with the template arguments for boost::math::barycentric_rational<quantity<si::energy, double>, quantity<si::electric_charge, double>> but they should be the types of the axes for the function to interpolate.

L0ric0 avatar Jul 07 '20 09:07 L0ric0