Class ComplexDenseSparseVectorOperations
java.lang.Object
org.flag4j.operations.dense_sparse.coo.complex.ComplexDenseSparseVectorOperations
This class provides low level methods for computing operations between complex dense/sparse and complex
sparse/dense vectors.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic CVector
add
(CVector src1, CooCVector src2) Computes the element-wise addition between a dense complex vector and sparse complex vectors.static void
addEq
(CVector src1, CooCVector src2) Computes the element-wise addition between a dense complex vector and sparse complex vectors.static CooCVector
elemDiv
(CooCVector src1, CVector src2) Compute the element-wise division between a complex sparse vector and a complex dense vector.static CooCVector
elemMult
(CVector src1, CooCVector src2) Computes the element-wise multiplication of a complex dense vector with a complex sparse vector.static CNumber
innerProduct
(CNumber[] src1, int[] indices, int sparseSize, CNumber[] src2) Computes the vector inner product between a complex dense vector and a complex sparse vector.static CNumber
innerProduct
(CNumber[] src1, CNumber[] src2, int[] indices, int sparseSize) Computes the vector inner product between a complex dense vector and a complex sparse vector.static CNumber[]
outerProduct
(CNumber[] src2, int[] indices, int sparseSize, CNumber[] src1) Computes the vector outer product between a complex dense vector and a real sparse vector.static CNumber[]
outerProduct
(CNumber[] src1, CNumber[] src2, int[] indices, int sparseSize) Computes the vector outer product between a complex dense vector and a real sparse vector.static CVector
sub
(CVector src1, CooCVector src2) Subtracts a complex sparse vector from a complex dense vector.static CVector
sub
(CooCVector src1, CVector src2) Subtracts a complex dense vector from a complex sparse vector.static void
subEq
(CVector src1, CooCVector src2) Computes the element-wise subtraction between a dense complex vector and sparse complex vectors.
-
Constructor Details
-
ComplexDenseSparseVectorOperations
private ComplexDenseSparseVectorOperations()
-
-
Method Details
-
innerProduct
Computes the vector inner product between a complex 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 nonzero values in sparse vector.sparseSize
- Full size of the sparse vector (i.e. total number of entries including zeros).- Returns:
- The inner product of the two vectors.
- Throws:
IllegalArgumentException
- If the number of entries in the two vectors is not equivalent.
-
innerProduct
Computes the vector inner product between a complex dense vector and a complex sparse vector.- Parameters:
src1
- Entries of the dense vector.indices
- Indices of nonzero values in sparse vector.sparseSize
- Full size of the sparse vector (i.e. total number of entries including zeros).src2
- Non-zero entries of the sparse 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 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.- 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:
src2
- Non-zero entries of the sparse vector.indices
- Indices of non-zero entries of sparse vector.src1
- Entries of the dense vector.- Returns:
- The matrix resulting from the vector outer product.
-
add
Computes the element-wise addition between a dense complex vector and sparse complex vectors.- Parameters:
src1
- Dense vector.src2
- Sparse vector.- Returns:
- The result of the vector addition.
-
addEq
Computes the element-wise addition between a dense complex vector and sparse complex vectors. The result is stored in the first vector.- Parameters:
src1
- Dense vector. Modified.src2
- Sparse vector.
-
sub
Subtracts a complex 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.
-
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.
-
subEq
Computes the element-wise subtraction between a dense complex vector and sparse complex vectors. The result is stored in the first vector.- Parameters:
src1
- Dense vector. Modified.src2
- Sparse vector.
-
elemMult
Computes the element-wise multiplication of a complex 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.
-
elemDiv
Compute the element-wise division between a complex sparse vector and a complex 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.
-