Class RealCooTensorOps

java.lang.Object
org.flag4j.linalg.ops.sparse.coo.real.RealCooTensorOps

public final class RealCooTensorOps extends Object
Utility class for computing ops between two real sparse COO tensors backed by a primitive double array.
  • Method Details

    • add

      public static CooTensor add(CooTensor src1, CooTensor src2)
      Sums two sparse COO tensors and stores result in a new COO tensor.
      Parameters:
      src1 - First tensor in the sum.
      src2 - Second tensor in the sum.
      Returns:
      The element-wise tensor sum of src1 and src2.
      Throws:
      LinearAlgebraException - If the tensors src1 and src2 do not have the same shape.
    • sub

      public static CooTensor sub(CooTensor src1, CooTensor src2)
      Computes difference between two sparse COO tensors and stores result in a new COO tensor.
      Parameters:
      src1 - First tensor in the difference.
      src2 - Second tensor in the difference.
      Returns:
      The element-wise tensor difference of src1 and src2.
      Throws:
      LinearAlgebraException - If the tensors src1 and src2 do not have the same shape.
    • elemMult

      public static CooTensor elemMult(CooTensor src1, CooTensor src2)

      Computes the element-wise multiplication between two sparse COO tensors.

      Assumes indices of both tensors are sorted lexicographically.

      Parameters:
      src1 - First tensor in the element-wise multiplication.
      src2 - Second tensor in the element-wise multiplication.
      Returns:
      The element-wise product of src1 and src2.