Convert a symmetric matrix to a vector. The upper triangle of the matrix (including the diagonal) will be used as the values of the vector. Parameters ---------- mat : 2d-array The symmetric matrix to convert to a vector Returns ------- vec : 1d-array
(mat)
| 604 | |
| 605 | |
| 606 | def _sym_mat_to_vector(mat): |
| 607 | """Convert a symmetric matrix to a vector. |
| 608 | |
| 609 | The upper triangle of the matrix (including the diagonal) will be used |
| 610 | as the values of the vector. |
| 611 | |
| 612 | Parameters |
| 613 | ---------- |
| 614 | mat : 2d-array |
| 615 | The symmetric matrix to convert to a vector |
| 616 | |
| 617 | Returns |
| 618 | ------- |
| 619 | vec : 1d-array |
| 620 | A vector consisting of the values of the upper triangle of the matrix. |
| 621 | |
| 622 | See Also |
| 623 | -------- |
| 624 | _vector_to_sym_mat |
| 625 | """ |
| 626 | return mat[np.triu_indices_from(mat)] |
| 627 | |
| 628 | |
| 629 | def read_csd(fname): |
no outgoing calls