rsol Subroutine

subroutine rsol(n, nn, nmax, R, b)

dense matrix utilities

Copyright (C) 1996 Roger Fletcher

Current version dated 26 May 2011

THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT module utilities contains



solves Rx=b where R is nxn upper triangular. Solution overwrites b. R is a single suffix array: the first nmax elements contain the first row of R in positions 1:n, the next nmax-1 elements contain the second row of R, and so on. nn indexes the element R(n,n) (where nn=n(3-n)/2+(n-1)nmax)

Arguments

Type IntentOptional AttributesName
integer :: n
integer :: nn
integer :: nmax
real :: R
real :: b

Calls

proc~~rsol~~CallsGraph proc~rsol rsol proc~scpr scpr proc~rsol->proc~scpr

Called by

proc~~rsol~~CalledByGraph proc~rsol rsol proc~aqsol aqsol proc~aqsol->proc~rsol proc~updatese updateSE proc~updatese->proc~aqsol

Contents

Source Code


Source Code

      subroutine rsol(n,nn,nmax,R,b)
      implicit double precision (a-h,o-z)
      dimension R(*),b(*)
      n1=nmax+1
      ii=nn
      b(n)=b(n)/R(nn)
      do i=n-1,1,-1
        ii=ii-n1+i
        b(i)=-scpr(-b(i),R(ii+1),b(i+1),n-i)/R(ii)
      end do
      end subroutine rsol