SymEigenValues3by3
Calculate the eigenvalues of 3 by 3 matrix.
- ܀ Interface
- ️܀ See example
- ↢
INTERFACE
MODULE PURE FUNCTION SymEigenValues3by3(mat) RESULT(ans)
REAL(DFP), INTENT(IN) :: mat(3, 3)
REAL(DFP) :: ans(3)
END FUNCTION SymEigenValues3by3
END INTERFACE
PROGRAM main
USE easifemBase
REAL( DFP ) :: mat(3,3), w(3), exact(3)
REAL( DFP ), PARAMETER :: tol= 1.0E-5
Test-1
exact = [-5.51082, 3.65928, 5.85154]
mat = RESHAPE([-2._DFP,-4._DFP,2._DFP,-4._DFP,1._DFP,2._DFP,2._DFP,2._DFP,5._DFP], [3,3])
!!
w = SymEigenValues(mat)
CALL Display(w, "w=")
!!
CALL OK( ALL(SOFTEQ(w, exact, tol)), "")
END PROGRAM main