Class RealComplexSparseVectorOps
java.lang.Object
org.flag4j.linalg.ops.sparse.coo.real_complex.RealComplexSparseVectorOps
This class contains low level implementations of ops on a real sparse tensor and a complex sparse tensor.
-
Method Summary
Modifier and TypeMethodDescriptionstatic CVectoradd(CooCVector src, double a) Adds a real number to each entry of a sparse vector, including the zero data.static CooCVectoradd(CooCVector src1, CooVector src2) Computes the element-wise vector addition between a real sparse vector and a complex sparse vector.static CVectoradd(CooVector src, Complex128 a) Adds a real number to each entry of a sparse vector, including the zero data.static CooCVectorelemMult(CooCVector src1, CooVector src2) Computes the element-wise vector multiplication between two real sparse vectors.static Complex128inner(CooCVector src1, CooVector src2) Computes the inner product of a real and complex sparse vector.static Complex128inner(CooVector src1, CooCVector src2) Computes the inner product of a real and complex sparse vector.static CMatrixouterProduct(CooCVector src1, CooVector src2) Computes the vector outer product between a complex sparse vector and a real sparse vector.static CMatrixouterProduct(CooVector src1, CooCVector src2) Computes the vector outer product between a complex sparse vector and a real sparse vector.static CooCVectorsub(CooCVector src1, CooVector src2) Computes the element-wise vector subtraction between a real sparse vector and a complex sparse vector.static CooCVectorsub(CooVector src1, CooCVector src2) Computes the element-wise vector subtraction between a real sparse vector and a complex sparse vector.static CVectorsub(CooVector src, Complex128 a) Subtracts a real number from each entry of a sparse vector, including the zero data.
-
Method Details
-
add
Adds a real number to each entry of a sparse vector, including the zero data.- Parameters:
src- Sparse vector to add value to.a- Value to add to thesrcsparse vector.- Returns:
- The result of adding the specified value to the sparse vector.
-
add
Adds a real number to each entry of a sparse vector, including the zero data.- Parameters:
src- Sparse vector to add value to.a- Value to add to thesrcsparse vector.- Returns:
- The result of adding the specified value to the sparse vector.
-
sub
Subtracts a real number from each entry of a sparse vector, including the zero data.- Parameters:
src- Sparse vector to subtract value from.a- Value to subtract from thesrcsparse vector.- Returns:
- The result of subtracting the specified value from the sparse vector.
-
add
Computes the element-wise vector addition between a real sparse vector and a complex sparse vector. Both sparse vectors are assumed to have their indices sorted lexicographically.- Parameters:
src1- First sparse vector in the addition. Indices assumed to be sorted lexicographically.src2- Second sparse vector in the addition. Indices assumed to be sorted lexicographically.- Returns:
- The result of the vector addition.
- Throws:
IllegalArgumentException- If the two vectors do not have the same size (full size including zeros).
-
sub
Computes the element-wise vector subtraction between a real sparse vector and a complex sparse vector. Both sparse vectors are assumed to have their indices sorted lexicographically.- Parameters:
src1- First sparse vector in the subtraction. Indices assumed to be sorted lexicographically.src2- Second sparse vector in the subtraction. Indices assumed to be sorted lexicographically.- Returns:
- The result of the vector subtraction.
- Throws:
IllegalArgumentException- If the two vectors do not have the same size (full size including zeros).
-
sub
Computes the element-wise vector subtraction between a real sparse vector and a complex sparse vector. Both sparse vectors are assumed to have their indices sorted lexicographically.- Parameters:
src1- First sparse vector in the subtraction. Indices assumed to be sorted lexicographically.src2- Second sparse vector in the subtraction. Indices assumed to be sorted lexicographically.- Returns:
- The result of the vector subtraction.
- Throws:
IllegalArgumentException- If the two vectors do not have the same size (full size including zeros).
-
elemMult
Computes the element-wise vector multiplication between two real sparse vectors. Both sparse vectors are assumed to have their indices sorted lexicographically.- Parameters:
src1- First sparse vector in the multiplication. Indices assumed to be sorted lexicographically.src2- Second sparse vector in the multiplication. Indices assumed to be sorted lexicographically.- Returns:
- The result of the vector multiplication.
- Throws:
IllegalArgumentException- If the two vectors do not have the same size (full size including zeros).
-
inner
Computes the inner product of a real and complex sparse vector. Both sparse vectors are assumed to have their indices sorted lexicographically.- Parameters:
src1- First sparse vector in the inner product. Indices assumed to be sorted lexicographically.src2- Second sparse vector in the inner product. Indices assumed to be sorted lexicographically.- Returns:
- The result of the vector inner product.
- Throws:
IllegalArgumentException- If the two vectors do not have the same size (full size including zeros).
-
inner
Computes the inner product of a real and complex sparse vector. Both sparse vectors are assumed to have their indices sorted lexicographically.- Parameters:
src1- First sparse vector in the inner product. Indices assumed to be sorted lexicographically.src2- Second sparse vector in the inner product. Indices assumed to be sorted lexicographically.- Returns:
- The result of the vector inner product.
- Throws:
IllegalArgumentException- If the two vectors do not have the same size (full size including zeros).
-
outerProduct
Computes the vector outer product between a complex sparse vector and a real sparse vector.- Parameters:
src1- Entries of the first sparse vector in the outer product.src2- Second sparse vector in the outer product.- Returns:
- The matrix resulting from the vector outer product.
-
outerProduct
Computes the vector outer product between a complex sparse vector and a real sparse vector.- Parameters:
src1- Entries of the first sparse vector in the outer product.src2- Second sparse vector in the outer product.- Returns:
- The matrix resulting from the vector outer product.
-