def test_duplication_matrix(): for k in range(2, 10): m = tools.unvech(np.random.randn(k * (k + 1) // 2)) Dk = tools.duplication_matrix(k) assert (np.array_equal(vec(m), np.dot(Dk, vech(m))))
def test_duplication_matrix(): for k in range(2, 10): m = tools.unvech(np.random.randn(k * (k + 1) // 2)) Dk = tools.duplication_matrix(k) assert(np.array_equal(vec(m), np.dot(Dk, vech(m))))