Class DiagonalStore<N extends java.lang.Comparable<N>,​D extends Access1D<?>>

    • Field Detail

      • myMainDiagonal

        private final D extends Access1D<?> myMainDiagonal
      • myScalarFactory

        private final Scalar.Factory<N extends java.lang.Comparable<N>> myScalarFactory
      • mySubdiagonal

        private final D extends Access1D<?> mySubdiagonal
      • mySuperdiagonal

        private final D extends Access1D<?> mySuperdiagonal
      • myZero

        private final N extends java.lang.Comparable<N> myZero
    • Constructor Detail

      • DiagonalStore

        DiagonalStore​(PhysicalStore.Factory<N,​?> factory,
                      long numberOfRows,
                      long numberOfColumns,
                      D mainDiag,
                      D superdiag,
                      D subdiag)
    • Method Detail

      • doubleValue

        public double doubleValue​(int row,
                                  int col)
        Description copied from interface: Access2D
        Extracts one element of this matrix as a double.
        Parameters:
        row - A row index.
        col - A column index.
        Returns:
        One matrix element
      • firstInColumn

        public int firstInColumn​(int col)
        Description copied from interface: Structure2D
        The default value is simply 0, and if all elements are zeros then this.countRows().
        Parameters:
        col - The column index
        Returns:
        The row index of the first non-zero element in the specified column
      • firstInRow

        public int firstInRow​(int row)
        Description copied from interface: Structure2D
        The default value is simply 0, and if all elements are zeros then this.countColumns().
        Returns:
        The column index of the first non-zero element in the specified row
      • get

        public N get​(int row,
                     int col)
      • getDimension

        public int getDimension()
        Returns:
        The main diagonal length
      • getMainDiagonal

        public java.util.Optional<D> getMainDiagonal()
      • getSubdiagonal

        public java.util.Optional<D> getSubdiagonal()
      • getSuperdiagonal

        public java.util.Optional<D> getSuperdiagonal()
      • limitOfColumn

        public int limitOfColumn​(int col)
        Description copied from interface: Structure2D
        The default value is simply this.countRows(), and if all elements are zeros then 0.
        Specified by:
        limitOfColumn in interface Structure2D
        Overrides:
        limitOfColumn in class AbstractStore<N extends java.lang.Comparable<N>>
        Returns:
        The row index of the first zero element, after all non-zeros, in the specified column (index of the last non-zero + 1)
      • limitOfRow

        public int limitOfRow​(int row)
        Description copied from interface: Structure2D
        The default value is simply this.countColumns(), and if all elements are zeros then 0.
        Specified by:
        limitOfRow in interface Structure2D
        Overrides:
        limitOfRow in class AbstractStore<N extends java.lang.Comparable<N>>
        Returns:
        The column index of the first zero element, after all non-zeros, in the specified row (index of the last non-zero + 1)
      • supplyMainDiagonalTo

        public void supplyMainDiagonalTo​(double[] receiver)
      • supplySubdiagonalTo

        public void supplySubdiagonalTo​(double[] receiver)
      • supplySuperdiagonalTo

        public void supplySuperdiagonalTo​(double[] receiver)
      • toScalar

        public Scalar<N> toScalar​(int row,
                                  int col)
        Description copied from interface: Matrix2D
        Extracts one element of this matrix as a Scalar.
        Parameters:
        row - A row index.
        col - A column index.
        Returns:
        One matrix element as a Scalar.