Class MatrixOps_FDRB


  • public class MatrixOps_FDRB
    extends java.lang.Object
    Various operations on FMatrixRBlock.
    • Constructor Summary

      Constructors 
      Constructor Description
      MatrixOps_FDRB()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean blockAligned​(int blockLength, org.ejml.data.FSubmatrixD1 A)
      Checks to see if the submatrix has its boundaries along inner blocks.
      static void checkIdenticalShape​(org.ejml.data.FMatrixRBlock A, org.ejml.data.FMatrixRBlock B)
      Checks to see if the two matrices have an identical shape an block size.
      static org.ejml.data.FMatrixRMaj convert​(org.ejml.data.FMatrixRBlock src, org.ejml.data.FMatrixRMaj dst)
      Converts a row major block matrix into a row major matrix.
      static org.ejml.data.FMatrixRBlock convert​(org.ejml.data.FMatrixRMaj A)  
      static org.ejml.data.FMatrixRBlock convert​(org.ejml.data.FMatrixRMaj A, int blockLength)  
      static void convert​(org.ejml.data.FMatrixRMaj src, org.ejml.data.FMatrixRBlock dst)
      Converts a row major matrix into a row major block matrix.
      static void convertBlockToRow​(int numRows, int numCols, int blockLength, float[] data, float[] tmp)
      Converts matrix data stored is a block row major format into a row major format in place.
      static void convertRowToBlock​(int numRows, int numCols, int blockLength, float[] data, float[] tmp)
      Converts matrix data stored is a row major format into a block row major format in place.
      static void convertTranSrc​(org.ejml.data.FMatrixRMaj src, org.ejml.data.FMatrixRBlock dst)
      Converts the transpose of a row major matrix into a row major block matrix.
      static void copyTriangle​(boolean upper, org.ejml.data.FMatrixRBlock src, org.ejml.data.FMatrixRBlock dst)
      Copies either the upper or lower triangular portion of src into dst.
      static org.ejml.data.FMatrixRBlock createRandom​(int numRows, int numCols, float min, float max, java.util.Random rand)  
      static org.ejml.data.FMatrixRBlock createRandom​(int numRows, int numCols, float min, float max, java.util.Random rand, int blockLength)  
      static void extractAligned​(org.ejml.data.FMatrixRBlock src, org.ejml.data.FMatrixRBlock dst)
      Extracts a matrix from src into dst.
      static org.ejml.data.FMatrixRBlock identity​(int numRows, int numCols, int blockLength)
      Returns a new matrix with ones along the diagonal and zeros everywhere else.
      static boolean isEquals​(org.ejml.data.FMatrixRBlock A, org.ejml.data.FMatrixRBlock B)  
      static boolean isEquals​(org.ejml.data.FMatrixRBlock A, org.ejml.data.FMatrixRBlock B, float tol)  
      static void mult​(org.ejml.data.FMatrixRBlock A, org.ejml.data.FMatrixRBlock B, org.ejml.data.FMatrixRBlock C)  
      static void multTransA​(org.ejml.data.FMatrixRBlock A, org.ejml.data.FMatrixRBlock B, org.ejml.data.FMatrixRBlock C)  
      static void multTransB​(org.ejml.data.FMatrixRBlock A, org.ejml.data.FMatrixRBlock B, org.ejml.data.FMatrixRBlock C)  
      static void set​(org.ejml.data.FMatrixRBlock A, float value)
      Sets every element in the matrix to the specified value.

      aij = value
      static void setIdentity​(org.ejml.data.FMatrixRBlock A)
      Sets the value of A to all zeros except along the diagonal.
      static org.ejml.data.FMatrixRBlock transpose​(org.ejml.data.FMatrixRBlock A, org.ejml.data.FMatrixRBlock A_tran)
      Transposes a block matrix.
      static void zeroTriangle​(boolean upper, org.ejml.data.FMatrixRBlock A)
      Sets either the upper or low triangle of a matrix to zero
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MatrixOps_FDRB

        public MatrixOps_FDRB()
    • Method Detail

      • convert

        public static void convert​(org.ejml.data.FMatrixRMaj src,
                                   org.ejml.data.FMatrixRBlock dst)
        Converts a row major matrix into a row major block matrix.
        Parameters:
        src - Original FMatrixRMaj. Not modified.
        dst - Equivalent FMatrixRBlock. Modified.
      • convertRowToBlock

        public static void convertRowToBlock​(int numRows,
                                             int numCols,
                                             int blockLength,
                                             float[] data,
                                             float[] tmp)

        Converts matrix data stored is a row major format into a block row major format in place.

        Parameters:
        numRows - number of rows in the matrix.
        numCols - number of columns in the matrix.
        blockLength - Block size in the converted matrix.
        data - Matrix data in a row-major format. Modified.
        tmp - Temporary data structure that is to be the size of a block row.
      • convert

        public static org.ejml.data.FMatrixRMaj convert​(org.ejml.data.FMatrixRBlock src,
                                                        org.ejml.data.FMatrixRMaj dst)
        Converts a row major block matrix into a row major matrix.
        Parameters:
        src - Original FMatrixRBlock.. Not modified.
        dst - Equivalent FMatrixRMaj. Modified.
      • convertBlockToRow

        public static void convertBlockToRow​(int numRows,
                                             int numCols,
                                             int blockLength,
                                             float[] data,
                                             float[] tmp)

        Converts matrix data stored is a block row major format into a row major format in place.

        Parameters:
        numRows - number of rows in the matrix.
        numCols - number of columns in the matrix.
        blockLength - Block size in the converted matrix.
        data - Matrix data in a block row-major format. Modified.
        tmp - Temporary data structure that is to be the size of a block row.
      • convertTranSrc

        public static void convertTranSrc​(org.ejml.data.FMatrixRMaj src,
                                          org.ejml.data.FMatrixRBlock dst)
        Converts the transpose of a row major matrix into a row major block matrix.
        Parameters:
        src - Original FMatrixRMaj. Not modified.
        dst - Equivalent FMatrixRBlock. Modified.
      • mult

        public static void mult​(org.ejml.data.FMatrixRBlock A,
                                org.ejml.data.FMatrixRBlock B,
                                org.ejml.data.FMatrixRBlock C)
      • multTransA

        public static void multTransA​(org.ejml.data.FMatrixRBlock A,
                                      org.ejml.data.FMatrixRBlock B,
                                      org.ejml.data.FMatrixRBlock C)
      • multTransB

        public static void multTransB​(org.ejml.data.FMatrixRBlock A,
                                      org.ejml.data.FMatrixRBlock B,
                                      org.ejml.data.FMatrixRBlock C)
      • transpose

        public static org.ejml.data.FMatrixRBlock transpose​(org.ejml.data.FMatrixRBlock A,
                                                            org.ejml.data.FMatrixRBlock A_tran)
        Transposes a block matrix.
        Parameters:
        A - Original matrix. Not modified.
        A_tran - Transposed matrix. Modified.
      • createRandom

        public static org.ejml.data.FMatrixRBlock createRandom​(int numRows,
                                                               int numCols,
                                                               float min,
                                                               float max,
                                                               java.util.Random rand)
      • createRandom

        public static org.ejml.data.FMatrixRBlock createRandom​(int numRows,
                                                               int numCols,
                                                               float min,
                                                               float max,
                                                               java.util.Random rand,
                                                               int blockLength)
      • convert

        public static org.ejml.data.FMatrixRBlock convert​(org.ejml.data.FMatrixRMaj A,
                                                          int blockLength)
      • convert

        public static org.ejml.data.FMatrixRBlock convert​(org.ejml.data.FMatrixRMaj A)
      • isEquals

        public static boolean isEquals​(org.ejml.data.FMatrixRBlock A,
                                       org.ejml.data.FMatrixRBlock B)
      • isEquals

        public static boolean isEquals​(org.ejml.data.FMatrixRBlock A,
                                       org.ejml.data.FMatrixRBlock B,
                                       float tol)
      • zeroTriangle

        public static void zeroTriangle​(boolean upper,
                                        org.ejml.data.FMatrixRBlock A)
        Sets either the upper or low triangle of a matrix to zero
      • copyTriangle

        public static void copyTriangle​(boolean upper,
                                        org.ejml.data.FMatrixRBlock src,
                                        org.ejml.data.FMatrixRBlock dst)
        Copies either the upper or lower triangular portion of src into dst. Dst can be smaller than src.
        Parameters:
        upper - If the upper or lower triangle is copied.
        src - The source matrix. Not modified.
        dst - The destination matrix. Modified.
      • set

        public static void set​(org.ejml.data.FMatrixRBlock A,
                               float value)

        Sets every element in the matrix to the specified value.

        aij = value

        Parameters:
        A - A matrix whose elements are about to be set. Modified.
        value - The value each element will have.
      • setIdentity

        public static void setIdentity​(org.ejml.data.FMatrixRBlock A)

        Sets the value of A to all zeros except along the diagonal.

        Parameters:
        A - Block matrix.
      • identity

        public static org.ejml.data.FMatrixRBlock identity​(int numRows,
                                                           int numCols,
                                                           int blockLength)

        Returns a new matrix with ones along the diagonal and zeros everywhere else.

        Parameters:
        numRows - Number of rows.
        numCols - NUmber of columns.
        blockLength - Block length.
        Returns:
        An identify matrix.
      • checkIdenticalShape

        public static void checkIdenticalShape​(org.ejml.data.FMatrixRBlock A,
                                               org.ejml.data.FMatrixRBlock B)

        Checks to see if the two matrices have an identical shape an block size.

        Parameters:
        A - Matrix.
        B - Matrix.
      • extractAligned

        public static void extractAligned​(org.ejml.data.FMatrixRBlock src,
                                          org.ejml.data.FMatrixRBlock dst)

        Extracts a matrix from src into dst. The submatrix which is copied has its initial coordinate at (0,0) and ends at (dst.numRows,dst.numCols). The end rows/columns must be aligned along blocks or else it will silently screw things up.

        Parameters:
        src - Matrix which a submatrix is being extracted from. Not modified.
        dst - Where the submatrix is written to. Its rows and columns be less than or equal to 'src'. Modified.
      • blockAligned

        public static boolean blockAligned​(int blockLength,
                                           org.ejml.data.FSubmatrixD1 A)
        Checks to see if the submatrix has its boundaries along inner blocks.
        Parameters:
        blockLength - Size of an inner block.
        A - Submatrix.
        Returns:
        If it is block aligned or not.