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

Class DenseColumnMatrix

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


    public final class DenseColumnMatrix
    extends AStridedMatrix
    implements IFastColumns, IDense
    A densely packed matrix organised in column-major format. Transposes to/from a regular dense Matrix This class is useful if your main performance requirement is fast access to columns of a matrix. This is frequently true when the matrix is used as the *second* argument in matrix/matrix operations.
    See Also:
    Serialized Form
    • Method Detail

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

        public ArraySubVector getColumn(int j)
        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
        Specified by:
        getColumn in interface IFastColumns
        Overrides:
        getColumn in class AStridedMatrix
      • copyRowTo

        public void copyRowTo(int i,
                              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:
        i - The index of the selected row
        dest - Destination double[] array
        destOffset - Offset into destination array
      • copyColumnTo

        public void copyColumnTo(int j,
                                 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
      • setRow

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

        public void setColumn(int j,
                              AVector col)
        Description copied from class: AMatrix
        Sets a column in a matrix.
        Overrides:
        setColumn in class AMatrix
      • addMultiple

        public void addMultiple(AMatrix m,
                                double factor)
        Description copied from class: AMatrix
        Adds a scalar multiple of another matrix to this matrix
        Overrides:
        addMultiple in class AMatrix
      • set

        public void set(AMatrix m)
        Description copied from class: AMatrix
        Sets this matrix with the element values from another matrix. Source matrix must have the same shape.
        Overrides:
        set in class AMatrix
      • 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
        Overrides:
        get in class AArrayMatrix
      • set

        public 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
      • unsafeSet

        public 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
      • unsafeGet

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

        public void addAt(int i,
                          int j,
                          double d)
        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
      • 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
      • 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
      • 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 AStridedMatrix
      • 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>
      • abs

        public void abs()
        Description copied from interface: INDArray
        Replaces all elements of this array with their absolute values, according to Math.abs(double)
        Specified by:
        abs in interface INDArray
        Overrides:
        abs in class AMatrix
      • signum

        public void signum()
        Description copied from interface: INDArray
        Calculates the signum of all elements of this mutable array Sets each component of the array to its sign value (-1, 0 or 1)
        Specified by:
        signum in interface INDArray
        Overrides:
        signum in class AMatrix
      • square

        public void square()
        Description copied from interface: INDArray
        Squares all elements of the array in place
        Specified by:
        square in interface INDArray
        Overrides:
        square in class AMatrix
      • exp

        public void exp()
        Description copied from interface: INDArray
        Computes the function e^x (in-place) for all array elements
        Specified by:
        exp in interface INDArray
        Overrides:
        exp in class AMatrix
      • log

        public void log()
        Description copied from interface: INDArray
        Computes the natural logarithm (in-place) for all array elements
        Specified by:
        log in interface INDArray
        Overrides:
        log 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 AStridedMatrix
      • 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
      • add

        public void add(double d)
        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
      • multiply

        public void multiply(double factor)
        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
      • 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
      • reciprocal

        public void reciprocal()
        Description copied from interface: INDArray
        Replaces all elements in the array with their reciprocal
        Specified by:
        reciprocal in interface INDArray
        Overrides:
        reciprocal in class AMatrix
      • clamp

        public void clamp(double min,
                          double max)
        Description copied from interface: INDArray
        Clamps all the elements of this array within the specified [min,max] range
        Specified by:
        clamp in interface INDArray
        Overrides:
        clamp in class AMatrix
      • getTranspose

        public Matrix 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
      • exactClone

        public DenseColumnMatrix 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
      • dense

        public DenseColumnMatrix dense()
        Description copied from interface: INDArray
        Coerces this INDArray to a dense format, without changing its element values. May return the same INDArray if already dense. May also mutate the internal structure of the original NDArray, or create a view over parts of the original INDArray. You should take a defensive copy of the original NDArray if any of this concerns you. The returned dense array may not be fully mutable in all elements.
        Specified by:
        dense in interface INDArray
        Overrides:
        dense in class AMatrix
      • copy

        public DenseColumnMatrix copy()
        Description copied from interface: INDArray
        Returns a defensive copy of the array data. Use this if the original array might change and you need a defensive copy. May return the same array if the original was immutable, otherwise will return a defensive copy.
        Specified by:
        copy in interface INDArray
        Overrides:
        copy 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

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.