Fix upper_triangular_matrix_to_full_matrix (#704)

This commit is contained in:
Jeff Irion
2022-08-03 05:21:58 -07:00
committed by GitHub
parent 48a31af8e2
commit 7716bdd248

View File

@@ -68,11 +68,10 @@ def upper_triangular_matrix_to_full_matrix(arr, n):
"""
triu0 = np.triu_indices(n, 0)
triu1 = np.triu_indices(n, 1)
tril1 = np.tril_indices(n, -1)
mat = np.zeros((n, n), dtype=float)
mat[triu0] = arr
mat[tril1] = mat[triu1]
mat[tril1] = mat.T[tril1]
return mat