Navigation Menu

Skip to content

Commit

Permalink
STY: Fix indentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanv committed Feb 20, 2012
1 parent 2183a0f commit 3a64a52
Showing 1 changed file with 27 additions and 27 deletions.
54 changes: 27 additions & 27 deletions scipy/sparse/linalg/isolve/tests/test_lsmr.py
Expand Up @@ -78,33 +78,33 @@ def testNormx(self):
assert_almost_equal(normx, norm(x))

def lowerBidiagonalMatrix(m, n):
# This is a simple example for testing LSMR.
# It uses the leading m*n submatrix from
# A = [ 1
# 1 2
# 2 3
# 3 4
# ...
# n ]
# suitably padded by zeros.
#
# 04 Jun 2010: First version for distribution with lsmr.py
if m <= n:
row = hstack((arange(m, dtype=int), \
arange(1, m, dtype=int)))
col = hstack((arange(m, dtype=int), \
arange(m-1, dtype=int)))
data = hstack((arange(1, m+1, dtype=float), \
arange(1,m, dtype=float)))
return coo_matrix((data, (row, col)), shape=(m,n))
else:
row = hstack((arange(n, dtype=int), \
arange(1, n+1, dtype=int)))
col = hstack((arange(n, dtype=int), \
arange(n, dtype=int)))
data = hstack((arange(1, n+1, dtype=float), \
arange(1,n+1, dtype=float)))
return coo_matrix((data,(row, col)), shape=(m,n))
# This is a simple example for testing LSMR.
# It uses the leading m*n submatrix from
# A = [ 1
# 1 2
# 2 3
# 3 4
# ...
# n ]
# suitably padded by zeros.
#
# 04 Jun 2010: First version for distribution with lsmr.py
if m <= n:
row = hstack((arange(m, dtype=int), \
arange(1, m, dtype=int)))
col = hstack((arange(m, dtype=int), \
arange(m-1, dtype=int)))
data = hstack((arange(1, m+1, dtype=float), \
arange(1,m, dtype=float)))
return coo_matrix((data, (row, col)), shape=(m,n))
else:
row = hstack((arange(n, dtype=int), \
arange(1, n+1, dtype=int)))
col = hstack((arange(n, dtype=int), \
arange(n, dtype=int)))
data = hstack((arange(1, n+1, dtype=float), \
arange(1,n+1, dtype=float)))
return coo_matrix((data,(row, col)), shape=(m,n))

def lsmrtest(m, n, damp):
"""Verbose testing of lsmr"""
Expand Down

0 comments on commit 3a64a52

Please sign in to comment.