Documentation of 'mikera.matrixx.impl.ABandedMatrix' Java class
ABandedMatrix
mikera.matrixx.impl

Class ABandedMatrix

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<INDArray>, java.lang.Iterable<AVector>, INDArray, IMatrix, IFastBands
    Direct Known Subclasses:
    ASingleBandMatrix, BandedMatrix


    public abstract class ABandedMatrix
    extends AMatrix
    implements IFastBands
    Abstract base class for banded matrices Banded matrix implementations are assumed to store their data efficiently in diagonal bands, so functions on banded matrices can be designed to exploit this fact. May be either square or rectangular
    See Also:
    Serialized Form
    • Constructor Detail

      • ABandedMatrix

        public ABandedMatrix()
    • Method Detail

      • upperBandwidthLimit

        public abstract int upperBandwidthLimit()
        Description copied from class: AMatrix
        A limit on the upper bandwidth of the banded matrix. Actual upper bandwidth is guaranteed to be less than or equal to this value. Implementation should be O(1).
        Overrides:
        upperBandwidthLimit in class AMatrix
        Returns:
      • lowerBandwidthLimit

        public abstract int lowerBandwidthLimit()
        Description copied from class: AMatrix
        A limit on the lower bandwidth of the banded matrix. Actual lower bandwidth is guaranteed to be less than or equal to this value. Implementation should be O(1).
        Overrides:
        lowerBandwidthLimit in class AMatrix
        Returns:
      • getBand

        public abstract AVector getBand(int band)
        Description copied from class: AMatrix
        Gets a specific band of the matrix, as a view vector. The band is truncated at the edges of the matrix, i.e. it does not wrap around the matrix.
        Specified by:
        getBand in interface IMatrix
        Specified by:
        getBand in interface IFastBands
        Overrides:
        getBand in class AMatrix
        Returns:
      • upperBandwidth

        public int upperBandwidth()
        Description copied from class: AMatrix
        Computes the upper bandwidth of a matrix, i.e. the number of bands above the leading diagonal that cover all non-zero values
        Overrides:
        upperBandwidth in class AMatrix
        Returns:
      • lowerBandwidth

        public int lowerBandwidth()
        Description copied from class: AMatrix
        Computes the lower bandwidth of a matrix, i.e. the number of bands below the leading diagonal that cover all non-zero values
        Overrides:
        lowerBandwidth in class AMatrix
        Returns:
      • isMutable

        public boolean isMutable()
        Description copied from interface: INDArray
        Returns true if the INDArray is mutable (at least partially)
        Specified by:
        isMutable in interface INDArray
        Overrides:
        isMutable in class AMatrix
      • isFullyMutable

        public boolean isFullyMutable()
        Description copied from interface: INDArray
        If this method returns true, the INDArray is guaranteed to be fully mutable in all positions i.e. every position can store any valid double value
        Specified by:
        isFullyMutable in interface INDArray
        Specified by:
        isFullyMutable in class AMatrix
      • isSymmetric

        public boolean isSymmetric()
        Description copied from class: AMatrix
        Returns true if a matrix is symmetric
        Specified by:
        isSymmetric in interface IMatrix
        Overrides:
        isSymmetric in class AMatrix
        Returns:
      • isUpperTriangular

        public boolean isUpperTriangular()
        Description copied from class: AMatrix
        Returns true if a matrix is upper triangular An upper triangular matrix is defined as having all elements equal to 0.0 where i > j
        Overrides:
        isUpperTriangular in class AMatrix
      • isLowerTriangular

        public boolean isLowerTriangular()
        Description copied from class: AMatrix
        Returns true if a matrix is lower triangular. A lower triangular matrix is defined as having all elements equal to 0.0 where i < j
        Overrides:
        isLowerTriangular in class AMatrix
      • getRowView

        public AVector getRowView(int row)
        Description copied from interface: IMatrix
        Returns a row of the matrix as a vector view. May be used to modify the original matrix.
        Specified by:
        getRowView in interface IMatrix
        Overrides:
        getRowView in class AMatrix
      • copyRowTo

        public void copyRowTo(int row,
                              double[] dest,
                              int destOffset)
        Description copied from class: AMatrix
        Copies the elements in a selected row of this matrix to a double array
        Overrides:
        copyRowTo in class AMatrix
        Parameters:
        row - The index of the selected row
        dest - Destination double[] array
        destOffset - Offset into destination array
      • nonZeroCount

        public long nonZeroCount()
        Description copied from interface: INDArray
        Returns the number of non-zero elements in the array.
        Specified by:
        nonZeroCount in interface INDArray
        Overrides:
        nonZeroCount in class AMatrix
      • isZero

        public boolean isZero()
        Description copied from class: AMatrix
        Returns true if the matrix is the zero matrix (all components zero)
        Specified by:
        isZero in interface INDArray
        Overrides:
        isZero in class AMatrix
      • elementSum

        public double elementSum()
        Description copied from class: AMatrix
        Returns the sum of all elements in this matrix
        Specified by:
        elementSum in interface INDArray
        Overrides:
        elementSum in class AMatrix
      • trace

        public double trace()
        Description copied from interface: IMatrix
        Computes the trace of a matrix, i.e. the sum of all elements on the leading diagonal
        Specified by:
        trace in interface IMatrix
        Overrides:
        trace in class AMatrix
        Returns:
      • diagonalProduct

        public double diagonalProduct()
        Description copied from class: AMatrix
        Computes the product of entries on the main diagonal of a matrix
        Specified by:
        diagonalProduct in interface IMatrix
        Overrides:
        diagonalProduct in class AMatrix
        Returns:
      • fill

        public void fill(double value)
        Description copied from interface: INDArray
        Fills this array with a single double value. Requires the array to be mutable.
        Specified by:
        fill in interface INDArray
        Overrides:
        fill in class AMatrix
      • setSparse

        public void setSparse(double value)
        Description copied from interface: INDArray
        Sets the non-sparse elements of this array to the specified value May throw an exception if non-sparse elements are not mutable
        Specified by:
        setSparse in interface INDArray
        Overrides:
        setSparse in class AbstractArray<AVector>
      • multiply

        public void multiply(double value)
        Description copied from interface: INDArray
        Multiplies all elements of the array in place by a given double value
        Specified by:
        multiply in interface INDArray
        Overrides:
        multiply in class AMatrix
      • toMatrix

        public Matrix toMatrix()
        Description copied from class: AMatrix
        Coerces the matrix to the standard mutable Matrix type in row major order. Performs a copy if necessary.
        Overrides:
        toMatrix in class AMatrix
      • toMatrixTranspose

        public Matrix toMatrixTranspose()
        Description copied from class: AMatrix
        Coerces the transpose of a matrix to the standard mutable Matrix type in row major order. Performs a copy if necessary.
        Overrides:
        toMatrixTranspose in class AMatrix
      • addToArray

        public void addToArray(double[] data,
                               int offset)
        Description copied from interface: INDArray
        Adds all the elements of this array to a double array at the specified offset, in row-major order
        Specified by:
        addToArray in interface INDArray
        Overrides:
        addToArray in class AMatrix
      • toDoubleArray

        public double[] toDoubleArray()
        Description copied from interface: INDArray
        Copies the elements of this array to a new double[] array.
        Specified by:
        toDoubleArray in interface INDArray
        Overrides:
        toDoubleArray in class AMatrix
      • validate

        public void validate()
        Description copied from interface: INDArray
        Validates the internal data structure of the INDArray. Throws an exception on failure. Failure indicates a serious bug and/or data corruption.
        Specified by:
        validate in interface INDArray
        Overrides:
        validate in class AMatrix

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.