Skip to content

sage.rings.real_double: Move methods using GSL to a separate extension module #32677

@mkoeppe

Description

@mkoeppe

Discussion: https://groups.google.com/g/sage-devel/c/HTN6KoqZVJQ/m/2BzAx5erBAAJ

We first replace use of some gsl functions like gsl_isnan by their C standard library counterparts, as provided by Cython's libc.math (
https://github.com/cython/cython/blob/master/Cython/Includes/libc/math.pxd)

Likewise for some uses of these functions in src/sage/plot/plot3d/implicit_surface.pyx

We move the remaining methods that use gsl functions to a new subclass RealDoubleElement_gsl, in the new module sage.rings.real_double_element_gsl.

RealDoubleElement already uses a nonstandard allocator for speed. We adjust it so that it actually creates an instance of RealDoubleElement_gsl when the module sage.rings.real_double_element_gsl can be imported.

(Making similar changes to ComplexDoubleElement is beyond the scope of this ticket. This is more complicated because gsl_complex may be a type separate from the C99 double complex type, see https://www.gnu.org/software/gsl/doc/html/complex.html)

Depends on #32682
Depends on #32675

CC: @dimpase @kiwifb @williamstein @tscrim

Component: refactoring

Author: Matthias Koeppe

Branch/Commit: 520da8f

Reviewer: François Bissey

Issue created by migration from https://trac.sagemath.org/ticket/32677

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions