MCPcopy Create free account
hub / github.com/numpy/numpy / _test

Method _test

numpy/linalg/tests/test_linalg.py:1300–1316  ·  view source on GitHub ↗
(v)

Source from the content-addressed store, hash-verified

1298 c = [-1, 2, -3, 4]
1299
1300 def _test(v):
1301 np.testing.assert_almost_equal(norm(v), 30 ** 0.5,
1302 decimal=self.dec)
1303 np.testing.assert_almost_equal(norm(v, inf), 4.0,
1304 decimal=self.dec)
1305 np.testing.assert_almost_equal(norm(v, -inf), 1.0,
1306 decimal=self.dec)
1307 np.testing.assert_almost_equal(norm(v, 1), 10.0,
1308 decimal=self.dec)
1309 np.testing.assert_almost_equal(norm(v, -1), 12.0 / 25,
1310 decimal=self.dec)
1311 np.testing.assert_almost_equal(norm(v, 2), 30 ** 0.5,
1312 decimal=self.dec)
1313 np.testing.assert_almost_equal(norm(v, -2), ((205. / 144) ** -0.5),
1314 decimal=self.dec)
1315 np.testing.assert_almost_equal(norm(v, 0), 4,
1316 decimal=self.dec)
1317
1318 for v in (a, b, c,):
1319 _test(v)

Callers

nothing calls this directly

Calls 1

normFunction · 0.90

Tested by

no test coverage detected