Skip to content

Revise common/math.h #3777

@jhale

Description

@jhale

Related to #3770

https://github.com/FEniCS/dolfinx/blob/main/cpp/dolfinx/common/math.h

  • fma is not available for all types, e.g. boost high precision.
template <typename T>
concept has_std_fma = requires(T a, T b, T c) {
    { std::fma(a, b, c) } -> std::convertible_to<T>;
};

// Implement fallback
  • Some functions e.g. det have branches based on size that may be known at compile-time.
  • det(Matrix A) specialisation is possible unused.
  • All functions have overly general template types, add concepts?
  • Some functions could be removed completely with C++26 linear algebra support.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions