Skip to content
This repository was archived by the owner on Feb 1, 2023. It is now read-only.

Commit 44e5151

Browse files
author
Jonathan Kliem
committed
pycodestyle
1 parent d798a42 commit 44e5151

File tree

1 file changed

+27
-19
lines changed

1 file changed

+27
-19
lines changed

src/sage/matrix/matrix_integer_dense.pyx

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,7 +1051,7 @@ cdef class Matrix_integer_dense(Matrix_dense):
10511051
10521052
- ``v`` - a free module element.
10531053
1054-
OUTPUT: The vector times matrix product v\*A.
1054+
OUTPUT: The vector times matrix product ``v*A``.
10551055
10561056
EXAMPLES::
10571057
@@ -1708,7 +1708,7 @@ cdef class Matrix_integer_dense(Matrix_dense):
17081708
alternating matrix.
17091709
17101710
Return a pair (F, C) such that the rows of C form a symplectic
1711-
basis for self and F = C \* self \* C.transpose().
1711+
basis for self and ``F = C * self * C.transpose()``.
17121712
17131713
Raise a ValueError if self is not anti-symmetric, or self is not
17141714
alternating.
@@ -2003,18 +2003,22 @@ cdef class Matrix_integer_dense(Matrix_dense):
20032003
"""
20042004
key = 'hnf-%s-%s'%(include_zero_rows,transformation)
20052005
ans = self.fetch(key)
2006-
if ans is not None: return ans
2006+
if ans is not None:
2007+
return ans
20072008

20082009
cdef Matrix_integer_dense H_m,w,U
20092010
cdef Py_ssize_t nr, nc, n, i, j
20102011
nr = self._nrows
20112012
nc = self._ncols
20122013
n = nr if nr >= nc else nc
20132014
if algorithm == 'default':
2014-
if transformation: algorithm = 'flint'
2015+
if transformation:
2016+
algorithm = 'flint'
20152017
else:
2016-
if n < 75: algorithm = 'pari0'
2017-
else: algorithm = 'flint'
2018+
if n < 75:
2019+
algorithm = 'pari0'
2020+
else:
2021+
algorithm = 'flint'
20182022
proof = get_proof_flag(proof, "linear_algebra")
20192023
pivots = None
20202024

@@ -2252,7 +2256,8 @@ cdef class Matrix_integer_dense(Matrix_dense):
22522256
[ 0 0 0]
22532257
"""
22542258
p = self.fetch('pivots')
2255-
if not p is None: return tuple(p)
2259+
if not p is None:
2260+
return tuple(p)
22562261

22572262
cdef Matrix_integer_dense E
22582263
E = self.echelon_form()
@@ -2446,8 +2451,10 @@ cdef class Matrix_integer_dense(Matrix_dense):
24462451
if not transformation:
24472452
return D
24482453

2449-
if self._ncols == 0: v[0] = self.matrix_space(ncols = self._nrows)(1)
2450-
if self._nrows == 0: v[1] = self.matrix_space(nrows = self._ncols)(1)
2454+
if self._ncols == 0:
2455+
v[0] = self.matrix_space(ncols = self._nrows)(1)
2456+
if self._nrows == 0:
2457+
v[1] = self.matrix_space(nrows = self._ncols)(1)
24512458

24522459
if self._ncols == 0:
24532460
# silly special cases for matrices with 0 columns (PARI has a unique empty matrix)
@@ -3594,7 +3601,7 @@ cdef class Matrix_integer_dense(Matrix_dense):
35943601
35953602
35963603
ALGORITHM: The p-adic algorithm works by first finding a random
3597-
vector v, then solving A\*x = v and taking the denominator
3604+
vector v, then solving `Ax = v` and taking the denominator
35983605
`d`. This gives a divisor of the determinant. Then we
35993606
compute `\det(A)/d` using a multimodular algorithm and the
36003607
Hadamard bound, skipping primes that divide `d`.
@@ -3905,7 +3912,7 @@ cdef class Matrix_integer_dense(Matrix_dense):
39053912
check that the matrix is invertible.
39063913
39073914
3908-
OUTPUT: A, d such that A\*self = d
3915+
OUTPUT: A, d such that ``A*self == d``
39093916
39103917
39113918
- ``A`` - a matrix over ZZ
@@ -3961,7 +3968,7 @@ cdef class Matrix_integer_dense(Matrix_dense):
39613968
39623969
- ``self`` - an invertible matrix
39633970
3964-
OUTPUT: A, d such that A\*self = d
3971+
OUTPUT: A, d such that ``A*self == d``
39653972
39663973
39673974
- ``A`` - a matrix over ZZ
@@ -4242,8 +4249,8 @@ cdef class Matrix_integer_dense(Matrix_dense):
42424249
def _solve_iml(self, Matrix_integer_dense B, right=True):
42434250
"""
42444251
Let A equal self be a square matrix. Given B return an integer
4245-
matrix C and an integer d such that self C\*A == d\*B if right is
4246-
False or A\*C == d\*B if right is True.
4252+
matrix C and an integer d such that self ``C*A == d*B`` if right is
4253+
False or ``A*C == d*B`` if right is True.
42474254
42484255
OUTPUT:
42494256
@@ -4408,8 +4415,8 @@ cdef class Matrix_integer_dense(Matrix_dense):
44084415
def _solve_flint(self, Matrix_integer_dense B, right=True):
44094416
"""
44104417
Let A equal self be a square matrix. Given B return an integer
4411-
matrix C and an integer d such that self C\*A == d\*B if right is
4412-
False or A\*C == d\*B if right is True.
4418+
matrix C and an integer d such that self ``C*A == d*B`` if right is
4419+
False or ``A*C == d*B`` if right is True.
44134420
44144421
OUTPUT:
44154422
@@ -4564,7 +4571,7 @@ cdef class Matrix_integer_dense(Matrix_dense):
45644571
45654572
45664573
If you put standard basis vectors in order at the pivot columns,
4567-
and put the matrix (1/d)\*X everywhere else, then you get the
4574+
and put the matrix ``(1/d)*X`` everywhere else, then you get the
45684575
reduced row echelon form of self, without zero rows at the bottom.
45694576
45704577
.. NOTE::
@@ -4895,7 +4902,8 @@ cdef class Matrix_integer_dense(Matrix_dense):
48954902
row_i = A.row(i)
48964903
row_n = A.row(n)
48974904

4898-
ag = a//g; bg = b//g
4905+
ag = a//g
4906+
bg = b//g
48994907

49004908
new_top = s*row_i + t*row_n
49014909
new_bot = bg*row_i - ag*row_n
@@ -4953,7 +4961,7 @@ cdef class Matrix_integer_dense(Matrix_dense):
49534961
INPUT:
49544962
49554963
- ``D`` -- a small integer that is assumed to be a
4956-
multiple of 2\*det(self)
4964+
multiple of ``2*det(self)``
49574965
49584966
OUTPUT:
49594967

0 commit comments

Comments
 (0)