public static void symmLowerToFull ( DMatrixRMaj A ) { if ( A . numRows != A . numCols ) throw new MatrixDimensionException ( "Must be a square matrix" ) ; final int cols = A . numCols ; for ( int row = 0 ; row < A . numRows ; row ++ ) { for ( int col = row + 1 ; col < cols ; col ++ ) { A . data [ row * cols + col ] = A . data [ col * cols + row ] ; } } }
Given a symmetric matrix which is represented by a lower triangular matrix convert it back into a full symmetric matrix .