PyREC scaffolding (from YREC development, 7be4133)/ lubksb.fGlossary

lubksb.f

51 lines · 1 definitions · on GitHub (7be4133)

Python version: lubksb.py, 50 lines, on the right (switch to Python above the code).

Purpose

LUBKSB solves $A\,x = b$ given the LU decomposition of $A$ from LUDCMP (Numerical Recipes' LUBKSB). The solution overwrites B.

How it fits

Called only by THDIFF. No COMMON blocks, no calls.

The method

Forward substitution with $L$ (unpacking the permutation INDX, and skipping leading zeros of $b$), then back-substitution with $U$:

$$y_i = b_{p(i)} - \sum_{j<i} L_{ij}\,y_j,\qquad x_i = \frac{1}{U_{ii}}\Big(y_i - \sum_{j>i} U_{ij}\,x_j\Big).$$

Definitions

subroutineLUBKSB

lines 3–51 · GitHub

Forward and back substitution (above).

Called by THDIFF ×3

Compiler warnings (1)

gfortran -Wall -Wextra, compiling only; nothing was run.

  • line 33: Inequality comparison for REAL(8) [-Wcompare-reals]

Change log

The changes since rp_1

Changed since rp_1. Declarations only: IMPLICIT NONE with explicit declarations.