summaryrefslogtreecommitdiff
path: root/numpy/linalg
diff options
context:
space:
mode:
authorJarrod Millman <millman@berkeley.edu>2008-04-20 11:49:35 +0000
committerJarrod Millman <millman@berkeley.edu>2008-04-20 11:49:35 +0000
commit8c663313de36e860bbfea0909de181d330bfdfc7 (patch)
treea7b5f3585d2b8a2d8307bfb03dd0e449fa732860 /numpy/linalg
parentcb7de97f089b67eaacf37ddbebcfb91c292c0ef4 (diff)
downloadnumpy-8c663313de36e860bbfea0909de181d330bfdfc7.tar.gz
ran reindent in preparation for the 1.1 release
Diffstat (limited to 'numpy/linalg')
-rw-r--r--numpy/linalg/linalg.py20
-rw-r--r--numpy/linalg/tests/test_regression.py8
2 files changed, 14 insertions, 14 deletions
diff --git a/numpy/linalg/linalg.py b/numpy/linalg/linalg.py
index 1706ff4a9..f56005292 100644
--- a/numpy/linalg/linalg.py
+++ b/numpy/linalg/linalg.py
@@ -972,8 +972,8 @@ def svd(a, full_matrices=1, compute_uv=1):
def cond(x,p=None):
"""Compute the condition number of a matrix.
- The condition number of x is the norm of x times the norm
- of the inverse of x. The norm can be the usual L2
+ The condition number of x is the norm of x times the norm
+ of the inverse of x. The norm can be the usual L2
(root-of-sum-of-squares) norm or a number of other matrix norms.
Parameters
@@ -983,16 +983,16 @@ def cond(x,p=None):
p : {None, 1, -1, 2, -2, inf, -inf, 'fro'}
Order of the norm:
- p norm for matrices
+ p norm for matrices
===== ============================
None 2-norm, computed directly using the SVD
- 'fro' Frobenius norm
- inf max(sum(abs(x), axis=1))
- -inf min(sum(abs(x), axis=1))
- 1 max(sum(abs(x), axis=0))
- -1 min(sum(abs(x), axis=0))
- 2 2-norm (largest sing. value)
- -2 smallest singular value
+ 'fro' Frobenius norm
+ inf max(sum(abs(x), axis=1))
+ -inf min(sum(abs(x), axis=1))
+ 1 max(sum(abs(x), axis=0))
+ -1 min(sum(abs(x), axis=0))
+ 2 2-norm (largest sing. value)
+ -2 smallest singular value
===== ============================
Returns
diff --git a/numpy/linalg/tests/test_regression.py b/numpy/linalg/tests/test_regression.py
index f712adb54..1335643bb 100644
--- a/numpy/linalg/tests/test_regression.py
+++ b/numpy/linalg/tests/test_regression.py
@@ -12,9 +12,9 @@ rlevel = 1
class TestRegression(NumpyTestCase):
def test_eig_build(self, level = rlevel):
"""Ticket #652"""
- rva = [1.03221168e+02 +0.j,
+ rva = [1.03221168e+02 +0.j,
-1.91843603e+01 +0.j,
- -6.04004526e-01+15.84422474j,
+ -6.04004526e-01+15.84422474j,
-6.04004526e-01-15.84422474j,
-1.13692929e+01 +0.j,
-6.57612485e-01+10.41755503j,
@@ -24,7 +24,7 @@ class TestRegression(NumpyTestCase):
7.80732773e+00 +0.j ,
-7.65390898e-01 +0.j,
1.51971555e-15 +0.j ,
- -1.51308713e-15 +0.j]
+ -1.51308713e-15 +0.j]
a = arange(13*13, dtype = float64)
a.shape = (13,13)
a = a%17
@@ -38,7 +38,7 @@ class TestRegression(NumpyTestCase):
cov = array([[ 77.70273908, 3.51489954, 15.64602427],
[3.51489954, 88.97013878, -1.07431931],
[15.64602427, -1.07431931, 98.18223512]])
-
+
vals, vecs = linalg.eigh(cov)
assert_array_almost_equal(vals, rvals)