Presentation is loading. Please wait.

Presentation is loading. Please wait.

Numerical Triangular Factorization Lecture #11 EEE 574 Dr. Dan Tylavsky.

Similar presentations


Presentation on theme: "Numerical Triangular Factorization Lecture #11 EEE 574 Dr. Dan Tylavsky."— Presentation transcript:

1

2 Numerical Triangular Factorization Lecture #11 EEE 574 Dr. Dan Tylavsky

3 Numerical Triangular Factorization © Copyright 1999 Daniel Tylavsky 4 Triangular factorization of a sparse matrix: –Created ordered data structure L/U. –Numerical Program Segment: Variable Assignment: –A - Matrix to be factored stored in RR(C)U. –CIndxA - Column indices of A. –URO - Upper triangular factor matrix stored by rows (ordered). –LCO - Lower triangular factor matrix stored by cols. (ordered). –CIndxUO - Column Indices or URO (Row Indices of LCO). –Diag - Diagonal elements (of D matrix of LDU factors) stored in compact form.

4 Numerical Triangular Factorization © Copyright 1999 Daniel Tylavsky Variable Assignment (cont’d): –Rindex - Row Index of current row being processed. –ExAcum - Expanded Accumulator used in update process. –ICPL - Initial column pointers to L matrix. (Updated as L matrix is created.) –Link - Self-referential linked list used to associate the disjoint sets of rows needed in the reduction of each row.

5 Numerical Triangular Factorization © Copyright 1999 Daniel Tylavsky

6 Numerical Triangular Factorization © Copyright 1999 Daniel Tylavsky 4 Let’s look at this algorithm in more detail.

7 Numerical Triangular Factorization © Copyright 1999 Daniel Tylavsky

8 Numerical Triangular Factorization © Copyright 1999 Daniel Tylavsky

9 Numerical Triangular Factorization © Copyright 1999 Daniel Tylavsky

10 Numerical Triangular Factorization © Copyright 1999 Daniel Tylavsky 4 Let’s factorize the following matrix.

11 Numerical Triangular Factorization © Copyright 1999 Daniel Tylavsky Step 0: Initialize RIndx, ICPL, Link.Step 1.1a,b: Zero ExAcum using Link,CIndxUO.Step 1.1c: Write row Rindx values into ExAcum.Step 2.1a: Initialize RX=0.Step 2.1b,c: Search Link for next greater value. If no greater value go to step 3.Step 3.1: Zero all links in Link associated with RIndx.Step 4.1: Invert ExAcum(RIndx), store in Diag(Rindx).Step 5.1: Multiply active ExAcum by Diag(1) & store in URO.Step 6.1: Add Rindx=1 to Link list associated with CIndxUO(ICPL(Rindx)). Row 1

12 Numerical Triangular Factorization © Copyright 1999 Daniel Tylavsky Step 1.2a,b: Zero ExAcum using Link, CIndxUO.Step 1.2c: Write row Rindx values into ExAcum.Step 2.2a: Initialize RX=0.Step 2.2b,c: Search Link for next greater value. If no greater value go to step 3.Step 3.2: Zero all links in Link associated with RIndx.Step 4.2: Invert ExAcum(2), store in Diag(2).Step 5.2: Multiply active ExAcum entries by Diag(2) & store in URO.Step 6.2: Add Rindx=2 to Link list associated with CIndxUO(ICPL(Rindx)). Row 2

13 Numerical Triangular Factorization © Copyright 1999 Daniel Tylavsky Step 2.6: Add Rindx=2 to Link list associated with CIndxUO(ICPL(Rindx)).mStep 3.1a,b: Zero ExAcum using Link, CIndxUO.Step 3.1c: Write row 3 values into ExAcum.Step 3.2a: Initialize RX=0.Step 3.2b,c: Search Link for next greater value. If no greater value go to step 3.Step 3.3: Zero all links in Link associated with RIndx.Step 3.4: Invert ExAcum(3), store in Diag(3).Step 3.5: Multiply active ExAcum entries by Diag(3) & store in URO.Step 3.6: Add Rindx to Link list associated with CIndxUO(ICPL(Rindx)). Row 3

14 Numerical Triangular Factorization © Copyright 1999 Daniel Tylavsky Step 3.6: Add Rindx to Link list associated with CIndxUO(ICPL(Rindx)).Step 4.1a,b: Incr Rindx. Zero ExAcum using Link, CIndxUO.Step 4.1c: Write row 4 values into ExAcum.Step 4.2a: Initialize RX=0.Step 4.2b,c1: Search Link for next greater value. If no greater value go to step 3.Step 4.2d1: Mult. Row RX of URO by ExAcum(RX) and subtract from ExAcum.Step 4.2ef1: Mult. ExAcum(RX) by Diag(RX). Store result in ICPL(RX). Incr. ICPL(RX).Step 4.2g1: Add row RX to link list associated with CincdxUO(ICPL(RX)). Row 4

15 Numerical Triangular Factorization © Copyright 1999 Daniel Tylavsky Row 4(b) Step 4.2g1: Add row RX to link list associated with CincdxUO(ICPL(RX)).Step 4.2b,c2: Search Link for next greater value. If no greater value go to step 3.Step 4.2d2: Mult. Row RX of URO by ExAcum(RX) and subtract from ExAcum. Step 4.2ef2: Mult. ExAcum(RX) by Diag(RX).Store result in LCO(ICPL(RX)).Incr. ICPL(RX). Step 4.2g2: Add row RX to link list associated with CincdxUO(ICPL(RX)).Step 4.2b,c3: Search Link for next greater value. If no greater value go to step 3.Step 4.3: Zero all links in Link associated with RIndx.Step 4.4: Invert ExAcum(4), store in Diag(4).Step 4.5: Multiply active ExAcum entries by Diag(4) & store in URO.Step 4.6: Add Rindx=4 to Link list associated with CIndxUO(ICPL(Rindx)).

16 Numerical Triangular Factorization © Copyright 1999 Daniel Tylavsky Step 4.6: Add Rindx=4 to Link list associated with CIndxUO(ICPL(Rindx)). Row 5 Step 5.1a,b: Incr Rindx. Zero ExAcum using Link, CIndxUO.Step 5.1c: Write row 5 values into ExAcum.Step 5.2a: Initialize RX=0.Step 5.2b,c1: Search Link for next greater value. If no greater value go to step 3.Step 5.2d1: Mult. Row RX of URO by ExAcum(RX) and subtract from ExAcum. Step 5.2ef1:Mult. ExAcum(RX) by Diag(RX).Store result in LCO(ICPL(RX)). Incr. ICPL(RX). Step 5.2g1: Add row RX to link list associated with CincdxUO(ICPL(RX)).

17 Numerical Triangular Factorization © Copyright 1999 Daniel Tylavsky Step 5.2g1: Add row RX to link list associated with CincdxUO(ICPL(RX)).Step 5.2b,c2: Search Link for next greater value. If no greater value go to step 3.Step 5.2d2: Mult. Row RX of URO by ExAcum(RX) and subtract from ExAcum. Step 5.2ef2: Mult. ExAcum(RX) by Diag(RX).Store result in LCO(ICPL(RX)).Incr. ICPL(RX). Step 5.2g2: Add row RX to link list associated with CincdxUO(ICPL(RX)). Row 5(b) Step 5.2b,c3: Search Link for next greater value. If no greater value go to step 3.Step 5.3: Zero all links in Link associated with RIndx.Step 5.4: Invert ExAcum(5), store in Diag(5).Step 5.5: Multiply active ExAcum entries by Diag(5) & store in URO.Step 5.6: Add RIndx=5 to Link list associated with CIndxUO(ICPL(Rindx)).

18 Numerical Triangular Factorization © Copyright 1999 Daniel Tylavsky Step 5.6: Add RIndx=5 to Link list associated with CIndxUO(ICPL(Rindx)).Step 6.1a,b: Incr RIndx. Zero ExAcum using Link, CIndxUO.Step 6.1c: Write row 6 values into ExAcum. Row 6 Step 6.2a: Initialize RX=0.Step 6.2b,c1: Search Link for next greater value. If no greater value go to step 3.Step 6.2d1: Mult. Row RX of URO by ExAcum(RX) and subtract from ExAcum. Step 6.2ef1:Mult. ExAcum(RX) by Diag(RX).Store result in LCO(ICPL(RX)). Incr. ICPL(RX). Step 6.2g1: Add row RX to link list associated with CIncdxUO(ICPL(RX)).

19 Numerical Triangular Factorization © Copyright 1999 Daniel Tylavsky Row 6(b) Step 6.2g1: Add row RX to link list associated with CIncdxUO(ICPL(RX)).Step 6.2b,c2: Search Link for next greater value. If no greater value go to step 3.Step 6.2d2: Mult. Row RX of URO by ExAcum(RX) and subtract from ExAcum. Step 6.2ef2:Mult. ExAcum(RX) by Diag(RX).Store result in LCO(ICPL(RX)). Incr. ICPL(RX). Step 6.2g2: Add row RX to link list associated with CincdxUO(ICPL(RX)). (ERR!)Step 6.2b,c3: Search Link for next greater value. If no greater value go to step 3. One job you have in your midterm is to correct this non-disjoint linked list problem. Step 6.3: Zero all links in Link associated with RIndx.Step 6.4: Invert ExAcum(6), store in Diag(6).Step 6.5: Multiply active ExAcum entries by Diag(6) & store in URO.Step 6.6: Add Rindx=6 to Link list associated with CIndxUO(ICPL(Rindx)).

20 Numerical Triangular Factorization © Copyright 1999 Daniel Tylavsky Team Problem: Complete the factorization using the data structure below. (Finish Row 7). Row 7

21 The End

22 Numerical Triangular Factorization © Copyright 1999 Daniel Tylavsky 4 Subsequent Slides are to be ignored.

23 Numerical Triangular Factorization © Copyright 1999 Daniel Tylavsky Step 5.2g1: Add row RX to link list associated with CincdxUO(ICPL(RX)). Step 5.2ef2: Mult. ExAcum(RX) by Diag(RX).Store result in LCO(ICPL(RX)).Incr. ICPL(RX). Step 5.2g2: Add row RX to link list associated with CincdxUO(ICPL(RX)). Step 6.2b,c3: Search Link for next greater value. If no greater value go to step 3. Step 6.3: Zero all links in Link associated with RIndx. Step 6.4: Invert ExAcum(4), store in Diag(4). Step 6.5: Multiply active ExAcum entries by Diag(4) & store in URO. Step 6.6: Add Rindx=4 to Link list associated with CIndxUO(ICPL(Rindx)). Step 5.2d2: Mult. Row RX of URO by ExAcum(RX) and subtract from ExAcum. Step 5.2b,c2: Search Link for next greater value. If no greater value go to step 3.

24 Numerical Triangular Factorization © Copyright 1999 Daniel Tylavsky Step 6.2b,c2: Search Link for next greater value. If no greater value go to step 3. Step 6.2d2: Mult. Row RX of URO by ExAcum(RX) and subtract from ExAcum. Step 6.2ef2:Mult. ExAcum(RX) by Diag(RX).Store result in LCO(ICPL(RX)). Incr. ICPL(RX). Step 6.2g2: Add row RX to link list associated with CincdxUO(ICPL(RX)).

25 Numerical Triangular Factorization © Copyright 1999 Daniel Tylavsky Step 6.1a,b: Incr Rindx. Zero ExAcum using Link, CIndxUO. Step 6.1c: Write row 5 values into ExAcum. Step 6.2a: Initialize RX=0. Step 6.2b,c1: Search Link for next greater value. If no greater value go to step 3. Step 6.2d1: Mult. Row RX of URO by ExAcum(RX) and subtract from ExAcum. Step 6.2ef1:Mult. ExAcum(RX) by Diag(RX).Store result in LCO(ICPL(RX)). Incr. ICPL(RX). Step 6.2g1: Add row RX to link list associated with CincdxUO(ICPL(RX)).

26 Numerical Triangular Factorization © Copyright 1999 Daniel Tylavsky Step 5.2g1: Add row RX to link list associated with CincdxUO(ICPL(RX)). Step 5.2ef2: Mult. ExAcum(RX) by Diag(RX).Store result in LCO(ICPL(RX)).Incr. ICPL(RX). Step 5.2g2: Add row RX to link list associated with CincdxUO(ICPL(RX)). Step 5.2b,c3: Search Link for next greater value. If no greater value go to step 3. Step 5.3: Zero all links in Link associated with RIndx. Step 5.4: Invert ExAcum(4), store in Diag(4). Step 5.5: Multiply active ExAcum entries by Diag(4) & store in URO. Step 5.6: Add Rindx=4 to Link list associated with CIndxUO(ICPL(Rindx)). Step 5.2d2: Mult. Row RX of URO by ExAcum(RX) and subtract from ExAcum. Step 5.2b,c2: Search Link for next greater value. If no greater value go to step 3.

27 Numerical Triangular Factorization © Copyright 1999 Daniel Tylavsky Step 6: Add Rindx to Link list associated with CIndxUO(ICPL(Rindx)).Step 1a,b: Incr Rindx. Zero ExAcum using Cindx, Link, CIndxUO. Step 2ef: Mult. ExAcum(RX) by Diag(RX). Store result in ICPL(RX). Incr. ICPL(RX). Step 2g: Add row RX to link list associated with Mult. CincdxUO(ICPL(RX)). Step 2b,c: Search Link for next greater value. If no greater value go to step 3. Step 2d: Mult. Row RX of URO by ExAcum(RX) and subtract from ExAcum. Step 2ef: Mult. ExAcum(RX) by Diag(RX). Store result in ICPL(RX). Incr. ICPL(RX). Step 2g: Add row RX to link list associated with Mult. CincdxUO(ICPL(RX)). Step 2b,c: Search Link for next greater value. If no greater value go to step 3. Step 3: Zero all links in Link associated with RIndx. Step 4: Invert ExAcum(4), store in Diag(4). Step 4: Invert ExAcum(2), store in Diag(2).Step 5: Multiply active ExAcum entries by Diag(4) & store in URO. Step 6: Add Rindx to Link list associated with CIndxUO(ICPL(Rindx)). Step 1c: Write row 5 values into ExAcum. Step 2a: Initialize RX=0. Row 5 Step 2b,c: Search Link for next greater value. If no greater value go to step 3. Step 2d: Mult. Row RX of URO by ExAcum(RX) and subtract from ExAcum.


Download ppt "Numerical Triangular Factorization Lecture #11 EEE 574 Dr. Dan Tylavsky."

Similar presentations


Ads by Google