determination of an elementary orthogonal matrix for plane rotation.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(inout) | :: | xk |
first value for plane rotation (xk is transformed to sqrt(xk2+xl2)) |
||
| real(kind=wp), | intent(inout) | :: | xl |
second value for plane rotation (xl is transformed to zero) |
||
| real(kind=wp), | intent(out) | :: | ck |
diagonal element of the elementary orthogonal matrix. |
||
| real(kind=wp), | intent(out) | :: | cl |
off-diagonal element of the elementary orthogonal matrix. |
||
| integer, | intent(out) | :: | ier |
information on the transformation.
|
pure subroutine mxvort(xk,xl,ck,cl,ier) real(wp),intent(inout) :: xk !! first value for plane rotation !! (xk is transformed to sqrt(xk**2+xl**2)) real(wp),intent(inout) :: xl !! second value for plane rotation !! (xl is transformed to zero) real(wp),intent(out) :: ck !! diagonal element of the elementary orthogonal matrix. real(wp),intent(out) :: cl !! off-diagonal element of the elementary orthogonal matrix. integer,intent(out) :: ier !! information on the transformation. !! !! * `ier=0` -- general plane rotation. !! * `ier=1` -- permutation. !! * `ier=2` -- transformation suppressed. real(wp) :: den , pom if ( xl==0.0_wp ) then ier = 2 elseif ( xk==0.0_wp ) then xk = xl xl = 0.0_wp ier = 1 else if ( abs(xk)>=abs(xl) ) then pom = xl/xk den = sqrt(1.0_wp+pom*pom) ck = 1.0_wp/den cl = pom/den xk = xk*den else pom = xk/xl den = sqrt(1.0_wp+pom*pom) cl = 1.0_wp/den ck = pom/den xk = xl*den endif xl = 0.0_wp ier = 0 endif end subroutine mxvort