E-Code

LU decomposition with partial pivoting — a TI-84 Plus CE program

By E-Code · updated

LUDECOMP is a TI-BASIC program for the TI-84 Plus CE. Factor a 2×2 to 4×4 matrix as PA = LU with partial pivoting: every entry of L and U, the row order P and the determinant.

What it asks for and what it shows

It asks for 4 values at its prompts. In the example below it shows L11, L12, L13, L21, L22, L23, L31, L32, L33, U11, U12, U13, U21, U22, U23, U31, U32, U33, DET, P1=ROW, P2=ROW, P3=ROW.

Example run

One of its oracle test cases: “3x3 with a row swap”. The inputs are typed in order, and the results are the values the case expects on the screen.

StepValue
You enter
Input 13
Input 2{2,1,1}
Input 3{4,⁻6,0}
Input 4{⁻2,7,2}
The screen shows
L11=1
L12=0
L13=0
L21=0.5
L22=1
L23=0
L31=-0.5
L32=1
L33=1
U11=4
U12=-6
U13=0
U21=0
U22=4
U23=1
U31=0
U32=0
U33=1
DET=-16
P1=ROW2
P2=ROW1
P3=ROW3

How it's checked

4 test cases, each checked against an independent method. Replayed key by key on a virtual TI-84 Plus CE, they make 79 checks.

How E-Code checks every program

Run it or put it on your calculator

Related programs

All TI-84 Plus CE math programs · All TI-84 Plus CE programs