Skip to content

Wrap the quadrature floating-point numbers in the macro DUNE_NUMBER_FROM_STRING

Summary

The maxima script to generate 1d quadrature rules produces two copies of the same code: one with floating point numbers, one with strings. While it is generated automatically, it is a lot of code duplication that is actually not necessary. Also for future high-precision rules, duplicating all the code is not a proper solution. This MR introduces a small helper macro that expands the argument to both, a floating point constant and a string. Additionally a helper function is introduced to convert from the two generated arguments to the output type.

Discussion

The floating-point number type is currently fixed to double. Actually, one could pass the numbers as long double by adding the literal suffix L. Unfortunately, the GMPField type does not allow to be constructed from string representations of numbers that include any suffix. Thus, one would have to workaround this, e.g., by stripping off any suffix before passing to the constructor of the number type.

Edited by Simon Praetorius

Merge request reports

Loading