Class CooRingVectorOps
java.lang.Object
org.flag4j.linalg.ops.sparse.coo.ring_ops.CooRingVectorOps
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends Ring<T>>
Tinner
(AbstractCooRingVector<?, ?, ?, ?, T> src1, AbstractCooRingVector<?, ?, ?, ?, T> src2) Computes the inner product of two complex sparse vectors.static <T extends Ring<T>>
SparseVectorData<T> Computes the element-wise vector subtraction between two real sparse vectors.
-
Method Details
-
sub
public static <T extends Ring<T>> SparseVectorData<T> sub(Shape shape1, T[] src1, int[] src1Indices, Shape shape2, T[] src2, int[] src2Indices) Computes the element-wise vector subtraction between two real sparse vectors. Both sparse vectors are assumed to have their indices sorted lexicographically.- Parameters:
src1
- First sparse vector in the difference. Indices assumed to be sorted lexicographically.src2
- Second sparse vector in the difference. Indices assumed to be sorted lexicographically.- Returns:
- A data class containing the non-zero data and indices of the sparse COO vector resulting from the vector subtraction.
- Throws:
IllegalArgumentException
- If the two vectors do not have the same size (full size including zeros).
-
inner
public static <T extends Ring<T>> T inner(AbstractCooRingVector<?, ?, ?, ?, T> src1, AbstractCooRingVector<?, ?, ?, ?, T> src2) Computes the inner product of two complex sparse vectors. 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).
-