260 likes | 388 Vues
Numerical Triangular Factorization. Lecture #11 EEE 574 Dr. Dan Tylavsky. 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.
E N D
Numerical Triangular Factorization Lecture #11 EEE 574 Dr. Dan Tylavsky
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.
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.
Row 1 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 ExAcumby Diag(1) & store in URO. Step 6.1: Add Rindx=1 to Link list associated with CIndxUO(ICPL(Rindx)).
Row 2 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 ExAcumentries by Diag(2) & store in URO. Step 6.2: Add Rindx=2 to Link list associated with CIndxUO(ICPL(Rindx)).
Row 3 Step 2.6: Add Rindx=2 to Link list associated with CIndxUO(ICPL(Rindx)).m Step 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 ExAcumentries by Diag(3) & store in URO. Step 3.6: Add Rindx to Link list associated with CIndxUO(ICPL(Rindx)).
Row 4 Step 4.2ef1: Mult. ExAcum(RX) by Diag(RX). Store result in ICPL(RX). Incr. ICPL(RX). 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.2g1: Add row RX to link list associated with CincdxUO(ICPL(RX)).
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 ExAcumentries by Diag(4) & store in URO. Step 4.6: Add Rindx=4 to Link list associated with CIndxUO(ICPL(Rindx)).
Row 5 Step 5.2ef1:Mult. ExAcum(RX) by Diag(RX).Store result in LCO(ICPL(RX)). Incr. ICPL(RX). Step 4.6: Add Rindx=4 to Link list associated with CIndxUO(ICPL(Rindx)). 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.2g1: Add row RX to link list associated with CincdxUO(ICPL(RX)).
Row 5(b) Step 5.2ef2: 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)). 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.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(5), store in Diag(5). Step 5.5: Multiply active ExAcumentries by Diag(5) & store in URO. Step 5.6: Add RIndx=5 to Link list associated with CIndxUO(ICPL(Rindx)).
Row 6 Step 6.2ef1:Mult. ExAcum(RX) by Diag(RX).Store result in LCO(ICPL(RX)). Incr. ICPL(RX). 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. 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.2g1: Add row RX to link list associated with CIncdxUO(ICPL(RX)).
Row 6(b) Step 6.2ef2: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)). 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.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. 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 ExAcumentries by Diag(6) & store in URO. Step 6.6: Add Rindx=6 to Link list associated with CIndxUO(ICPL(Rindx)). One job you have in your midterm is to correct this non-disjoint linked list problem.
Row 7 Team Problem: Complete the factorization using the data structure below. (Finish Row 7).
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)). 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 ExAcumentries by Diag(4) & store in URO. Step 6.6: Add Rindx=4 to Link list associated with CIndxUO(ICPL(Rindx)).
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)).
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)).
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)). 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 ExAcumentries by Diag(4) & store in URO. Step 5.6: Add Rindx=4 to Link list associated with CIndxUO(ICPL(Rindx)).
Row 5 Step 6: Add Rindx to Link list associated with CIndxUO(ICPL(Rindx)). Step 1a,b: Incr Rindx. Zero ExAcum using Cindx, Link, CIndxUO. Step 1c: Write row 5 values into ExAcum. Step 2a: Initialize RX=0. 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 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 ExAcumentries by Diag(4) & store in URO. Step 6: Add Rindx to Link list associated with CIndxUO(ICPL(Rindx)).