Class RealComplexDenseSparseVectorOperations
java.lang.Object
org.flag4j.operations.dense_sparse.coo.real_complex.RealComplexDenseSparseVectorOperations
This class provides low level methods for computing operations between a real/complex dense/sparse vector and a
complex/real sparse/dense vector.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic CVector
Adds a complex dense matrix to a real sparse matrix.static CVector
add
(Vector src1, CooCVector src2) Adds a real dense matrix to a complex sparse matrix.static void
Computes the vector addition between a dense complex vector and a sparse real vector.static CooCVector
elemDiv
(CooCVector src1, Vector src2) Compute the element-wise division between a sparse vector and a dense vector.static CooCVector
Compute the element-wise division between a sparse vector and a dense vector.static CooCVector
Computes the element-wise multiplication of a complex dense vector with a real sparse vector.static CooCVector
elemMult
(Vector src1, CooCVector src2) Computes the element-wise multiplication of a real dense vector with a complex sparse vector.static CNumber
Computes the vector inner product between a complex dense vector and a real sparse vector.static CNumber
Computes the vector inner product between a real dense vector and a complex sparse vector.static CNumber
Computes the vector inner product between a complex dense vector and a real sparse vector.static CNumber[]
outerProduct
(double[] src1, int[] indices, int sparseSize, CNumber[] src2) Computes the vector outer product between a complex dense vector and a real sparse vector.static CNumber[]
outerProduct
(double[] src1, CNumber[] src2, int[] indices, int sparseSize) Computes the vector outer product between a real dense vector and a complex sparse vector.static CNumber[]
outerProduct
(CNumber[] src1, double[] src2, int[] indices, int sparseSize) Computes the vector outer product between a complex dense vector and a real sparse vector.static CNumber[]
outerProduct
(CNumber[] src1, int[] indices, int sparseSize, double[] src2) Computes the vector outer product between a rea; dense vector and a complex sparse vector.static CVector
Subtracts a real sparse vector from a complex dense vector.static CVector
sub
(Vector src1, CooCVector src2) Subtracts a complex sparse vector from a real dense vector.static CVector
sub
(CooCVector src1, Vector src2) Subtracts a complex dense vector from a complex sparse vector.static CVector
Subtracts a complex dense vector from a complex sparse vector.static void
Computes the vector subtraction between a dense complex vector and a real sparse vector.
-
Constructor Details
-
RealComplexDenseSparseVectorOperations
private RealComplexDenseSparseVectorOperations()
-
-
Method Details
-
inner
Computes the vector inner product between a real dense vector and a complex sparse vector.- Parameters:
src1
- Entries of the dense vector.src2
- Non-zero entries of the sparse vector.indices
- Indices of non-zero entries in the sparse vector.sparseSize
- The size of the sparse vector (including zero entries).- Returns:
- The inner product of the two vectors.
- Throws:
IllegalArgumentException
- If the number of entries in the two vectors is not equivalent.
-
inner
Computes the vector inner product between a complex dense vector and a real sparse vector.- Parameters:
src1
- Entries of the dense vector.src2
- Non-zero entries of the sparse vector.indices
- Indices of non-zero entries in the sparse vector.sparseSize
- The size of the sparse vector (including zero entries).- Returns:
- The inner product of the two vectors.
- Throws:
IllegalArgumentException
- If the number of entries in the two vectors is not equivalent.
-
inner
Computes the vector inner product between a complex dense vector and a real sparse vector.- Parameters:
src1
- Non-zero entries of the sparse vector.indices
- Indices of non-zero entries in the sparse vector.sparseSize
- The size of the sparse vector (including zero entries).src2
- Entries of the dense vector.- Returns:
- The inner product of the two vectors.
- Throws:
IllegalArgumentException
- If the number of entries in the two vectors is not equivalent.
-
outerProduct
Computes the vector outer product between a real dense vector and a complex sparse vector.- Parameters:
src1
- Entries of the dense vector.src2
- Non-zero entries of the sparse vector.indices
- Indices of non-zero entries of sparse vector.sparseSize
- Full size of the sparse vector including zero entries.- Returns:
- The matrix resulting from the vector outer product.
-
outerProduct
Computes the vector outer product between a complex dense vector and a real sparse vector.- Parameters:
src1
- Entries of the dense vector.src2
- Non-zero entries of the sparse vector.indices
- Indices of non-zero entries of sparse vector.sparseSize
- Full size of the sparse vector including zero entries.- Returns:
- The matrix resulting from the vector outer product.
-
outerProduct
Computes the vector outer product between a complex dense vector and a real sparse vector.- Parameters:
src1
- Non-zero entries of the real sparse vector.indices
- Indices of non-zero entries of sparse vector.sparseSize
- Full size of the sparse vector including zero entries.src2
- Entries of the complex dense vector.- Returns:
- The matrix resulting from the vector outer product.
-
outerProduct
Computes the vector outer product between a rea; dense vector and a complex sparse vector.- Parameters:
src1
- Non-zero entries of the complex sparse vector.indices
- Indices of non-zero entries of sparse vector.sparseSize
- Full size of the sparse vector including zero entries.src2
- Entries of the real dense vector.- Returns:
- The matrix resulting from the vector outer product.
-
add
Adds a real dense matrix to a complex sparse matrix.- Parameters:
src1
- First matrix.src2
- Second matrix.- Returns:
- The result of the vector addition.
- Throws:
IllegalArgumentException
- If the vectors do not have the same shape.
-
add
Adds a complex dense matrix to a real sparse matrix.- Parameters:
src1
- First matrix.src2
- Second matrix.- Returns:
- The result of the vector addition.
- Throws:
IllegalArgumentException
- If the vectors do not have the same shape.
-
sub
Subtracts a complex sparse vector from a real dense vector.- Parameters:
src1
- First vector.src2
- Second vector.- Returns:
- The result of the vector subtraction.
- Throws:
IllegalArgumentException
- If the vectors do not have the same shape.
-
sub
Subtracts a complex dense vector from a complex sparse vector.- Parameters:
src1
- Sparse vector.src2
- Dense vector.- Returns:
- The result of the vector subtraction.
- Throws:
IllegalArgumentException
- If the vectors do not have the same shape.
-
sub
Subtracts a complex dense vector from a complex sparse vector.- Parameters:
src1
- Sparse vector.src2
- Dense vector.- Returns:
- The result of the vector subtraction.
- Throws:
IllegalArgumentException
- If the vectors do not have the same shape.
-
elemMult
Computes the element-wise multiplication of a real dense vector with a complex sparse vector.- Parameters:
src1
- Dense vector.src2
- Sparse vector.- Returns:
- The result of the element-wise multiplication.
- Throws:
IllegalArgumentException
- If the two vectors are not the same size.
-
sub
Subtracts a real sparse vector from a complex dense vector.- Parameters:
src1
- First vector.src2
- Second vector.- Returns:
- The result of the vector subtraction.
- Throws:
IllegalArgumentException
- If the vectors do not have the same shape.
-
addEq
Computes the vector addition between a dense complex vector and a sparse real vector. The result is stored in the first vector.- Parameters:
src1
- First vector to add. Also, where the result is stored.src2
- Second vector to add.- Throws:
IllegalArgumentException
- If the vectors do not have the same size.
-
subEq
-
elemMult
Computes the element-wise multiplication of a complex dense vector with a real sparse vector.- Parameters:
src1
- Dense vector.src2
- Sparse vector.- Returns:
- The result of the element-wise multiplication.
- Throws:
IllegalArgumentException
- If the two vectors are not the same size.
-
elemDiv
Compute the element-wise division between a sparse vector and a dense vector.- Parameters:
src1
- First vector in the element-wise division.src2
- Second vector in the element-wise division.- Returns:
- The result of the element-wise vector division.
-
elemDiv
Compute the element-wise division between a sparse vector and a dense vector.- Parameters:
src1
- First vector in the element-wise division.src2
- Second vector in the element-wise division.- Returns:
- The result of the element-wise vector division.
-