相关代码 |
|
Sub TRIDAG(A(), B(), C(), R(), U(), N) NMAX = 100 Dim GAM(100) If B(1) = 0# Then Exit Sub BET = B(1) U(1) = R(1) / BET For J = 2 To N GAM(J) = C(J - 1) / BET BET = B(J) - A(J) * GAM(J) If BET = 0# Then Exit Sub U(J) = (R(J) - A(J) * U(J - 1)) / BET Next J For J = N - 1 To 1 Step -1 U(J) = U(J) - GAM(J + 1) * U(J + 1) Next J End Sub