mxdpgb Subroutine

public pure subroutine mxdpgb(n, a, x, job)

solution of a system of linear equations with a dense symmetric positive definite matrix a+e using the factorization a+e=l*d*trans(l) obtained by the subroutine mxdpgf.

Method

back substitution

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n

order of the matrix a.

real(kind=wp), intent(in) :: a(*)

a(n*(n+1)/2) factorization a+e=l*d*trans(l) obtained by the subroutine mxdpgf.

real(kind=wp), intent(inout) :: x(*)

x(n) on input the right hand side of a system of linear equations. on output the solution of a system of linear equations.

integer, intent(in) :: job

option

  • if job=0 then x:=(a+e)**(-1)*x.
  • if job>0 then x:=l**(-1)*x.
  • if job<0 then x:=trans(l)**(-1)*x.

Called by

proc~~mxdpgb~~CalledByGraph proc~mxdpgb mxdpgb proc~bfgs_variable_metric_update bfgs_variable_metric_update proc~bfgs_variable_metric_update->proc~mxdpgb proc~dual_range_space_quad_prog psqp_class%dual_range_space_quad_prog proc~dual_range_space_quad_prog->proc~mxdpgb proc~update_tri_decomp_general update_tri_decomp_general proc~dual_range_space_quad_prog->proc~update_tri_decomp_general proc~update_tri_decomp_general->proc~mxdpgb proc~psqp psqp_class%psqp proc~psqp->proc~bfgs_variable_metric_update proc~psqp->proc~dual_range_space_quad_prog proc~psqpn psqp_class%psqpn proc~psqpn->proc~psqp

Source Code

      pure subroutine mxdpgb(n,a,x,job)

      integer,intent(in) :: job  !! option
                                 !!
                                 !! * if `job=0` then `x:=(a+e)**(-1)*x`.
                                 !! * if `job>0` then `x:=l**(-1)*x`.
                                 !! * if `job<0` then `x:=trans(l)**(-1)*x`.
      integer,intent(in) :: n  !! order of the matrix a.
      real(wp),intent(in) :: a(*)  !! `a(n*(n+1)/2)` factorization `a+e=l*d*trans(l)`
                                   !! obtained by the subroutine [[mxdpgf]].
      real(wp),intent(inout) :: x(*)  !! x(n)  on input the right hand side of a
                                      !! system of linear equations. on output the
                                      !! solution of a system of linear equations.

      integer :: i , ii , ij , j

      if ( job>=0 ) then
         ! phase 1 : x:=l**(-1)*x
         ij = 0
         do i = 1 , n
            do j = 1 , i - 1
               ij = ij + 1
               x(i) = x(i) - a(ij)*x(j)
            end do
            ij = ij + 1
         end do
      endif
      if ( job==0 ) then
         ! phase 2 : x:=d**(-1)*x
         ii = 0
         do i = 1 , n
            ii = ii + i
            x(i) = x(i)/a(ii)
         end do
      endif
      if ( job<=0 ) then
         ! phase 3 : x:=trans(l)**(-1)*x
         ii = n*(n-1)/2
         do i = n - 1 , 1 , -1
            ij = ii
            do j = i + 1 , n
               ij = ij + j - 1
               x(i) = x(i) - a(ij)*x(j)
            end do
            ii = ii - i
         end do
      endif
      end subroutine mxdpgb