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

Class QuadtreeMatrix

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<INDArray>, java.lang.Iterable<AVector>, INDArray, ISparse, IMatrix


    public class QuadtreeMatrix
    extends ABlockMatrix
    implements ISparse
    A matrix implemented as a quadtree of submatrices. Useful for large matrices with heirarchical structure where large regions are either fully sparse or of a specialised subtype (e.g. a diagonal matrix).
    See Also:
    Serialized Form
    • 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
      • 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
      • 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 ABlockMatrix
      • 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
      • get

        public double get(int row,
                          int column)
        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
      • set

        public void set(int row,
                        int column,
                        double value)
        Description copied from interface: INDArray
        Sets a value at a given position in a mutable 2D array
        Specified by:
        set in interface INDArray
        Specified by:
        set in interface IMatrix
        Overrides:
        set in class ARectangularMatrix
      • 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
      • addAt

        public void addAt(int row,
                          int column,
                          double value)
        Description copied from interface: IMatrix
        Adds a value at a specific position in the matrix, mutating the matrix Does not perform bounds checking - this in an unsafe operation
        Specified by:
        addAt in interface IMatrix
        Overrides:
        addAt in class AMatrix
      • copyRowTo

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

        public void copyColumnTo(int col,
                                 double[] data,
                                 int offset)
        Description copied from class: AMatrix
        Copies the elements in a selected row of this matrix to a double array
        Overrides:
        copyColumnTo in class ABlockMatrix
        data - Destination double[] 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
      • 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
      • 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>
      • 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>
      • fill

        public void fill(double v)
        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
      • add

        public void add(double v)
        Description copied from interface: INDArray
        Adds a double value to all elements in this array. Implementations may optimize the case of 0.0
        Specified by:
        add in interface INDArray
        Overrides:
        add in class AMatrix
      • add

        public void add(AVector v)
        Description copied from class: AMatrix
        Adds a vector to every row of this matrix.
        Overrides:
        add 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 ABlockMatrix
      • exactClone

        public AMatrix 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
      • density

        public double density()
        Description copied from interface: ISparse
        Computes the density ratio of this sparse array (proportion of non-zero elements)
        Specified by:
        density in interface ISparse
        Overrides:
        density in class AbstractArray<AVector>
        Returns:

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.