mxvort Subroutine

public pure subroutine mxvort(xk, xl, ck, cl, ier)

determination of an elementary orthogonal matrix for plane rotation.

Arguments

Type IntentOptional 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.

  • ier=0 -- general plane rotation.
  • ier=1 -- permutation.
  • ier=2 -- transformation suppressed.

Called by

proc~~mxvort~~CalledByGraph proc~mxvort mxvort proc~update_tri_decomp_orthogonal update_tri_decomp_orthogonal proc~update_tri_decomp_orthogonal->proc~mxvort proc~ops_after_constr_deletion psqp_class%ops_after_constr_deletion proc~ops_after_constr_deletion->proc~update_tri_decomp_orthogonal proc~dual_range_space_quad_prog psqp_class%dual_range_space_quad_prog proc~dual_range_space_quad_prog->proc~ops_after_constr_deletion proc~psqp psqp_class%psqp proc~psqp->proc~dual_range_space_quad_prog proc~psqpn psqp_class%psqpn proc~psqpn->proc~psqp

Source Code

      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