Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • D dune-geometry
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 8
    • Issues 8
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 19
    • Merge requests 19
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Core Modules
  • dune-geometry
  • Merge requests
  • !175

Wrap the quadrature floating-point numbers in the macro DUNE_NUMBER

  • Review changes

  • Download
  • Email patches
  • Plain diff
Open Simon Praetorius requested to merge feature/number-conversion-in-quadrature-rules into master Jul 04, 2021
  • Overview 3
  • Commits 1
  • Pipelines 1
  • Changes 8

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 Jul 04, 2021 by Simon Praetorius
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: feature/number-conversion-in-quadrature-rules