Fixed the initial condition of forward sweep

This commit is contained in:
Janita Willumsen 2023-09-09 17:26:30 +02:00
parent 4919f488d4
commit 31eb457614

View File

@ -17,6 +17,7 @@ Following Thomas algorithm for gaussian elimination, we first perform a forward
\State $n \leftarrow$ length of $\vec{b}$
\State $\vec{\hat{b}}$, $\vec{\hat{g}} \leftarrow$ vectors of length $n$.
\State $\hat{b}_{1} \leftarrow b_{1}$ \Comment{Handle first element in main diagonal outside loop}
\State $\hat{g}_{1} \leftarrow g_{1}$
\For{$i = 2, 3, ..., n$}
\State $d \leftarrow \frac{a_{i}}{\hat{b}_{i-1}}$ \Comment{Calculating common expression}
\State $\hat{b}_{i} \leftarrow b_{i} - d \cdot c_{i-1}$