Class TridiagonalSolver


  • public class TridiagonalSolver
    extends Object
    • Method Detail

      • solvTriDag

        public static double[] solvTriDag​(TridiagonalMatrix aM,
                                          double[] b)
        Solves the system Ax = y for the unknown vector x, where A is a tridiagonal matrix and y is a vector. This takes order n operations where n is the size of the system (number of linear equations), as opposed to order n^3 for the general problem.
        Parameters:
        aM - tridiagonal matrix
        b - known vector (must be same length as rows/columns of matrix)
        Returns:
        vector (as an array of doubles) with same length as y
      • solvTriDag

        public static DoubleArray solvTriDag​(TridiagonalMatrix aM,
                                             DoubleArray b)
        Solves the system Ax = y for the unknown vector x, where A is a tridiagonal matrix and y is a vector. This takes order n operations where n is the size of the system (number of linear equations), as opposed to order n^3 for the general problem.
        Parameters:
        aM - tridiagonal matrix
        b - known vector (must be same length as rows/columns of matrix)
        Returns:
        vector with same length as y