Class TridiagonalSolver
- java.lang.Object
-
- com.opengamma.strata.math.impl.linearalgebra.TridiagonalSolver
-
public class TridiagonalSolver extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description 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.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.
-
-
-
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 matrixb
- 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 matrixb
- known vector (must be same length as rows/columns of matrix)- Returns:
- vector with same length as y
-
-