SQRSYM Function

SQRSYM( matrix ) ;

where matrix is a symmetric numeric matrix.

The SQRSYM function takes a packed-symmetric matrix (such as generated by the SYMSQR function) and transforms it back into a dense square matrix. The elements of the argument are unpacked (rowwise) into the lower triangle of the result and reflected across the diagonal into the upper triangle.

For example, the following statements return a symmetric matrix:

v = T(1:6);
sqr = sqrsym(v);
print sqr;

Figure 23.277 Symmetric Matrix
sqr
1 2 4
2 3 5
4 5 6

The SQRSYM function and the SYMSQR function are inverse operations on the set of symmetric matrices.