Skip to content
Snippets Groups Projects

Wrap the quadrature floating-point numbers in the macro DUNE_NUMBER_FROM_STRING

Merged Simon Praetorius requested to merge feature/number-conversion-in-quadrature-rules into master
All threads resolved!

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

Pipeline #54050 passed

Pipeline passed for a93cdfc7 on feature/number-conversion-in-quadrature-rules

Approved by

Merged by Simon PraetoriusSimon Praetorius 8 months ago (Apr 25, 2024 9:58pm GMT+0800)

Merge details

  • Changes merged into master with ed77a750.
  • Deleted the source branch.

Pipeline passed for ed77a750 on master

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Timo Koch
  • Simon Praetorius added 49 commits

    added 49 commits

    • b4cf9e4f...bca0f2bf - 48 commits from branch master
    • 8548e3fa - wrap the quadrature floating-point numbers in the macro DUNE_NUMBER_FROM_STRING

    Compare with previous version

  • Simon Praetorius resolved all threads

    resolved all threads

  • Simon Praetorius changed title from Wrap the quadrature floating-point numbers in the macro DUNE_NUMBER to Wrap the quadrature floating-point numbers in the macro DUNE_NUMBER_FROM_STRING

    changed title from Wrap the quadrature floating-point numbers in the macro DUNE_NUMBER to Wrap the quadrature floating-point numbers in the macro DUNE_NUMBER_FROM_STRING

  • added 1 commit

    • f1e97692 - wrap the quadrature floating-point numbers in the macro DUNE_NUMBER_FROM_STRING

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • Simon Praetorius resolved all threads

    resolved all threads

  • Is this utility numberToString useful in your opinion? I think this MR is ready to be merged.

  • Simon Praetorius
  • Santiago Ospina De Los Ríos approved this merge request

    approved this merge request

  • Simon Praetorius resolved all threads

    resolved all threads

  • mentioned in commit ed77a750

  • Please register or sign in to reply
    Loading