Skip to main content

Sym

This function makes the symmetric matrix by using lower or part of the matrix.

note

Please use this function when the matrix is not too big, otherwise use GetSym.

  • The following call will form symmetric matrix by using the upper triangle part of matrix B
Sym from Upper part
A = Sym(mat=B, from="U")
  • The following call will form symmetric matrix by using the lower triangle part of matrix B
Sym from Lower part
A = Sym(mat=B, from="L")

Interface

  MODULE PURE FUNCTION Sym(mat, from) RESULT(ans)
INTEGER(Int8| Int16 | Int32 | Int64) | REAL(Real32| Real64), INTENT(IN) :: mat(:, :)
CHARACTER(1), INTENT(IN) :: from
!! from = "U", then upper triangular part must be provided
!! from = "L", then lower triangular part must be provided
INTEGER(INT8) :: ans(SIZE(mat, 1), SIZE(mat, 2))
END FUNCTION Sym