Class DenseCooFieldTensorOps

java.lang.Object
org.flag4j.linalg.ops.dense_sparse.coo.field_ops.DenseCooFieldTensorOps

public final class DenseCooFieldTensorOps extends Object
This class contains methods to apply common ops to a dense/sparse field matrix and to a sparse/dense field matrix.
  • Method Details

    • add

      public static <T extends Field<T>> AbstractDenseFieldTensor<?,T> add(AbstractDenseFieldTensor<?,T> src1, AbstractCooFieldTensor<?,?,T> src2)
      Computes element-wise addition of a dense tensor with a sparse COO tensor.
      Parameters:
      src1 - Dense tensor in sum.
      src2 - Sparse COO tensor in sum.
      Returns:
      The result of the element-wise subtraction.
    • addEq

      public static <T extends Field<T>> void addEq(AbstractDenseFieldTensor<?,T> src1, AbstractCooFieldTensor<?,?,T> src2)
      Computes element-wise addition of a dense tensor with a sparse COO tensor.
      Parameters:
      src1 - Dense tensor in sum.
      src2 - Sparse COO tensor in sum.
    • sub

      public static <T extends Field<T>> AbstractDenseFieldTensor<?,T> sub(AbstractDenseFieldTensor<?,T> src1, AbstractCooFieldTensor<?,?,T> src2)
      Computes the element-wise tensor a complex sparse tensor from a complex dense tensor.
      Parameters:
      src1 - Complex dense tensor.
      src2 - Complex sparse tensor.
      Returns:
      The result of the element-wise tensor subtraction.
    • sub

      public static <T extends Field<T>> AbstractDenseFieldTensor<?,T> sub(AbstractCooFieldTensor<?,?,T> src1, AbstractDenseFieldTensor<?,T> src2)
      Subtracts a complex dense tensor from a complex sparse tensor.
      Parameters:
      src1 - First tensor in the sum.
      src2 - Second tensor in the sum.
      Returns:
      The result of the tensor addition.
      Throws:
      IllegalArgumentException - If the tensors do not have the same shape.t
    • subEq

      public static <T extends Field<T>> void subEq(AbstractDenseFieldTensor<?,T> src1, AbstractCooFieldTensor<?,?,T> src2)
      Computes element-wise subtraction of a complex dense tensor with a complex sparse tensor.
      Parameters:
      src1 - Complex dense tensor.
      src2 - Complex sparse tensor.
    • elemMult

      public static <T extends Field<T>> AbstractCooFieldTensor<?,?,T> elemMult(AbstractDenseFieldTensor<?,T> src1, AbstractCooFieldTensor<?,?,T> src2)
      Computes the element-wise tensor multiplication between a complex dense tensor and a complex sparse tensor.
      Parameters:
      src1 - Complex dense tensor.
      src2 - Complex sparse tensor.
      Returns:
      THe result of the element-wise tensor multiplication.
    • add

      public static <T extends Field<T>> AbstractDenseFieldTensor<?,T> add(AbstractCooFieldTensor<?,?,T> src1, Field<T> b)
      Adds a scalar to a complex sparse COO tensor.
      Parameters:
      src1 - Sparse tensor in sum.
      b - Scalar in sum.
      Returns:
      A dense tensor which is the sum of src1 and b such that b is added to each element of src1.
    • sub

      public static <T extends Field<T>> AbstractDenseFieldTensor<?,T> sub(AbstractCooFieldTensor<?,?,T> src1, Field<T> b)
      Subtracts a scalar from a sparse COO tensor.
      Parameters:
      src1 - Sparse tensor in sum.
      b - Scalar in sum.
      Returns:
      A dense tensor which is the sum of src1 and b such that b is added to each element of src1.
    • elemDiv

      public static <T extends Field<T>> AbstractCooFieldTensor<?,?,T> elemDiv(AbstractCooFieldTensor<?,?,T> src1, AbstractDenseFieldTensor<?,T> src2)
      Computes the element-wise division between a complex dense tensor and a complex sparse tensor.
      Parameters:
      src1 - Complex sparse tensor.
      src2 - Complex dense tensor.
      Returns:
      The result of element-wise division.
      Throws:
      IllegalArgumentException - If the tensors do not have the same shape.