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

Class PermutationMatrix

    • Method Detail

      • createSwap

        public static PermutationMatrix createSwap(int i,
                                                   int j,
                                                   int length)
      • createRandomPermutation

        public static PermutationMatrix createRandomPermutation(int length)
      • addToArray

        public void addToArray(double[] data,
                               int offset)
        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
      • 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
      • isSymmetric

        public boolean isSymmetric()
        Description copied from class: AMatrix
        Returns true if a matrix is symmetric
        Specified by:
        isSymmetric in interface IMatrix
        Overrides:
        isSymmetric in class AMatrix
        Returns:
      • determinant

        public double determinant()
        Description copied from class: AMatrix
        Calculates the determinant of the matrix.
        Overrides:
        determinant in class AMatrix
      • rank

        public int rank()
        Description copied from class: AMatrix
        Calculate the rank of a matrix. This is equivalent to the maximum number of linearly independent rows or columns.
        Overrides:
        rank in class AMatrix
      • isIdentity

        public boolean isIdentity()
        Description copied from interface: IMatrix
        Checks if this is an identity matrix (i.e. 1.0 in leading diagonal, 0.0 elsewhere)
        Specified by:
        isIdentity in interface IMatrix
        Overrides:
        isIdentity in class AMatrix
        Returns:
        true if this matrix is a square identity matrix, false otherwise.
      • isOrthogonal

        public boolean isOrthogonal()
        Description copied from class: AMatrix
        Check to see if the matrix is orthogonal (default tolerance: 1e-8)
        Overrides:
        isOrthogonal in class AMatrix
        Returns:
      • isOrthogonal

        public boolean isOrthogonal(double tolerance)
        Description copied from class: AMatrix
        Check to see if the matrix is orthogonal
        Overrides:
        isOrthogonal in class AMatrix
        Parameters:
        tolerance - inner product of a column with all of the next columns should be less than tolerance
        Returns:
      • hasOrthonormalColumns

        public boolean hasOrthonormalColumns()
        Description copied from class: AMatrix
        Tests whether all columns in the matrix are orthonormal vectors
        Overrides:
        hasOrthonormalColumns in class AMatrix
        Returns:
      • hasOrthonormalRows

        public boolean hasOrthonormalRows()
        Description copied from class: AMatrix
        Tests whether all rows in the matrix are orthonormal vectors
        Overrides:
        hasOrthonormalRows in class AMatrix
        Returns:
      • 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
      • 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 ABooleanMatrix
      • isUpperTriangular

        public boolean isUpperTriangular()
        Description copied from class: AMatrix
        Returns true if a matrix is upper triangular An upper triangular matrix is defined as having all elements equal to 0.0 where i > j
        Overrides:
        isUpperTriangular in class AMatrix
      • isLowerTriangular

        public boolean isLowerTriangular()
        Description copied from class: AMatrix
        Returns true if a matrix is lower triangular. A lower triangular matrix is defined as having all elements equal to 0.0 where i < j
        Overrides:
        isLowerTriangular in class AMatrix
      • 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
      • 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:
      • inverse

        public PermutationMatrix inverse()
        Description copied from class: AMatrix
        Computes the inverse of a matrix. Returns null if the matrix is singular. Throws an Exception is the matrix is not square
        Specified by:
        inverse in interface IMatrix
        Overrides:
        inverse in class AMatrix
        Returns:
        A matrix which is the inverse of this matrix, or null if the inverse does not exist.
      • getTranspose

        public PermutationMatrix 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
      • 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
      • 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
      • 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:
      • 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
      • getRow

        public AxisVector 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
        Specified by:
        getRow in interface IFastRows
        Overrides:
        getRow in class AMatrix
      • getColumn

        public AxisVector 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 AMatrix
      • 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
        Overrides:
        copyRowTo in class AMatrix
        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
        Overrides:
        copyColumnTo in class AMatrix
        dest - Destination double[] array
      • swapRows

        public void swapRows(int i,
                             int j)
        Description copied from class: AMatrix
        Swaps two rows of the matrix in place This is an elementary row operation
        Overrides:
        swapRows in class AMatrix
      • swapColumns

        public void swapColumns(int i,
                                int j)
        Description copied from class: AMatrix
        Swaps two columns of the matrix in place
        Overrides:
        swapColumns in class AMatrix
      • transform

        public void transform(AVector source,
                              AVector dest)
        Description copied from interface: IMatrix
        Transforms a source vector into a destination vector, using matrix multiplication (inner product). The destination vector is overwritten.
        Specified by:
        transform in interface IMatrix
        Overrides:
        transform in class AMatrix
      • rowDotProduct

        public double rowDotProduct(int i,
                                    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 AMatrix
        Returns:
      • innerProduct

        public Matrix innerProduct(AMatrix a)
        Description copied from interface: IMatrix
        Computes the inner product of this matrix with another. Equivalent to matrix x matrix multiplication
        Specified by:
        innerProduct in interface IMatrix
        Overrides:
        innerProduct in class AMatrix
        Returns:
      • 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 ABooleanMatrix
      • 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:
      • exactClone

        public PermutationMatrix 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
      • hasUncountable

        public boolean hasUncountable()
        Description copied from class: AMatrix
        Checks to see if any element in the matrix is NaN of Infinite.
        Specified by:
        hasUncountable in interface INDArray
        Overrides:
        hasUncountable in class ABooleanMatrix
        Returns:
        True if any element in the matrix is NaN of Infinite.
      • 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

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.