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

Class AStridedMatrix

    • Method Detail

      • getArrayOffset

        public abstract int getArrayOffset()
        Description copied from interface: IStridedArray
        Gets the data array offset for the first element of this strided array
        Specified by:
        getArrayOffset in interface IStridedArray
        Returns:
      • rowStride

        public abstract int rowStride()
        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.
      • columnStride

        public abstract int columnStride()
        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.
      • subMatrix

        public AStridedMatrix subMatrix(int rowStart,
                                        int rowCount,
                                        int colStart,
                                        int colCount)
        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
      • 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 AMatrix
      • 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 AMatrix
      • getRowView

        public AStridedVector getRowView(int i)
        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
      • 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:
      • 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:
      • getBand

        public AStridedVector getBand(int i)
        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:
      • 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
      • addToArray

        public void addToArray(double[] dest,
                               int destOffset)
        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
      • 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 AMatrix
      • applyOpCopy

        public final Matrix applyOpCopy(Op op)
        Description copied from interface: INDArray
        Applies a unary operator to all elements of the array (creating a new array)
        Specified by:
        applyOpCopy in interface INDArray
        Overrides:
        applyOpCopy 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
      • rowDotProduct

        public double rowDotProduct(int i,
                                    AVector a)
        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:
      • add

        public void add(AMatrix m)
        Description copied from class: AMatrix
        Adds another matrix to this matrix. Matrices must be the same size.
        Overrides:
        add in class AMatrix
      • copyRowTo

        public abstract 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 abstract 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
      • getStrides

        public int[] getStrides()
        Description copied from interface: IStridedArray
        Gets the strides for each dimension of this strided array. The returned array should not be modified
        Specified by:
        getStrides in interface IStridedArray
        Returns:
      • getStride

        public int getStride(int dimension)
        Description copied from interface: IStridedArray
        Gets the stide for a specific dimension in this strided array.
        Specified by:
        getStride in interface IStridedArray
        Returns:
      • 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
      • 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 AMatrix
        Returns:
        the transpose of this matrix
      • asDoubleArray

        public double[] asDoubleArray()
        Description copied from interface: INDArray
        Returns the underlying double array representing the densely packed elements of this array. Modifications to this double array will change the original array. Returns null if there is no such array.
        Specified by:
        asDoubleArray in interface INDArray
        Overrides:
        asDoubleArray 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
      • clone

        public final Matrix 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

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.