@@ -90,18 +90,26 @@ from sage.ext.stdsage cimport PY_NEW
90
90
91
91
from sage.libs.flint.fmpz cimport fmpz_get_mpz, fmpz_set_mpz
92
92
from sage.libs.flint.fmpz_mat cimport fmpz_mat_entry
93
+ from sage.libs.gmp.mpz cimport mpz_set
93
94
94
95
from sage.modules.vector_modn_sparse cimport *
95
96
96
97
cimport sage.libs.linbox.givaro as givaro
97
98
cimport sage.libs.linbox.linbox as linbox
98
99
99
- from sage.libs.linbox.conversion cimport *
100
-
101
- from .matrix2 cimport Matrix
102
- cimport sage.matrix.matrix as matrix
103
- cimport sage.matrix.matrix_sparse as matrix_sparse
104
- cimport sage.matrix.matrix_dense as matrix_dense
100
+ from sage.libs.linbox.conversion cimport (get_method,
101
+ METHOD_DEFAULT,
102
+ METHOD_DENSE_ELIMINATION,
103
+ METHOD_SPARSE_ELIMINATION,
104
+ METHOD_BLACKBOX,
105
+ METHOD_WIEDEMANN,
106
+ new_linbox_matrix_modn_sparse,
107
+ new_linbox_matrix_integer_sparse,
108
+ new_linbox_vector_integer_dense,
109
+ new_sage_vector_integer_dense)
110
+
111
+ from sage.matrix.matrix_sparse cimport Matrix_sparse
112
+ from sage.matrix.matrix_dense cimport Matrix_dense
105
113
from sage.rings.finite_rings.integer_mod cimport IntegerMod_int, IntegerMod_abstract
106
114
from sage.rings.integer cimport Integer
107
115
from sage.rings.rational_field import QQ
@@ -113,14 +121,14 @@ from sage.matrix.matrix2 import Matrix as Matrix2
113
121
from .args cimport SparseEntry, MatrixArgs_init
114
122
from sage.arith.misc import is_prime
115
123
116
- cimport sage.structure.element
117
-
118
124
from sage.data_structures.binary_search cimport *
119
125
from sage.modules.vector_integer_sparse cimport *
120
126
121
127
from .matrix_integer_dense cimport Matrix_integer_dense
122
128
from sage.modules.vector_integer_dense cimport Vector_integer_dense
123
129
130
+ from sage.structure.element cimport Matrix
131
+
124
132
# ###############
125
133
# TODO: change this to use extern cdef's methods.
126
134
from sage.rings.fast_arith cimport arith_int
@@ -133,7 +141,7 @@ ai = arith_int()
133
141
# Github Issue #12679.
134
142
MAX_MODULUS = 46341
135
143
136
- cdef class Matrix_modn_sparse(matrix_sparse. Matrix_sparse):
144
+ cdef class Matrix_modn_sparse(Matrix_sparse):
137
145
def __cinit__ (self ):
138
146
nr = self ._nrows
139
147
nc = self ._ncols
@@ -257,7 +265,7 @@ cdef class Matrix_modn_sparse(matrix_sparse.Matrix_sparse):
257
265
else :
258
266
raise ValueError (" unknown matrix format" )
259
267
260
- cdef sage.structure.element. Matrix _matrix_times_matrix_(self , sage.structure.element. Matrix _right):
268
+ cdef Matrix _matrix_times_matrix_(self , Matrix _right):
261
269
"""
262
270
This code is implicitly called for multiplying self by another
263
271
sparse matrix.
@@ -336,7 +344,7 @@ cdef class Matrix_modn_sparse(matrix_sparse.Matrix_sparse):
336
344
set_entry(& ans.rows[i], j, s)
337
345
return ans
338
346
339
- def _matrix_times_matrix_dense (self , sage.structure.element. Matrix _right ):
347
+ def _matrix_times_matrix_dense (self , Matrix _right ):
340
348
"""
341
349
Multiply self by the sparse matrix _right, and return the
342
350
result as a dense matrix.
@@ -361,7 +369,7 @@ cdef class Matrix_modn_sparse(matrix_sparse.Matrix_sparse):
361
369
<class 'sage.matrix.matrix_mod2_dense.Matrix_mod2_dense'>
362
370
"""
363
371
cdef Matrix_modn_sparse right
364
- cdef matrix_dense. Matrix_dense ans
372
+ cdef Matrix_dense ans
365
373
right = _right
366
374
367
375
cdef c_vector_modint* v
@@ -871,7 +879,7 @@ cdef class Matrix_modn_sparse(matrix_sparse.Matrix_sparse):
871
879
self .cache(' det' , d)
872
880
return d
873
881
elif algorithm == ' generic' :
874
- d = matrix_sparse. Matrix_sparse.determinant(self )
882
+ d = Matrix_sparse.determinant(self )
875
883
self .cache(' det' , d)
876
884
return d
877
885
else :
@@ -949,7 +957,7 @@ cdef class Matrix_modn_sparse(matrix_sparse.Matrix_sparse):
949
957
if algorithm == " generic" :
950
958
return Matrix_sparse.solve_right(self , B)
951
959
else :
952
- if isinstance (B, sage.structure.element. Matrix):
960
+ if isinstance (B, Matrix):
953
961
from sage.matrix.special import diagonal_matrix
954
962
m, d = self ._solve_matrix_linbox(B, algorithm)
955
963
return m * diagonal_matrix([QQ((1 ,x)) for x in d])
@@ -1121,7 +1129,7 @@ cdef class Matrix_modn_sparse(matrix_sparse.Matrix_sparse):
1121
1129
from sage.modules.free_module_element import vector
1122
1130
1123
1131
cdef Matrix_integer_dense B
1124
- if not isinstance (mat, Matrix ):
1132
+ if not isinstance (mat, Matrix2 ):
1125
1133
B = < Matrix_integer_dense?> matrix(ZZ, mat, sparse = False )
1126
1134
else :
1127
1135
B = < Matrix_integer_dense?> mat.change_ring(ZZ).dense_matrix()
0 commit comments