MCPcopy
hub / github.com/numpy/numpy / test_basic

Method test_basic

numpy/matrixlib/tests/test_defmatrix.py:129–144  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

127 assert_equal(x.var(ddof=1), mx.var(ddof=1))
128
129 def test_basic(self):
130 import numpy.linalg as linalg
131
132 A = np.array([[1., 2.],
133 [3., 4.]])
134 mA = matrix(A)
135 assert_(np.allclose(linalg.inv(A), mA.I))
136 assert_(np.all(np.array(np.transpose(A) == mA.T)))
137 assert_(np.all(np.array(np.transpose(A) == mA.H)))
138 assert_(np.all(A == mA.A))
139
140 B = A + 2j * A
141 mB = matrix(B)
142 assert_(np.allclose(linalg.inv(B), mB.I))
143 assert_(np.all(np.array(np.transpose(B) == mB.T)))
144 assert_(np.all(np.array(np.transpose(B).conj() == mB.H)))
145
146 def test_pinv(self):
147 x = matrix(np.arange(6).reshape(2, 3))

Callers

nothing calls this directly

Calls 3

matrixClass · 0.90
assert_Function · 0.90
allMethod · 0.45

Tested by

no test coverage detected