MCPcopy
hub / github.com/numpy/numpy / _test

Method _test

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

Source from the content-addressed store, hash-verified

1392 c = [-1, 2, -3, 4]
1393
1394 def _test(v):
1395 np.testing.assert_almost_equal(norm(v), 30 ** 0.5,
1396 decimal=self.dec)
1397 np.testing.assert_almost_equal(norm(v, inf), 4.0,
1398 decimal=self.dec)
1399 np.testing.assert_almost_equal(norm(v, -inf), 1.0,
1400 decimal=self.dec)
1401 np.testing.assert_almost_equal(norm(v, 1), 10.0,
1402 decimal=self.dec)
1403 np.testing.assert_almost_equal(norm(v, -1), 12.0 / 25,
1404 decimal=self.dec)
1405 np.testing.assert_almost_equal(norm(v, 2), 30 ** 0.5,
1406 decimal=self.dec)
1407 np.testing.assert_almost_equal(norm(v, -2), ((205. / 144) ** -0.5),
1408 decimal=self.dec)
1409 np.testing.assert_almost_equal(norm(v, 0), 4,
1410 decimal=self.dec)
1411
1412 for v in (a, b, c,):
1413 _test(v)

Callers

nothing calls this directly

Calls 1

normFunction · 0.90

Tested by

no test coverage detected