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

Function test_reduced_rank

numpy/linalg/tests/test_linalg.py:1620–1630  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1618
1619
1620def test_reduced_rank():
1621 # Test matrices with reduced rank
1622 rng = np.random.RandomState(20120714)
1623 for i in range(100):
1624 # Make a rank deficient matrix
1625 X = rng.normal(size=(40, 10))
1626 X[:, 0] = X[:, 1] + X[:, 2]
1627 # Assert that matrix_rank detected deficiency
1628 assert_equal(matrix_rank(X), 9)
1629 X[:, 3] = X[:, 4] + X[:, 5]
1630 assert_equal(matrix_rank(X), 8)
1631
1632
1633class TestQR:

Callers

nothing calls this directly

Calls 2

assert_equalFunction · 0.90
matrix_rankFunction · 0.90

Tested by

no test coverage detected