Class SPDTridiagMatrix

  • All Implemented Interfaces:
    java.lang.Iterable<MatrixEntry>, Matrix

    public class SPDTridiagMatrix
    extends SymmTridiagMatrix
    Symmetrical positive definite tridiagonal matrix. Same as SymmTridiagMatrix, and is used as a marker class to allow for more efficient solvers.
    • Constructor Detail

      • SPDTridiagMatrix

        public SPDTridiagMatrix​(int n)
        Constructor for SPDTridiagMatrix
        Parameters:
        n - Size of the matrix. Since the matrix must be square, this equals both the number of rows and columns
      • SPDTridiagMatrix

        public SPDTridiagMatrix​(Matrix A)
        Constructor for SPDTridiagMatrix
        Parameters:
        A - Matrix to copy contents from. Only main and the superdiagonal is copied over
      • SPDTridiagMatrix

        public SPDTridiagMatrix​(Matrix A,
                                boolean deep)
        Constructor for SPDTridiagMatrix
        Parameters:
        A - Matrix to copy contents from. Only main and the superdiagonal is copied over
        deep - True for a deep copy. For shallow copies A must be a SymmTridiagMatrix
    • Method Detail

      • solve

        public Matrix solve​(Matrix B,
                            Matrix X)
        Description copied from interface: Matrix
        X = A\B. Not all matrices support this operation, those that do not throw UnsupportedOperationException. Note that it is often more efficient to use a matrix decomposition and its associated solver
        Specified by:
        solve in interface Matrix
        Overrides:
        solve in class SymmTridiagMatrix
        Parameters:
        B - Matrix with the same number of rows as A, and the same number of columns as X
        X - Matrix with a number of rows equal A.numColumns(), and the same number of columns as B
        Returns:
        X