************80
! SBBLOK solves a linear system that was factored by FCBLOK.
Discussion:
The routine supervises the solution, by forward and backward
substitution, of the linear system
A * x = b
for X, with the PLU factorization of A already generated in FCBLOK.
Individual blocks of equations are solved via SUBFOR and SUBBAK.
Modified:
14 February 2007
Author:
Carl DeBoor
Reference:
Carl DeBoor,
A Practical Guide to Splines,
Springer, 2001,
ISBN: 0387953663,
LC: QA1.A647.v27.
Parameters:
Input, real ( kind = 8 ) BLOKS(*), integer INTEGS(3,NBLOKS), integer
NBLOKS, integer IPIVOT(*), are as on return from FCBLOK.
Input, real ( kind = 8 ) B(*), the right hand side, stored corresponding
to the storage of the equations. See comments in SLVBLK for details.
Output, real ( kind = 8 ) X(*), the solution vector.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=8) | :: | bloks(*) | ||||
integer(kind=4) | :: | integs(3,nbloks) | ||||
integer(kind=4) | :: | nbloks | ||||
integer(kind=4) | :: | ipivot(*) | ||||
real(kind=8) | :: | b(*) | ||||
real(kind=8) | :: | x(*) |
subroutine sbblok ( bloks, integs, nbloks, ipivot, b, x ) !*****************************************************************************80 ! !! SBBLOK solves a linear system that was factored by FCBLOK. ! ! Discussion: ! ! The routine supervises the solution, by forward and backward ! substitution, of the linear system ! ! A * x = b ! ! for X, with the PLU factorization of A already generated in FCBLOK. ! Individual blocks of equations are solved via SUBFOR and SUBBAK. ! ! Modified: ! ! 14 February 2007 ! ! Author: ! ! Carl DeBoor ! ! Reference: ! ! Carl DeBoor, ! A Practical Guide to Splines, ! Springer, 2001, ! ISBN: 0387953663, ! LC: QA1.A647.v27. ! ! Parameters: ! ! Input, real ( kind = 8 ) BLOKS(*), integer INTEGS(3,NBLOKS), integer ! NBLOKS, integer IPIVOT(*), are as on return from FCBLOK. ! ! Input, real ( kind = 8 ) B(*), the right hand side, stored corresponding ! to the storage of the equations. See comments in SLVBLK for details. ! ! Output, real ( kind = 8 ) X(*), the solution vector. ! implicit none integer ( kind = 4 ) nbloks real ( kind = 8 ) b(*) real ( kind = 8 ) bloks(*) integer ( kind = 4 ) i integer ( kind = 4 ) index integer ( kind = 4 ) indexb integer ( kind = 4 ) indexx integer ( kind = 4 ) integs(3,nbloks) integer ( kind = 4 ) ipivot(*) integer ( kind = 4 ) j integer ( kind = 4 ) last integer ( kind = 4 ) nbp1 integer ( kind = 4 ) ncol integer ( kind = 4 ) nrow real ( kind = 8 ) x(*) ! ! Forward substitution: ! index = 1 indexb = 1 indexx = 1 do i = 1, nbloks nrow = integs(1,i) last = integs(3,i) call subfor ( bloks(index), ipivot(indexb), nrow, last, b(indexb), & x(indexx) ) index = nrow * integs(2,i) + index indexb = indexb + nrow indexx = indexx + last end do ! ! Back substitution. ! nbp1 = nbloks + 1 do j = 1, nbloks i = nbp1 - j nrow = integs(1,i) ncol = integs(2,i) last = integs(3,i) index = index - nrow * ncol indexb = indexb - nrow indexx = indexx - last call subbak ( bloks(index), ipivot(indexb), nrow, ncol, last, x(indexx) ) end do return end subroutine sbblok