Documentation of 'mikera.matrixx.IMatrix' Java class
IMatrix
mikera.matrixx

Interface IMatrix

    • Method Detail

      • rowCount

        int rowCount()
        Gets the number of rows in this matrix (dimension 0)
        Returns:
      • columnCount

        int columnCount()
        Gets the number of columns in this matrix (dimension 1)
        Returns:
      • get

        double get(int row,
                   int column)
        Gets the element at the specified position in this matrix
        Specified by:
        get in interface INDArray
        Returns:
      • set

        void set(int row,
                 int column,
                 double value)
        Sets the element at the specified position in this matrix
        Specified by:
        set in interface INDArray
      • getRow

        AVector getRow(int row)
        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).
      • getColumn

        AVector getColumn(int column)
        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).
      • getRowView

        AVector getRowView(int row)
        Returns a row of the matrix as a vector view. May be used to modify the original matrix.
      • getColumnView

        AVector getColumnView(int column)
        Returns a column of the matrix as a vector view. May be used to modify the original matrix.
      • getRowClone

        AVector getRowClone(int row)
        Returns a row of the matrix as a new cloned, mutable vector. The cloned row may be modified without affecting the original matrix.
      • getColumnClone

        AVector getColumnClone(int column)
        Returns a column of the matrix as a new cloned, mutable vector The cloned column may be modified without affecting the original matrix.
      • getBand

        AVector getBand(int band)
        Gets a band of a matrix The band is defined such that: - 0 is the main diagonal - bands above the main diagonal are 1, 2, 3 etc. - bands below the main diagonal are -1, -2, -3 etc.
        Parameters:
        band -
        Returns:
      • getTranspose

        AMatrix getTranspose()
        Returns the transpose of this matrix. Will be a transposed view by default, but specialised matrix type may override this if they are able to provide a better implementation.
        Specified by:
        getTranspose in interface INDArray
        Returns:
        the transpose of this matrix
      • getTransposeView

        AMatrix getTransposeView()
        Returns a transposed view of this matrix.
        Specified by:
        getTransposeView in interface INDArray
        Returns:
        the transpose of this matrix, as a view
      • transposeInPlace

        void transposeInPlace()
        Transposes a matrix in place, if possible. Throws an exception if this is not possible (e.g. if the matrix is not square or not sufficiently mutable)
      • isSquare

        boolean isSquare()
        Checks if this is a square matrix
        Returns:
        true if square, false otherwise
      • isInvertible

        boolean isInvertible()
        Checks if this is an invertible matrix (i.e. a square matrix with a non-zero determinant)
        Returns:
        true if invertible, false otherwise
      • isIdentity

        boolean isIdentity()
        Checks if this is an identity matrix (i.e. 1.0 in leading diagonal, 0.0 elsewhere)
        Returns:
        true if this matrix is a square identity matrix, false otherwise.
      • innerProduct

        AVector innerProduct(AVector source)
        Transforms a source vector into a using matrix multiplication (inner product).
        Specified by:
        innerProduct in interface INDArray
        Parameters:
        source - A vector
        Returns:
        A new vector
      • innerProduct

        Vector innerProduct(Vector source)
        Transforms a dense source Vector using matrix multiplication (inner product).
        Returns:
        A new dense vector
      • transform

        void transform(AVector source,
                       AVector dest)
        Transforms a source vector into a destination vector, using matrix multiplication (inner product). The destination vector is overwritten.
      • transformInPlace

        void transformInPlace(AVector v)
      • inverse

        AMatrix inverse()
        Computes the inverse of this matrix.
        Returns:
        A matrix which is the inverse of this matrix, or null if the inverse does not exist.
      • trace

        double trace()
        Computes the trace of a matrix, i.e. the sum of all elements on the leading diagonal
        Returns:
      • addCopy

        AMatrix addCopy(AMatrix a)
        Adds another matrix to this matrix, returning a new matrix
        Parameters:
        v -
        Returns:
      • addCopy

        AMatrix addCopy(AVector v)
        Adds a vector to every row of this matrix, returning a new matrix
        Parameters:
        v -
        Returns:
      • diagonalProduct

        double diagonalProduct()
        Returns the product of all elements on the leading diagonal of this matrix
        Returns:
      • innerProduct

        AMatrix innerProduct(AMatrix a)
        Computes the inner product of this matrix with another. Equivalent to matrix x matrix multiplication
        Parameters:
        a -
        Returns:
      • getRows

        java.util.List<AVector> getRows()
        Gets a List of rows of a matrix. May return either copies or views, depending on the specific matrix type.
        Returns:
      • getColumns

        java.util.List<AVector> getColumns()
        Gets a List of columns of a matrix. May return either copies or views, depending on the specific matrix type.
        Returns:
      • isSymmetric

        boolean isSymmetric()
        Returns true if this matrix is symmetric
        Returns:
      • add2

        void add2(AMatrix a,
                  AMatrix b)
        Adds two matrices to this matrix. May be better optimised than adding both matrices individually.
        Parameters:
        a -
        b -
      • isDiagonal

        boolean isDiagonal()
        Returns true iff this matrix is a square diagonal matrix
      • isRectangularDiagonal

        boolean isRectangularDiagonal()
        Returns true iff this matrix is a diagonal matrix (might not be square)
      • toNestedDoubleArrays

        double[][] toNestedDoubleArrays()
        Converts this matrix to nested double[][] array
        Returns:
      • subMatrix

        AMatrix subMatrix(int rowStart,
                          int rows,
                          int colStart,
                          int cols)
        Gets a rectangular submatrix view of part of a matrix
      • addAt

        void addAt(int i,
                   int j,
                   double d)
        Adds a value at a specific position in the matrix, mutating the matrix Does not perform bounds checking - this in an unsafe operation

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.