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

Class StridedRowMatrix

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


    public final class StridedRowMatrix
    extends AStridedMatrix
    A strided matrix implementation with a column stride of 1 Provides a fast, mutable subMatrix view for the dense Matrix class
    See Also:
    Serialized Form
    • Method Detail

      • get

        public final 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
        Overrides:
        get in class AArrayMatrix
      • set

        public final void set(int i,
                              int j,
                              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 final double unsafeGet(int i,
                                      int j)
        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 AArrayMatrix
        Returns:
      • unsafeSet

        public final void unsafeSet(int i,
                                    int j,
                                    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 AArrayMatrix
      • 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
      • getRow

        public AStridedVector getRow(int i)
        Description copied from interface: IMatrix
        Returns a row of the matrix. May or may not be a view, depending on matrix type. Intended for the fastest possible read access of the row. This often means a view, but might not be (e.g. getRow on a Matrix33 returns a Vector3).
        Specified by:
        getRow in interface IMatrix
        Overrides:
        getRow in class AStridedMatrix
      • getColumn

        public AStridedVector getColumn(int i)
        Description copied from interface: IMatrix
        Returns a column of the matrix. May or may not be a view, depending on matrix type. Intended for the fastest possible read access of the column. This often means a view, but might not be (e.g. getColumn on a Matrix33 returns a Vector3).
        Specified by:
        getColumn in interface IMatrix
        Overrides:
        getColumn in class AStridedMatrix
      • 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
        Specified by:
        copyRowTo in class AStridedMatrix
        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
        Specified by:
        copyColumnTo in class AStridedMatrix
        dest - Destination double[] array
      • applyOp

        public void applyOp(Op op)
        Description copied from interface: INDArray
        Applies a unary operator to all elements of the array (in-place)
        Specified by:
        applyOp in interface INDArray
        Overrides:
        applyOp in class AStridedMatrix
      • 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
      • rowDotProduct

        public double rowDotProduct(int row,
                                    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 AStridedMatrix
        Returns:
      • setRow

        public void setRow(int row,
                           AVector v)
        Description copied from class: AMatrix
        Sets a row in a matrix to the value specified by the given vector
        Overrides:
        setRow in class AMatrix
      • getTranspose

        public AStridedMatrix 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 AStridedMatrix
        Returns:
        the transpose of this matrix
      • 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
      • 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
      • wrap

        public static StridedRowMatrix wrap(double[] data,
                                            int rows,
                                            int columns,
                                            int offset,
                                            int rowStride)
      • 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
      • equals

        public boolean equals(AMatrix a)
        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:
      • rowStride

        public int rowStride()
        Description copied from class: AStridedMatrix
        Gets the row stride for this strided matrix. Each row has this offset in the underlying data array vs. the previous row. May be positive, zero or negative.
        Specified by:
        rowStride in class AStridedMatrix
      • columnStride

        public int columnStride()
        Description copied from class: AStridedMatrix
        Gets the column stride for this strided matrix. Each column has this offset in the underlying data array vs. the previous column. May be positive, zero or negative.
        Specified by:
        columnStride in class AStridedMatrix

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.