Mercurial > hg > vamp-build-and-test
comparison DEPENDENCIES/mingw32/Python27/Lib/site-packages/numpy/matrixlib/tests/test_regression.py @ 87:2a2c65a20a8b
Add Python libs and headers
author | Chris Cannam |
---|---|
date | Wed, 25 Feb 2015 14:05:22 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
86:413a9d26189e | 87:2a2c65a20a8b |
---|---|
1 from __future__ import division, absolute_import, print_function | |
2 | |
3 from numpy.testing import * | |
4 import numpy as np | |
5 | |
6 rlevel = 1 | |
7 | |
8 class TestRegression(TestCase): | |
9 def test_kron_matrix(self,level=rlevel): | |
10 """Ticket #71""" | |
11 x = np.matrix('[1 0; 1 0]') | |
12 assert_equal(type(np.kron(x, x)), type(x)) | |
13 | |
14 def test_matrix_properties(self,level=rlevel): | |
15 """Ticket #125""" | |
16 a = np.matrix([1.0], dtype=float) | |
17 assert_(type(a.real) is np.matrix) | |
18 assert_(type(a.imag) is np.matrix) | |
19 c, d = np.matrix([0.0]).nonzero() | |
20 assert_(type(c) is np.matrix) | |
21 assert_(type(d) is np.matrix) | |
22 | |
23 def test_matrix_multiply_by_1d_vector(self, level=rlevel) : | |
24 """Ticket #473""" | |
25 def mul() : | |
26 np.mat(np.eye(2))*np.ones(2) | |
27 | |
28 self.assertRaises(ValueError, mul) | |
29 | |
30 def test_matrix_std_argmax(self,level=rlevel): | |
31 """Ticket #83""" | |
32 x = np.asmatrix(np.random.uniform(0, 1, (3, 3))) | |
33 self.assertEqual(x.std().shape, ()) | |
34 self.assertEqual(x.argmax().shape, ()) |