Class RealComplexDenseSparseMatrixOperations
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic CMatrix
Adds a real dense matrix to a real sparse matrix.static CMatrix
add
(Matrix src1, CooCMatrix src2) Adds a real dense matrix to a complex sparse matrix.static void
Adds a complex dense matrix to a real sparse matrix and stores the result in the first matrix.static CMatrix
addToEachCol
(CooCMatrix src, Vector col) Adds a dense vector to each column as if the vector is a column vector.static CMatrix
addToEachCol
(CooMatrix src, CVector col) Adds a dense vector to each column as if the vector is a column vector.static CMatrix
addToEachRow
(CooCMatrix src, Vector row) Adds a dense vector to add to each row as if the vector is a row vector.static CMatrix
addToEachRow
(CooMatrix src, CVector row) Adds a dense vector to add to each row as if the vector is a row vector.static CooCMatrix
elemDiv
(CooCMatrix src1, Matrix src2) Computes the element-wise division between a complex sparse matrix and a real dense matrix.static CooCMatrix
Computes the element-wise division between a real sparse matrix and a complex dense matrix.static CooCMatrix
Computes the element-wise multiplication between a complex dense matrix and a real sparse matrix.static CooCMatrix
elemMult
(Matrix src1, CooCMatrix src2) Computes the element-wise multiplication between a real dense matrix and a complex sparse matrix.static CMatrix
Subtracts a real sparse matrix from a complex dense matrix.static CMatrix
sub
(Matrix src1, CooCMatrix src2) Subtracts a real sparse matrix from a real dense matrix.static CMatrix
sub
(CooCMatrix src2, Matrix src1) Subtracts a real sparse matrix from a real dense matrix.static CMatrix
Subtracts a real sparse matrix from a real dense matrix.static void
Subtracts a real sparse matrix from a complex dense matrix and stores the result in the first matrix.
-
Constructor Details
-
RealComplexDenseSparseMatrixOperations
private RealComplexDenseSparseMatrixOperations()
-
-
Method Details
-
add
Adds a real dense matrix to a complex sparse matrix.- Parameters:
src1
- First matrix.src2
- Second matrix.- Returns:
- The result of the matrix addition.
- Throws:
IllegalArgumentException
- If the matrices do not have the same shape.
-
add
Adds a real dense matrix to a real sparse matrix.- Parameters:
src1
- First matrix.src2
- Second matrix.- Returns:
- The result of the matrix addition.
- Throws:
IllegalArgumentException
- If the matrices do not have the same shape.
-
sub
Subtracts a real sparse matrix from a real dense matrix.- Parameters:
src1
- First matrix.src2
- Second matrix.- Returns:
- The result of the matrix subtraction.
- Throws:
IllegalArgumentException
- If the matrices do not have the same shape.
-
sub
Subtracts a real sparse matrix from a complex dense matrix.- Parameters:
src1
- First matrix.src2
- Second matrix.- Returns:
- The result of the matrix subtraction.
- Throws:
IllegalArgumentException
- If the matrices do not have the same shape.
-
sub
Subtracts a real sparse matrix from a real dense matrix.- Parameters:
src2
- Second matrix.src1
- First matrix.- Returns:
- The result of the matrix subtraction.
- Throws:
IllegalArgumentException
- If the matrices do not have the same shape.
-
sub
Subtracts a real sparse matrix from a real dense matrix.- Parameters:
src2
- Second matrix.src1
- First matrix.- Returns:
- The result of the matrix subtraction.
- Throws:
IllegalArgumentException
- If the matrices do not have the same shape.
-
addEq
Adds a complex dense matrix to a real sparse matrix and stores the result in the first matrix.- Parameters:
src1
- Entries of first matrix in the sum. Also, the storage for the result.src2
- Entries of second matrix in the sum.- Throws:
IllegalArgumentException
- If the matrices do not have the same shape.
-
subEq
Subtracts a real sparse matrix from a complex dense matrix and stores the result in the first matrix.- Parameters:
src1
- Entries of first matrix in the sum. Also, the storage for the result.src2
- Entries of second matrix in the sum.- Throws:
IllegalArgumentException
- If the matrices do not have the same shape.
-
elemMult
Computes the element-wise multiplication between a real dense matrix and a complex sparse matrix.- Parameters:
src1
- First matrix.src2
- Second matrix.- Returns:
- The result of element-wise multiplication.
- Throws:
IllegalArgumentException
- If the matrices do not have the same shape.
-
elemMult
Computes the element-wise multiplication between a complex dense matrix and a real sparse matrix.- Parameters:
src1
- First matrix.src2
- Second matrix.- Returns:
- The result of element-wise multiplication.
- Throws:
IllegalArgumentException
- If the matrices do not have the same shape.
-
elemDiv
Computes the element-wise division between a complex sparse matrix and a real dense matrix.If the dense matrix contains a zero at the same index the sparse matrix contains a non-zero, the result will be either
Double.POSITIVE_INFINITY
orDouble.NEGATIVE_INFINITY
.If the dense matrix contains a zero at an index for which the sparse matrix is also zero, the result will be zero. This is done to realize computational benefits from operations with sparse matrices.
- Parameters:
src1
- Real sparse matrix and numerator in element-wise quotient.src2
- Real Dense matrix and denominator in element-wise quotient.- Returns:
- The element-wise quotient of
src1
andsrc2
. - Throws:
IllegalArgumentException
- Ifsrc1
andsrc2
do not have the same shape.
-
elemDiv
Computes the element-wise division between a real sparse matrix and a complex dense matrix.If the dense matrix contains a zero at the same index the sparse matrix contains a non-zero, the result will be either
Double.POSITIVE_INFINITY
orDouble.NEGATIVE_INFINITY
.If the dense matrix contains a zero at an index for which the sparse matrix is also zero, the result will be zero. This is done to realize computational benefits from operations with sparse matrices.
- Parameters:
src1
- Real sparse matrix and numerator in element-wise quotient.src2
- Real Dense matrix and denominator in element-wise quotient.- Returns:
- The element-wise quotient of
src1
andsrc2
. - Throws:
IllegalArgumentException
- Ifsrc1
andsrc2
do not have the same shape.
-
addToEachCol
Adds a dense vector to each column as if the vector is a column vector.- Parameters:
src
- Source sparse matrix.col
- Vector to add to each column of the source matrix.- Returns:
- A dense copy of the
src
matrix with the specified vector added to each column. - Throws:
IllegalArgumentException
- If the number of entries in thecol
vector does not match the number of rows in thesrc
matrix.
-
addToEachRow
Adds a dense vector to add to each row as if the vector is a row vector.- Parameters:
src
- Source sparse matrix.row
- Vector to add to each row of the source matrix.- Returns:
- A dense copy of the
src
matrix with the specified vector added to each row. - Throws:
IllegalArgumentException
- If the number of entries in thecol
vector does not match the number of columns in thesrc
matrix.
-
addToEachCol
Adds a dense vector to each column as if the vector is a column vector.- Parameters:
src
- Source sparse matrix.col
- Vector to add to each column of the source matrix.- Returns:
- A dense copy of the
src
matrix with the specified vector added to each column. - Throws:
IllegalArgumentException
- If the number of entries in thecol
vector does not match the number of rows in thesrc
matrix.
-
addToEachRow
Adds a dense vector to add to each row as if the vector is a row vector.- Parameters:
src
- Source sparse matrix.row
- Vector to add to each row of the source matrix.- Returns:
- A dense copy of the
src
matrix with the specified vector added to each row. - Throws:
IllegalArgumentException
- If the number of entries in thecol
vector does not match the number of columns in thesrc
matrix.
-