private void solve (Vector d, double[] x, int currentColumn, double b0, double c0, double d0) { // Solve the case M x = d for x, where we (the tri-diagonal matrix) is m // // We do this recursively, solving one place at a time, pretending in // each case we are at the top left of the matrix. // // So, in each case, we have one of three cases, depending on whether // there are one, two, or three-or-more rows left to solve. int rowsLeft = _n-currentColumn; if (0 == rowsLeft) { return; // Nothing left to solve } else if (1 == rowsLeft) { solveSingleRow(d, x, currentColumn, b0, c0, d0); } else if (2 == rowsLeft) { solveDoubleRow(d, x, currentColumn, b0, c0, d0); } else { solveTripleRow(d, x, currentColumn, b0, c0, d0); } }
private void solve (Vector d, double[] x, int currentColumn, double b0, double c0, double d0) { // Solve the case M x = d for x, where we (the tri-diagonal matrix) is m // // We do this recursively, solving one place at a time, pretending in // each case we are at the top left of the matrix. // // So, in each case, we have one of three cases, depending on whether // there are one, two, or three-or-more rows left to solve. int rowsLeft = _n-currentColumn; if (0 == rowsLeft) { return; // Nothing left to solve } else if (1 == rowsLeft) { solveSingleRow(d, x, currentColumn, b0, c0, d0); } else if (2 == rowsLeft) { solveDoubleRow(d, x, currentColumn, b0, c0, d0); } else { solveTripleRow(d, x, currentColumn, b0, c0, d0); } }