Package org.ejml.dense.block
Class MatrixOps_FDRB
java.lang.Object
org.ejml.dense.block.MatrixOps_FDRB
Various operations on
FMatrixRBlock
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
blockAligned
(int blockLength, FSubmatrixD1 A) Checks to see if the submatrix has its boundaries along inner blocks.static void
Checks to see if the two matrices have an identical shape an block size.static FMatrixRMaj
convert
(FMatrixRBlock src, FMatrixRMaj dst) Converts a row major block matrix into a row major matrix.static FMatrixRBlock
static FMatrixRBlock
convert
(FMatrixRMaj A, int blockLength) static void
convert
(FMatrixRMaj src, FMatrixRBlock dst) Converts a row major matrix into a row major block matrix.static void
convertBlockToRow
(int numRows, int numCols, int blockLength, float[] data, @Nullable FGrowArray workspace) Converts matrix data stored is a block row major format into a row major format in place.static FMatrixRMaj
convertInplace
(FMatrixRBlock src, @Nullable FMatrixRMaj dst, @Nullable FGrowArray workspace) Converts a row major block matrix into a row major matrix.static FMatrixRBlock
convertInplace
(FMatrixRMaj src, @Nullable FMatrixRBlock dst, @Nullable FGrowArray workspace) Converts a row major matrix into a row major block matrix.static void
convertRowToBlock
(int numRows, int numCols, int blockLength, float[] data, @Nullable FGrowArray workspace) Converts matrix data stored is a row major format into a block row major format in place.static void
convertTranSrc
(FMatrixRMaj src, FMatrixRBlock dst) Converts the transpose of a row major matrix into a row major block matrix.static void
copyTriangle
(boolean upper, FMatrixRBlock src, FMatrixRBlock dst) Copies either the upper or lower triangular portion of src into dst.static FMatrixRBlock
createRandom
(int numRows, int numCols, float min, float max, Random rand) static FMatrixRBlock
createRandom
(int numRows, int numCols, float min, float max, Random rand, int blockLength) static void
extractAligned
(FMatrixRBlock src, FMatrixRBlock dst) Extracts a matrix from src into dst.static FMatrixRBlock
identity
(int numRows, int numCols, int blockLength) Returns a new matrix with ones along the diagonal and zeros everywhere else.static boolean
static boolean
isEquals
(FMatrixRBlock A, FMatrixRBlock B, float tol) static void
mult
(FMatrixRBlock A, FMatrixRBlock B, FMatrixRBlock C) static void
static void
static void
set
(FMatrixRBlock A, float value) Sets every element in the matrix to the specified value.
aij = valuestatic void
Sets the value of A to all zeros except along the diagonal.static FMatrixRBlock
transpose
(FMatrixRBlock A, @Nullable FMatrixRBlock A_tran) Transposes a block matrix.static void
zeroTriangle
(boolean upper, FMatrixRBlock A) Sets either the upper or low triangle of a matrix to zero
-
Constructor Details
-
MatrixOps_FDRB
public MatrixOps_FDRB()
-
-
Method Details
-
convert
Converts a row major matrix into a row major block matrix.- Parameters:
src
- Original FMatrixRMaj. Not modified.dst
- Equivalent FMatrixRBlock. Modified.
-
convertInplace
public static FMatrixRBlock convertInplace(FMatrixRMaj src, @Nullable @Nullable FMatrixRBlock dst, @Nullable @Nullable FGrowArray workspace) Converts a row major matrix into a row major block matrix. Both matrices will contain the same data array. Useful when you wish to avoid declaring two large matrices.- Parameters:
src
- Original FMatrixRMaj. Modified.dst
- Equivalent FMatrixRBlock. Modified.
-
convertRowToBlock
public static void convertRowToBlock(int numRows, int numCols, int blockLength, float[] data, @Nullable @Nullable FGrowArray workspace) 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.workspace
- Optional internal workspace. Nullable.
-
convert
Converts a row major block matrix into a row major matrix.- Parameters:
src
- Original FMatrixRBlock.. Not modified.dst
- Equivalent FMatrixRMaj. Modified.
-
convertInplace
public static FMatrixRMaj convertInplace(FMatrixRBlock src, @Nullable @Nullable FMatrixRMaj dst, @Nullable @Nullable FGrowArray workspace) Converts a row major block matrix into a row major matrix. Both matrices will contain the same data array. Useful when you wish to avoid declaring two large matrices.- Parameters:
src
- Original FMatrixRBlock. Modified.dst
- Equivalent FMatrixRMaj. Modified.
-
convertBlockToRow
public static void convertBlockToRow(int numRows, int numCols, int blockLength, float[] data, @Nullable @Nullable FGrowArray workspace) 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.workspace
- Optional internal workspace. Nullable.
-
convertTranSrc
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
-
multTransA
-
multTransB
-
transpose
Transposes a block matrix.- Parameters:
A
- Original matrix. Not modified.A_tran
- Transposed matrix. Modified.
-
createRandom
public static FMatrixRBlock createRandom(int numRows, int numCols, float min, float max, Random rand) -
createRandom
public static FMatrixRBlock createRandom(int numRows, int numCols, float min, float max, Random rand, int blockLength) -
convert
-
convert
-
isEquals
-
isEquals
-
zeroTriangle
Sets either the upper or low triangle of a matrix to zero -
copyTriangle
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
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
Sets the value of A to all zeros except along the diagonal.
- Parameters:
A
- Block matrix.
-
identity
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
Checks to see if the two matrices have an identical shape an block size.
- Parameters:
A
- Matrix.B
- Matrix.
-
extractAligned
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
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.
-