Skip to content

Commit

Permalink
Trac #18519: Remove cdefs.pxi from .pxd/.pxi files
Browse files Browse the repository at this point in the history
To continue #18455, we remove `cdefs.pxi` from all `.pxi`/`.pxd` files.

We also fold `fplll.pxi` and `singular-cdefs.pxi` in the corresponding
`.pxd` files.

URL: http://trac.sagemath.org/18519
Reported by: jdemeyer
Ticket author(s): Jeroen Demeyer
Reviewer(s): Marc Mezzarobba
  • Loading branch information
Release Manager authored and vbraun committed May 31, 2015
2 parents 56643b7 + 11bd576 commit e65a4af
Show file tree
Hide file tree
Showing 61 changed files with 1,451 additions and 1,408 deletions.
3 changes: 2 additions & 1 deletion src/c_lib/include/ntl_wrap.h
@@ -1,3 +1,5 @@
#include <gmp.h>

#ifdef __cplusplus
#include <NTL/ZZ.h>
#include <NTL/ZZX.h>
Expand All @@ -20,7 +22,6 @@
#include <NTL/mat_GF2E.h>
#include <NTL/HNF.h>
#include <NTL/LLL.h>
#include <gmp.h>
using namespace NTL;
#endif

Expand Down
3 changes: 2 additions & 1 deletion src/sage/crypto/boolean_function.pyx
Expand Up @@ -26,8 +26,9 @@ AUTHOR:
"""

from sage.structure.sage_object cimport SageObject
from libc.string cimport memcpy

from sage.structure.sage_object cimport SageObject
from sage.rings.integer_ring import ZZ
from sage.rings.integer cimport Integer
from sage.rings.finite_rings.constructor import GF
Expand Down
2 changes: 1 addition & 1 deletion src/sage/data_structures/bitset.pxi
Expand Up @@ -25,8 +25,8 @@ AUTHORS:
# http://www.gnu.org/licenses/
#*****************************************************************************

include 'sage/ext/cdefs.pxi'
include 'sage/ext/stdsage.pxi'
from libc.string cimport strlen
from sage.libs.gmp.mpn cimport *
from sage.data_structures.bitset cimport *
from cython.operator import preincrement as preinc
Expand Down
1 change: 0 additions & 1 deletion src/sage/data_structures/bounded_integer_sequences.pyx
Expand Up @@ -107,7 +107,6 @@ AUTHORS:
# http://www.gnu.org/licenses/
#*****************************************************************************

include "sage/ext/cdefs.pxi"
include "sage/ext/interrupt.pxi"
include 'sage/data_structures/bitset.pxi'

Expand Down
4 changes: 1 addition & 3 deletions src/sage/ext/multi_modular.pxd
@@ -1,10 +1,8 @@
# distutils: libraries = gmp
# distutils: extra_compile_args = -std=c99

include "sage/ext/cdefs.pxi"

from sage.ext.mod_int cimport *
from sage.rings.integer import Integer
from sage.libs.gmp.types cimport mpz_t
from sage.rings.integer cimport Integer

cdef class MultiModularBasis_base:
Expand Down
2 changes: 1 addition & 1 deletion src/sage/ext/multi_modular.pyx
Expand Up @@ -15,7 +15,7 @@ Utility classes for multi-modular algorithms
include "sage/ext/interrupt.pxi"
include "sage/ext/stdsage.pxi"


from sage.libs.gmp.mpz cimport *
from sage.rings.integer_ring import ZZ
from sage.rings.arith import random_prime
from types import GeneratorType
Expand Down
15 changes: 10 additions & 5 deletions src/sage/graphs/base/sparse_graph.pyx
Expand Up @@ -185,13 +185,18 @@ working on a general-purpose Cython-based red black tree, which would be optimal
for both of these uses.
"""

#*******************************************************************************
# Copyright (C) 2008-9 Robert L. Miller <rlmillster@gmail.com>
#*****************************************************************************
# Copyright (C) 2008-9 Robert L. Miller <rlmillster@gmail.com>
#
# Distributed under the terms of the GNU General Public License (GPL)
# http://www.gnu.org/licenses/
#*******************************************************************************
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
# http://www.gnu.org/licenses/
#*****************************************************************************


from libc.string cimport memset
include 'sage/data_structures/bitset.pxi'

cdef enum:
Expand Down
18 changes: 11 additions & 7 deletions src/sage/graphs/base/static_sparse_graph.pyx
Expand Up @@ -150,18 +150,22 @@ These functions are available so that Python modules from Sage can call the
Cython routines this module implements (as they can not directly call methods
with C arguments).
"""
include "sage/data_structures/bitset.pxi"
cimport cpython

##############################################################################
#*****************************************************************************
# Copyright (C) 2010 Nathann Cohen <nathann.cohen@gmail.com>
# Distributed under the terms of the GNU General Public License (GPL)
# The full text of the GPL is available at:
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
# http://www.gnu.org/licenses/
##############################################################################
#*****************************************************************************

from sage.graphs.base.c_graph cimport CGraph
include "sage/data_structures/bitset.pxi"
cimport cpython
from libc.string cimport memset
from libc.stdint cimport INT32_MAX
from sage.graphs.base.c_graph cimport CGraph
from static_sparse_backend cimport StaticSparseCGraph
from static_sparse_backend cimport StaticSparseBackend

Expand Down
1 change: 1 addition & 0 deletions src/sage/graphs/centrality.pyx
Expand Up @@ -18,6 +18,7 @@ include "sage/data_structures/bitset.pxi"
include "sage/ext/interrupt.pxi"

from sage.graphs.base.static_sparse_graph cimport *
from libc.string cimport memset
from libc.stdint cimport uint32_t
from sage.libs.gmp.mpq cimport *
from sage.rings.rational cimport Rational
Expand Down
12 changes: 8 additions & 4 deletions src/sage/graphs/distances_all_pairs.pyx
Expand Up @@ -136,14 +136,18 @@ Functions
---------
"""

##############################################################################
#*****************************************************************************
# Copyright (C) 2011 Nathann Cohen <nathann.cohen@gmail.com>
# Distributed under the terms of the GNU General Public License (GPL)
# The full text of the GPL is available at:
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
# http://www.gnu.org/licenses/
##############################################################################
#*****************************************************************************

include "sage/data_structures/binary_matrix.pxi"
from libc.string cimport memset
from libc.stdint cimport uint64_t, uint32_t, INT32_MAX, UINT32_MAX
from sage.graphs.base.c_graph cimport CGraphBackend
from sage.graphs.base.c_graph cimport CGraph
Expand Down
14 changes: 9 additions & 5 deletions src/sage/graphs/hyperbolicity.pyx
Expand Up @@ -150,14 +150,18 @@ Methods
-------
"""

###############################################################################
# Copyright (C) 2012 David Coudert <david.coudert@inria.fr>
#*****************************************************************************
# Copyright (C) 2012 David Coudert <david.coudert@inria.fr>
#
# Distributed under the terms of the GNU General Public License (GPL)
# http://www.gnu.org/licenses/
###############################################################################
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
# http://www.gnu.org/licenses/
#*****************************************************************************

# imports
from libc.string cimport memset
from sage.graphs.graph import Graph
from sage.graphs.distances_all_pairs cimport c_distances_all_pairs
from sage.rings.arith import binomial
Expand Down
Expand Up @@ -99,12 +99,16 @@ REFERENCE:
"""

#*****************************************************************************
# Copyright (C) 2006 - 2011 Robert L. Miller <rlmillster@gmail.com>
# Copyright (C) 2006 - 2011 Robert L. Miller <rlmillster@gmail.com>
#
# Distributed under the terms of the GNU General Public License (GPL)
# http://www.gnu.org/licenses/
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
# http://www.gnu.org/licenses/
#*****************************************************************************

from libc.string cimport memcmp, memcpy
include 'data_structures_pyx.pxi' # includes bitsets
include 'sage/ext/interrupt.pxi'

Expand Down
15 changes: 9 additions & 6 deletions src/sage/groups/perm_gps/partn_ref/data_structures_pyx.pxi
Expand Up @@ -19,16 +19,19 @@ REFERENCES:
#*****************************************************************************
# Copyright (C) 2006 - 2011 Robert L. Miller <rlmillster@gmail.com>
#
# Distributed under the terms of the GNU General Public License (GPL)
# http://www.gnu.org/licenses/
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
# http://www.gnu.org/licenses/
#*****************************************************************************

include 'sage/data_structures/bitset.pxi'
from libc.math cimport log, ceil
from libc.string cimport memcpy, memset

cdef extern from "math.h":
float log(float x)
float ceil(float x)
include 'sage/data_structures/bitset.pxi'

from sage.libs.gmp.mpz cimport *
from sage.groups.perm_gps.permgroup import PermutationGroup
from sage.rings.integer cimport Integer
from sage.groups.perm_gps.partn_ref2.refinement_generic cimport PartitionRefinement_generic
Expand Down
10 changes: 7 additions & 3 deletions src/sage/groups/perm_gps/partn_ref/refinement_matrices.pyx
Expand Up @@ -16,12 +16,16 @@ REFERENCE:
"""

#*****************************************************************************
# Copyright (C) 2006 - 2011 Robert L. Miller <rlmillster@gmail.com>
# Copyright (C) 2006 - 2011 Robert L. Miller <rlmillster@gmail.com>
#
# Distributed under the terms of the GNU General Public License (GPL)
# http://www.gnu.org/licenses/
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
# http://www.gnu.org/licenses/
#*****************************************************************************

from libc.string cimport memcmp
include 'data_structures_pyx.pxi' # includes bitsets

from sage.misc.misc import uniq
Expand Down

0 comments on commit e65a4af

Please sign in to comment.