| 77 | == ADI -- Alternate Direction Implicit == |

| 78 | |

| 79 | === Code === |

| 80 | {{{ |

| 81 | for (t=0; t<=T-1; t++) |

| 82 | { |

| 83 | for (i1=0; i1<=N-1; i1++) |

| 84 | for (i2=1; i2<=N-1; i2++) |

| 85 | { |

| 86 | X[i1][i2] = X[i1][i2] - X[i1][i2-1] * A[i1][i2] / B[i1][i2-1]; |

| 87 | B[i1][i2] = B[i1][i2] - A[i1][i2] * A[i1][i2] / B[i1][i2-1]; |

| 88 | } |

| 89 | for (i1=1; i1<=N-1; i1++) |

| 90 | for (i2=0; i2<=N-1; i2++) |

| 91 | { |

| 92 | X[i1][i2] = X[i1][i2] - X[i1-1][i2] * A[i1][i2] / B[i1-1][i2]; |

| 93 | B[i1][i2] = B[i1][i2] - A[i1][i2] * A[i1][i2] / B[i1-1][i2]; |

| 94 | } |

| 95 | } |

| 96 | }}} |

| 97 | |

| 98 | === Sequential (single core) === |

| 99 | [[Image(adi.png,nolink)]] |

| 100 | |

| 101 | === Parallel (multi-core) === |

| 102 | [[Image(adi-par.png,nolink)]] |

| 103 | |