passagemath-meataxe 10.6.1rc6__cp312-cp312-macosx_14_0_arm64.whl → 10.6.1rc8__cp312-cp312-macosx_14_0_arm64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of passagemath-meataxe might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: passagemath-meataxe
3
- Version: 10.6.1rc6
3
+ Version: 10.6.1rc8
4
4
  Summary: passagemath: Matrices over small finite fields with meataxe
5
5
  Author-email: The Sage Developers <sage-support@googlegroups.com>
6
6
  Maintainer: Matthias Köppe, passagemath contributors
@@ -28,7 +28,7 @@ Classifier: Programming Language :: Python :: Implementation :: CPython
28
28
  Classifier: Topic :: Scientific/Engineering :: Mathematics
29
29
  Requires-Python: <3.14,>=3.10
30
30
  Description-Content-Type: text/x-rst
31
- Requires-Dist: passagemath-modules==10.6.1rc6
31
+ Requires-Dist: passagemath-modules==10.6.1rc8
32
32
 
33
33
  ========================================================================================
34
34
  passagemath: Matrices over small finite fields with meataxe
@@ -0,0 +1,14 @@
1
+ passagemath_meataxe.dylibs/libmtx.0.dylib,sha256=Nn7YoEXc-4zAuYVxh3sIjN3_jb49Ip3ZbofqMIydX04,255904
2
+ passagemath_meataxe-10.6.1rc8.dist-info/RECORD,,
3
+ passagemath_meataxe-10.6.1rc8.dist-info/WHEEL,sha256=VrhWOWJdu4wN9IKhAFBqWPMo6yuww-SFg9GbWc0qbmI,136
4
+ passagemath_meataxe-10.6.1rc8.dist-info/top_level.txt,sha256=Kmzulf9WsphADFQuqgvdy5mvTLDj_V2zkFHU2s3UXos,6
5
+ passagemath_meataxe-10.6.1rc8.dist-info/METADATA,sha256=6Y4akB3ZLaIpgKAAWq_FzqP9sZQ0PqJWsWoe13FpEho,4241
6
+ sage/all__sagemath_meataxe.py,sha256=bJKIZgWmLYLh-2IhrpKDQMoVtc2ryVmIVkPfzZk7-og,66
7
+ sage/libs/meataxe.pxd,sha256=FqAwBUCWeeJpp4UjeWxWWhRgStywZP8jmCK0tTvxhTs,6643
8
+ sage/libs/meataxe.cpython-312-darwin.so,sha256=JgZ668kjPrswt785VHL_mJvzochs1nj9OjQ8sN0mHwc,99440
9
+ sage/libs/all__sagemath_meataxe.py,sha256=isUgdlh6SqmFirYA2LvA-IFIJXW-fyhZrXsbt3PifDY,46
10
+ sage/libs/meataxe.pyx,sha256=fRhRX3270t1cC1dRab1H2UHeCRTeMi0WjT9521gblmE,3585
11
+ sage/matrix/matrix_gfpn_dense.pyx,sha256=tLDSzmtPeBc0ZKv5Jw6FmLk3WicuSNd7CVA82EehEyc,71640
12
+ sage/matrix/all__sagemath_meataxe.py,sha256=isUgdlh6SqmFirYA2LvA-IFIJXW-fyhZrXsbt3PifDY,46
13
+ sage/matrix/matrix_gfpn_dense.cpython-312-darwin.so,sha256=mPSzZnt8SR_ZmiKesrnft-f59OL5Pwdu4JHj1cXvid8,316768
14
+ sage/matrix/matrix_gfpn_dense.pxd,sha256=IMkNNnShKEOvkr-5khmC17O0f4c6PiXvmtYc4Ka62rQ,1708
Binary file
Binary file
sage/libs/meataxe.pyx ADDED
@@ -0,0 +1,95 @@
1
+ # distutils: libraries = mtx
2
+ # sage_setup: distribution = sagemath-meataxe
3
+
4
+ # ****************************************************************************
5
+ # Copyright (C) 2017 Simon King <simon.king@uni-jena.de>
6
+ #
7
+ # This program is free software: you can redistribute it and/or modify
8
+ # it under the terms of the GNU General Public License as published by
9
+ # the Free Software Foundation, either version 2 of the License, or
10
+ # (at your option) any later version.
11
+ # https://www.gnu.org/licenses/
12
+ # ****************************************************************************
13
+
14
+ from cpython.exc cimport PyErr_SetObject
15
+ from cysignals.signals cimport sig_block, sig_unblock
16
+ cdef dict ErrMsg = {
17
+ "Not enough memory": MemoryError,
18
+ "Time limit exceeded": RuntimeError,
19
+ "Division by zero": ZeroDivisionError,
20
+ "Bad file format": OSError,
21
+ "No such file or directory": OSError,
22
+ "Bad argument": ValueError,
23
+ "Argument out of range": IndexError,
24
+
25
+ "Matrix not in echelon form": ValueError,
26
+ "Matrix not square": ArithmeticError,
27
+ "Incompatible objects": TypeError,
28
+
29
+ "Bad syntax, try `-help'": SyntaxError,
30
+ "Bad usage of option, try `-help'": ValueError,
31
+ "Bad number of arguments, try `-help'": ValueError,
32
+
33
+ "Not a matrix": TypeError,
34
+ "Not a permutation": TypeError
35
+ }
36
+
37
+
38
+ cdef Matrix_t *rawMatrix(int Field, list entries) except NULL:
39
+ """
40
+ Return a meataxe matrix.
41
+
42
+ INPUT:
43
+
44
+ - ``Field`` -- integer; the field size
45
+ - ``entries`` -- list of lists, the entries of the matrix, also
46
+ defining the matrix dimensions. It is *not* tested that all rows
47
+ in ``entries`` have the same length, and it is assumed that both
48
+ the number of rows and the number of columns is positive. All
49
+ elements are given by ints, they are automatically interpreted as
50
+ field elements.
51
+ """
52
+ cdef Matrix_t *M = MatAlloc(Field, len(entries), len(entries[0]))
53
+ cdef PTR x = M.Data
54
+ cdef int idx, i, j
55
+ cdef list dt_i
56
+ for i in range(M.Nor):
57
+ idx = 0
58
+ dt_i = entries[i]
59
+ for j in range(M.Noc):
60
+ FfInsert(x, j, FfFromInt(dt_i[j]))
61
+ FfStepPtr(&(x))
62
+ return M
63
+
64
+ ###############################################################
65
+ ## It is needed to do some initialisation. Since the meataxe
66
+ ## version used in Sage (SharedMeatAxe) is a dynamic (shared)
67
+ ## library, it sufficed to do this initialisation only once.
68
+ ## For convenience, the meataxe_init() function is called in
69
+ ## this module. Hence, `import sage.libs.meataxe` is enough
70
+ ## to make sure that MeatAxe is initialised.
71
+
72
+ from sage.cpython.string cimport str_to_bytes, char_to_str
73
+
74
+ cdef void sage_meataxe_error_handler(const MtxErrorRecord_t *err) noexcept:
75
+ sig_block()
76
+ ErrText = char_to_str(err.Text)
77
+ BaseName = char_to_str(err.FileInfo.BaseName)
78
+ LineNo = err.LineNo
79
+ PyErr_SetObject(ErrMsg.get(ErrText.split(': ')[-1], RuntimeError), f"{ErrText} in file {BaseName} (line {LineNo})")
80
+ sig_unblock()
81
+
82
+ cdef inline meataxe_init() noexcept:
83
+ ## Assign to a variable that enables MeatAxe to find
84
+ ## its multiplication tables.
85
+ global MtxLibDir
86
+ from sage import env
87
+ mtxdir = str_to_bytes(env.MTXLIB)
88
+ if len(mtxdir) >= 1024:
89
+ raise RuntimeError(f"the path for the meataxe library {mtxdir!r} is too long, it needs to be of length < 1024")
90
+ MtxLibDir[:len(mtxdir)] = mtxdir
91
+ MtxLibDir[len(mtxdir)] = c'\0'
92
+ ## Error handling for MeatAxe, to prevent immediate exit of the program
93
+ MtxSetErrorHandler(sage_meataxe_error_handler)
94
+
95
+ meataxe_init()