MCPcopy Create free account
hub / github.com/pybind/pybind11 / test_special_matrix_objects

Function test_special_matrix_objects

tests/test_eigen_matrix.py:685–697  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

683
684
685def test_special_matrix_objects():
686 assert np.all(m.incr_diag(7) == np.diag([1.0, 2, 3, 4, 5, 6, 7]))
687
688 asymm = np.array([[1.0, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]])
689 symm_lower = np.array(asymm)
690 symm_upper = np.array(asymm)
691 for i in range(4):
692 for j in range(i + 1, 4):
693 symm_lower[i, j] = symm_lower[j, i]
694 symm_upper[j, i] = symm_upper[i, j]
695
696 assert np.all(m.symmetric_lower(asymm) == symm_lower)
697 assert np.all(m.symmetric_upper(asymm) == symm_upper)
698
699
700def test_dense_signature(doc):

Callers

nothing calls this directly

Calls 1

arrayMethod · 0.80

Tested by

no test coverage detected