Class TridiagonalMatrix
java.lang.Object
net.finmath.finitedifference.solvers.TridiagonalMatrix
Data container representing a tridiagonal matrix by its three diagonals.
A tridiagonal matrix has non-zero entries only on the main diagonal, the first lower diagonal, and the first upper diagonal. Instead of storing the full matrix, this class stores those three diagonals in separate arrays.
For a matrix of dimension n:
lower[i]stores the entry below the main diagonal in rowi,diag[i]stores the main diagonal entry in rowi,upper[i]stores the entry above the main diagonal in rowi.
By convention, lower[0] and upper[n-1] are typically unused.
- Author:
- Alessandro Gnoatto
-
Constructor Summary
ConstructorsConstructorDescriptionTridiagonalMatrix(int n) Creates a tridiagonal matrix representation of dimensionn. -
Method Summary
Modifier and TypeMethodDescriptiondouble[]double[]double[]
-
Constructor Details
-
TridiagonalMatrix
public TridiagonalMatrix(int n) Creates a tridiagonal matrix representation of dimensionn.All three diagonal arrays are initialized with length
nand filled with zeros.- Parameters:
n- The dimension of the tridiagonal matrix.
-
-
Method Details
-
getUpperDiagonal
public double[] getUpperDiagonal() -
getMainDiagonal
public double[] getMainDiagonal() -
getLowerDiagonal
public double[] getLowerDiagonal()
-