MCPcopy
hub / github.com/mne-tools/mne-python / _sym_mat_to_vector

Function _sym_mat_to_vector

mne/time_frequency/csd.py:606–626  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

604
605
606def _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
629def read_csd(fname):

Callers 5

_make_rand_csdFunction · 0.90
_cov_as_csdFunction · 0.90
test_make_dics_rankFunction · 0.90
test_sym_mat_to_vectorFunction · 0.90
pick_channels_csdFunction · 0.85

Calls

no outgoing calls

Tested by 4

_make_rand_csdFunction · 0.72
_cov_as_csdFunction · 0.72
test_make_dics_rankFunction · 0.72
test_sym_mat_to_vectorFunction · 0.72