diff options
author | David Cournapeau <cournape@gmail.com> | 2009-09-18 09:59:24 +0000 |
---|---|---|
committer | David Cournapeau <cournape@gmail.com> | 2009-09-18 09:59:24 +0000 |
commit | 599b0f1e83494c56d01ac24d7605bc3e8da0cd6e (patch) | |
tree | 02c396f2047e71761d9ef11413cdcde376cbe5c8 /numpy/matrixlib/tests/test_regression.py | |
parent | 957cd7931740bce0ed9ffb12b47afde6c089dadf (diff) | |
download | numpy-599b0f1e83494c56d01ac24d7605bc3e8da0cd6e.tar.gz |
Rename matrx to matrixlib.
I forgot to commit the name change suggested by Stefan. You need to
clean build/install directory when updating to this version.
Diffstat (limited to 'numpy/matrixlib/tests/test_regression.py')
-rw-r--r-- | numpy/matrixlib/tests/test_regression.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/numpy/matrixlib/tests/test_regression.py b/numpy/matrixlib/tests/test_regression.py new file mode 100644 index 000000000..e0dd745ef --- /dev/null +++ b/numpy/matrixlib/tests/test_regression.py @@ -0,0 +1,33 @@ +from numpy.testing import * +import numpy as np + +rlevel = 1 + +class TestRegression(TestCase): + def test_kron_matrix(self,level=rlevel): + """Ticket #71""" + x = np.matrix('[1 0; 1 0]') + assert_equal(type(np.kron(x,x)),type(x)) + + def test_matrix_properties(self,level=rlevel): + """Ticket #125""" + a = np.matrix([1.0],dtype=float) + assert(type(a.real) is np.matrix) + assert(type(a.imag) is np.matrix) + c,d = np.matrix([0.0]).nonzero() + assert(type(c) is np.matrix) + assert(type(d) is np.matrix) + + def test_matrix_multiply_by_1d_vector(self, level=rlevel) : + """Ticket #473""" + def mul() : + np.mat(np.eye(2))*np.ones(2) + + self.failUnlessRaises(ValueError,mul) + + def test_matrix_std_argmax(self,level=rlevel): + """Ticket #83""" + x = np.asmatrix(np.random.uniform(0,1,(3,3))) + self.assertEqual(x.std().shape, ()) + self.assertEqual(x.argmax().shape, ()) + |