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

Class ZeroMatrix

    • Method Detail

      • 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
      • create

        public static ZeroMatrix create(int rows,
                                        int columns)
        Create a ZeroMatrix of the specified size
        Parameters:
        rows -
        columns -
        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
      • 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:
      • isDiagonal

        public boolean isDiagonal()
        Description copied from interface: IMatrix
        Returns true iff this matrix is a square diagonal matrix
        Specified by:
        isDiagonal in interface IMatrix
        Overrides:
        isDiagonal in class AMatrix
      • 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
      • isBoolean

        public boolean isBoolean()
        Description copied from interface: INDArray
        Returns true if the array is boolean (contains only 0.0 or 1.0 values)
        Specified by:
        isBoolean in interface INDArray
        Overrides:
        isBoolean in class AMatrix
      • upperBandwidthLimit

        public 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 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:
      • 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
      • getColumnView

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

        public AVector getRowClone(int row)
        Description copied from interface: IMatrix
        Returns a row of the matrix as a new cloned, mutable vector. The cloned row may be modified without affecting the original matrix.
        Specified by:
        getRowClone in interface IMatrix
        Overrides:
        getRowClone in class AMatrix
      • getColumnClone

        public AVector getColumnClone(int col)
        Description copied from interface: IMatrix
        Returns a column of the matrix as a new cloned, mutable vector The cloned column may be modified without affecting the original matrix.
        Specified by:
        getColumnClone in interface IMatrix
        Overrides:
        getColumnClone 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
      • copyColumnTo

        public void copyColumnTo(int col,
                                 double[] dest,
                                 int destOffset)
        Description copied from class: AMatrix
        Copies the elements in a selected row of this matrix to a double array
        Overrides:
        copyColumnTo in class AMatrix
        dest - Destination double[] array
      • addToArray

        public void addToArray(double[] dest,
                               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
      • setSparse

        public void setSparse(AMatrix a)
        Description copied from class: AMatrix
        Sets the non-sparse elements in this matrix to the corresponding values in the source matrix
        Overrides:
        setSparse in class AMatrix
      • reduce

        public double reduce(Op2 op,
                             double init)
        Description copied from interface: INDArray
        Reduces over all elements of the array in row-major order. Applies the operator to the initial/previous result at each step. Returns the final result.
        Specified by:
        reduce in interface INDArray
        Overrides:
        reduce in class AMatrix
      • reduce

        public double reduce(Op2 op)
        Description copied from interface: INDArray
        Reduces over all elements of the array in row-major order. Applies the operator to the previous result at each step. Returns the final result.
        Specified by:
        reduce in interface INDArray
        Overrides:
        reduce in class AMatrix
      • getElements

        public void getElements(double[] dest,
                                int destOffset)
        Description copied from interface: INDArray
        Copies all elements of this array a double array at the specified offset
        Specified by:
        getElements in interface INDArray
        Overrides:
        getElements in class AMatrix
      • determinant

        public double determinant()
        Description copied from class: AMatrix
        Calculates the determinant of the matrix.
        Overrides:
        determinant in class AMatrix
      • rank

        public int rank()
        Description copied from class: AMatrix
        Calculate the rank of a matrix. This is equivalent to the maximum number of linearly independent rows or columns.
        Overrides:
        rank 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:
      • rowDotProduct

        public double rowDotProduct(int i,
                                    AVector v)
        Description copied from class: AMatrix
        Returns the dot product of a specific row with a vector. Unsafe operation: performs no bounds checking
        Overrides:
        rowDotProduct in class AMatrix
        Returns:
      • get

        public double get(int i,
                          int j)
        Description copied from interface: INDArray
        Returns the double value at the specified position in a 2D matrix
        Specified by:
        get in interface INDArray
        Specified by:
        get in interface IMatrix
        Specified by:
        get in class AMatrix
      • unsafeGet

        public double unsafeGet(int row,
                                int column)
        Description copied from class: AMatrix
        Gets an element in the matrix in an unsafe fashion, without performing bound checks The result is undefined if the row and column are out of bounds.
        Overrides:
        unsafeGet in class AMatrix
        Returns:
      • unsafeSet

        public void unsafeSet(int row,
                              int column,
                              double value)
        Description copied from class: AMatrix
        Sets an element value in the matrix in an unsafe fashion, without performing bound checks The result is undefined if the row and column are out of bounds.
        Overrides:
        unsafeSet in class AMatrix
      • clone

        public AMatrix clone()
        Description copied from interface: INDArray
        Returns a clone of the array data, as a new array which will be fully mutable and may be of a different class to the original. Clone should attempt to return the most efficient possible array type. Clone should preserve sparsity property where possible, but this is not guaranteed.
        Specified by:
        clone in interface INDArray
        Overrides:
        clone 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
      • elementMax

        public double elementMax()
        Description copied from interface: INDArray
        Returns the maximum element value in this array. Throws an error if there are no elements.
        Specified by:
        elementMax in interface INDArray
        Overrides:
        elementMax in class AbstractArray<AVector>
      • elementMin

        public double elementMin()
        Description copied from interface: INDArray
        Returns the maximum element value in this array. Throws an error if there are no elements.
        Specified by:
        elementMin in interface INDArray
        Overrides:
        elementMin in class AbstractArray<AVector>
      • 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
      • transform

        public void transform(AVector input,
                              AVector output)
        Description copied from interface: IMatrix
        Transforms a source vector into a destination vector, using matrix multiplication (inner product). The destination vector is overwritten.
        Specified by:
        transform in interface IMatrix
        Overrides:
        transform in class AMatrix
      • isInvertible

        public boolean isInvertible()
        Description copied from interface: IMatrix
        Checks if this is an invertible matrix (i.e. a square matrix with a non-zero determinant)
        Specified by:
        isInvertible in interface IMatrix
        Overrides:
        isInvertible in class AMatrix
        Returns:
        true if invertible, false otherwise
      • asVector

        public AVector asVector()
        Description copied from class: AMatrix
        Returns the matrix values as a single reference Vector in the form [row0 row1 row2....]
        Specified by:
        asVector in interface INDArray
        Overrides:
        asVector in class AMatrix
      • innerProduct

        public AMatrix innerProduct(AMatrix m)
        Description copied from interface: IMatrix
        Computes the inner product of this matrix with another. Equivalent to matrix x matrix multiplication
        Specified by:
        innerProduct in interface IMatrix
        Overrides:
        innerProduct in class AMatrix
        Returns:
      • multiplyCopy

        public ZeroMatrix multiplyCopy(double a)
        Description copied from interface: INDArray
        Returns a copy of the array with all elements multiplied by a single constant value
        Specified by:
        multiplyCopy in interface INDArray
        Overrides:
        multiplyCopy in class AMatrix
        Parameters:
        a - A scalar factor
        Returns:
        A new array, with all element values scaled by the given factor
      • multiply

        public void multiply(AMatrix m)
        Description copied from class: AMatrix
        Multiplies this matrix in-place by another in an entrywise manner (Hadamard product).
        Overrides:
        multiply in class AMatrix
      • equals

        public boolean equals(AMatrix m)
        Description copied from class: AMatrix
        Returns true if this matrix is exactly equal to another matrix
        Overrides:
        equals in class AMatrix
      • equalsArray

        public boolean equalsArray(double[] data,
                                   int offset)
        Description copied from interface: INDArray
        Returns true if the elements in this array exactly match the elements in the given array, in row-major order
        Specified by:
        equalsArray in interface INDArray
        Overrides:
        equalsArray in class AMatrix
        Parameters:
        data - Array of double element values to check for equality
        offset - Offset into the data array
        Returns:
      • getTranspose

        public ZeroMatrix getTranspose()
        Description copied from interface: INDArray
        Returns the transpose of this array. A transpose of an array is equivalent to reversing the order of dimensions. May or may not return a view depending on the array type.
        Specified by:
        getTranspose in interface INDArray
        Specified by:
        getTranspose in interface IMatrix
        Overrides:
        getTranspose in class AMatrix
        Returns:
        the transpose of this matrix
      • 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
      • 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
      • sparseClone

        public AMatrix sparseClone()
        Description copied from interface: INDArray
        Creates a fully mutable clone of this array. Will use a sparse format if possible.
        Specified by:
        sparseClone in interface INDArray
        Overrides:
        sparseClone 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
      • getLeadingDiagonal

        public AVector getLeadingDiagonal()
        Description copied from class: AMatrix
        Returns a vector view of the leading diagonal values of the matrix
        Overrides:
        getLeadingDiagonal in class AMatrix
        Returns:
      • getBand

        public 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
        Overrides:
        getBand in class AMatrix
        Returns:
      • subMatrix

        public AMatrix subMatrix(int rowStart,
                                 int rows,
                                 int colStart,
                                 int cols)
        Description copied from interface: IMatrix
        Gets a rectangular submatrix view of part of a matrix
        Specified by:
        subMatrix in interface IMatrix
        Overrides:
        subMatrix in class AMatrix
      • elementIterator

        public java.util.Iterator<java.lang.Double> elementIterator()
        Description copied from interface: INDArray
        Returns an iterator over all elements in this array, in row-major order
        Specified by:
        elementIterator in interface INDArray
        Overrides:
        elementIterator in class AMatrix
      • exactClone

        public ZeroMatrix exactClone()
        Description copied from interface: INDArray
        Creates a deep clone of an array, using the same class implementation as the original array
        Specified by:
        exactClone in interface INDArray
        Specified by:
        exactClone in class AMatrix
        Returns:
        A clone of the original array
      • hasUncountable

        public boolean hasUncountable()
        Description copied from class: AMatrix
        Checks to see if any element in the matrix is NaN of Infinite.
        Specified by:
        hasUncountable in interface INDArray
        Overrides:
        hasUncountable in class AMatrix
        Returns:
        True if any element in the matrix is NaN of Infinite.

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.