Ticket #3676: trac3676-bitset_pxd.patch
| File trac3676-bitset_pxd.patch, 3.8 KB (added by rlm, 20 months ago) |
|---|
-
sage/groups/perm_gps/partn_ref/tree_traversal.pxd
# HG changeset patch # User Robert L. Miller <rlm@rlmiller.org> # Date 1217364116 25200 # Node ID a01f7f19d0d48acdcc60511f47908653d05e7eae # Parent 63bfd503aaba9c0e6a4046ddb88e1566e387733a Split up bitset.pxi to allow use in pxd files. diff -r 63bfd503aaba -r a01f7f19d0d4 sage/groups/perm_gps/partn_ref/tree_traversal.pxd
a b 8 8 9 9 include '../../../ext/cdefs.pxi' 10 10 include '../../../ext/stdsage.pxi' 11 include '../../../misc/bitset_pxd.pxi' 12 11 13 from sage.rings.integer cimport Integer 12 14 13 15 cdef struct OrbitPartition: … … 50 52 cdef inline bint PS_is_fixed(PartitionStack *, int) 51 53 cdef inline int PS_clear(PartitionStack *) 52 54 cdef inline int PS_split_point(PartitionStack *, int) 53 #cdef inline int PS_first_smallest(PartitionStack *, bitset_t)55 cdef inline int PS_first_smallest(PartitionStack *, bitset_t) 54 56 cdef inline int PS_get_perm_from(PartitionStack *, PartitionStack *, int *) 55 57 56 58 cdef inline int split_point_and_refine(PartitionStack *, int, object, -
sage/misc/bitset.pxi
diff -r 63bfd503aaba -r a01f7f19d0d4 sage/misc/bitset.pxi
a b 16 16 17 17 18 18 # This is a .pxi file so that one can inline functions. Doctests in misc_c. 19 20 include "../ext/stdsage.pxi"21 22 cdef extern from *:23 void *memset(void *, int, size_t)24 void *memcpy(void *, void *, size_t)25 int memcmp(void *, void *, size_t)26 size_t strlen(char *)27 28 # constant literals29 int index_shift "(sizeof(unsigned long)==8 ? 6 : 5)"30 unsigned long offset_mask "(sizeof(unsigned long)==8 ? 0x3F : 0x1F)"31 32 cdef struct bitset_s:33 long size34 long limbs35 unsigned long *bits36 37 ctypedef bitset_s bitset_t[1]38 19 39 20 ############################################################################# 40 21 # Bitset Initalization -
(a) /dev/null vs. (b) b/sage/misc/bitset_pxd.pxi
diff -r 63bfd503aaba -r a01f7f19d0d4 sage/misc/bitset_pxd.pxi
a b 1 #***************************************************************************** 2 # Copyright (C) 2008 Robert Bradshaw <robertwb@math.washington.edu> 3 # 4 # Distributed under the terms of the GNU General Public License (GPL) 5 # 6 # This code is distributed in the hope that it will be useful, 7 # but WITHOUT ANY WARRANTY; without even the implied warranty of 8 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 9 # General Public License for more details. 10 # 11 # The full text of the GPL is available at: 12 # 13 # http://www.gnu.org/licenses/ 14 #***************************************************************************** 15 16 17 18 # This is a .pxi file so that one can inline functions. Doctests in misc_c. 19 20 include "../ext/stdsage.pxi" 21 22 cdef extern from *: 23 void *memset(void *, int, size_t) 24 void *memcpy(void *, void *, size_t) 25 int memcmp(void *, void *, size_t) 26 size_t strlen(char *) 27 28 # constant literals 29 int index_shift "(sizeof(unsigned long)==8 ? 6 : 5)" 30 unsigned long offset_mask "(sizeof(unsigned long)==8 ? 0x3F : 0x1F)" 31 32 cdef struct bitset_s: 33 long size 34 long limbs 35 unsigned long *bits 36 37 ctypedef bitset_s bitset_t[1] 38 -
sage/misc/misc_c.pyx
diff -r 63bfd503aaba -r a01f7f19d0d4 sage/misc/misc_c.pyx
a b 277 277 # Bitset Testing 278 278 ############################################################################# 279 279 280 include "bitset_pxd.pxi" 280 281 include "bitset.pxi" 281 282 282 283 def test_bitset(py_a, py_b, long n):
