sagemath/sagemath-givaro.patch
2016-03-07 07:39:14 -07:00

109 lines
5.1 KiB
Diff

Some functions were moved from linbox to givaro, and some header files were
renamed in linbox 1.4 and givaro 4.
diff -up src/sage/libs/linbox/echelonform.pxd.orig src/sage/libs/linbox/echelonform.pxd
--- src/sage/libs/linbox/echelonform.pxd.orig 2015-07-26 07:34:43.000000000 -0600
+++ src/sage/libs/linbox/echelonform.pxd 2016-02-27 10:08:25.665593617 -0700
@@ -1,23 +1,23 @@
from sage.libs.linbox.modular cimport ModDoubleField, ModDoubleFieldElement, ModFloatField, ModFloatFieldElement
from libc.stdint cimport uint64_t
-cdef extern from "linbox/matrix/blas-matrix.h" namespace "LinBox":
- cdef cppclass BlasMatrixDouble "LinBox::BlasMatrix<LinBox::Modular<double> >":
+cdef extern from "linbox/matrix/densematrix/blas-matrix.h" namespace "LinBox":
+ cdef cppclass BlasMatrixDouble "LinBox::BlasMatrix<Givaro::Modular<double> >":
BlasMatrixDouble(ModDoubleField F, uint64_t nrows, uint64_t ncols)
void setEntry(size_t i, size_t j, ModDoubleFieldElement t)
ModDoubleFieldElement &getEntry(size_t i, size_t j)
- cdef cppclass BlasMatrixFloat "LinBox::BlasMatrix<LinBox::Modular<float> >":
+ cdef cppclass BlasMatrixFloat "LinBox::BlasMatrix<Givaro::Modular<float> >":
BlasMatrixFloat(ModFloatField F, uint64_t nrows, uint64_t ncols)
void setEntry(size_t i, size_t j, ModFloatFieldElement t)
ModFloatFieldElement &getEntry(size_t i, size_t j)
cdef extern from "linbox/algorithms/echelon-form.h":
- cdef cppclass EchelonFormDomainDouble "LinBox::EchelonFormDomain<LinBox::Modular<double> >":
+ cdef cppclass EchelonFormDomainDouble "LinBox::EchelonFormDomain<Givaro::Modular<double> >":
EchelonFormDomainDouble(ModDoubleField)
int rowReducedEchelon(BlasMatrixDouble, BlasMatrixDouble)
- cdef cppclass EchelonFormDomainFloat "LinBox::EchelonFormDomain<LinBox::Modular<float> >":
+ cdef cppclass EchelonFormDomainFloat "LinBox::EchelonFormDomain<Givaro::Modular<float> >":
EchelonFormDomainFloat(ModFloatField)
int rowReducedEchelon(BlasMatrixFloat, BlasMatrixFloat)
diff -up src/sage/libs/linbox/modular.pxd.orig src/sage/libs/linbox/modular.pxd
--- src/sage/libs/linbox/modular.pxd.orig 2015-07-26 07:34:43.000000000 -0600
+++ src/sage/libs/linbox/modular.pxd 2016-02-26 20:00:09.329004419 -0700
@@ -1,10 +1,10 @@
-cdef extern from "linbox/field/modular.h":
+cdef extern from "givaro/modular-double.h":
# double
- cdef cppclass ModDoubleFieldElement "LinBox::Modular<double>::Element":
+ cdef cppclass ModDoubleFieldElement "Givaro::Modular<double>::Element":
pass
- cdef cppclass ModDoubleField "LinBox::Modular<double>":
+ cdef cppclass ModDoubleField "Givaro::Modular<double>":
ModDoubleField(int modulus)
ModDoubleFieldElement init(ModDoubleFieldElement res, int v)
ModDoubleFieldElement init(ModDoubleFieldElement res, double v)
@@ -19,11 +19,12 @@ cdef extern from "linbox/field/modular.h
bint isZero(ModDoubleFieldElement x)
+cdef extern from "givaro/modular-float.h":
# float
- cdef cppclass ModFloatFieldElement "LinBox::Modular<float>::Element":
+ cdef cppclass ModFloatFieldElement "Givaro::Modular<float>::Element":
pass
- cdef cppclass ModFloatField "LinBox::Modular<float>":
+ cdef cppclass ModFloatField "Givaro::Modular<float>":
ModFloatField(int modulus)
ModFloatFieldElement init(ModFloatFieldElement res, int v)
ModFloatFieldElement init(ModFloatFieldElement res, double v)
diff -up src/sage/libs/singular/singular.pyx.orig src/sage/libs/singular/singular.pyx
--- src/sage/libs/singular/singular.pyx.orig 2015-07-26 07:34:43.000000000 -0600
+++ src/sage/libs/singular/singular.pyx 2016-03-07 06:11:58.246631802 -0700
@@ -21,6 +21,8 @@ cdef extern from "limits.h":
long INT_MAX
long INT_MIN
+from libc.stdint cimport int64_t
+
import os
from sage.libs.singular.decl cimport intvec
@@ -157,7 +159,7 @@ cdef FFgivE si2sa_GFqGivaro(number *n, r
order = cache.objectptr.cardinality() - 1
while z:
- c = cache.objectptr.initi(c, <long>napGetCoeff(z))
+ c = cache.objectptr.initi(c, <int64_t>napGetCoeff(z))
e = napGetExpFrom(z,1, _ring)
if e == 0:
ret = cache.objectptr.add(ret, c, ret)
diff -up src/sage/rings/finite_rings/element_givaro.pxd.orig src/sage/rings/finite_rings/element_givaro.pxd
--- src/sage/rings/finite_rings/element_givaro.pxd.orig 2015-07-26 07:34:44.000000000 -0600
+++ src/sage/rings/finite_rings/element_givaro.pxd 2016-02-26 17:45:57.983303693 -0700
@@ -13,7 +13,7 @@ cdef extern from "givaro/givrandom.h":
GivRandom GivRandomSeeded "Givaro::GivRandom"(unsigned long seed)
-cdef extern from "givaro/givgfq.h":
+cdef extern from "givaro/gfq.h":
ctypedef struct intvec "std::vector<unsigned int>":
void (* push_back)(int elem)
@@ -21,7 +21,7 @@ cdef extern from "givaro/givgfq.h":
intvec intvec_factory "std::vector<unsigned int>"(int len)
-cdef extern from "givaro/givgfq.h":
+cdef extern from "givaro/gfq.h":
ctypedef struct GivaroGfq "Givaro::GFqDom<int>":
#attributes