Class RealFieldDenseCooOps

java.lang.Object
org.flag4j.linalg.ops.dense_sparse.coo.real_field_ops.RealFieldDenseCooOps

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

    • elemMult

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

      public static <T extends Field<T>> void elemMult(AbstractDenseFieldTensor<?,T> src1, CooTensor src2, T[] destEntries, int[][] destIndices)
      Computes the element-wise multiplication between a real dense tensor and a complex sparse tensor.
      Parameters:
      src1 - Real dense tensor.
      src2 - Complex sparse tensor.
      destEntries - Array to store non-zero data resulting from the element-wise product. Assumed to have length src2.nnz.
      destIndices - Array to store non-zero indices resulting from the element-wise product. Assumed to have size src2.nnz-by-src2.getRank().
      Throws:
      IllegalArgumentException - If the tensors do not have the same shape.
    • elemDiv

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

      public static <T extends Field<T>> AbstractDenseFieldTensor<?,T> add(AbstractDenseFieldTensor<?,T> src1, CooTensor src2)
      Adds a dense complex tensor to a real sparse tensor.
      Parameters:
      src1 - Complex dense tensor.
      src2 - Real sparse tensor.
      Returns:
      The result of the tensor addition.
    • sub

      public static <T extends Field<T>> AbstractDenseFieldTensor<?,T> sub(AbstractDenseFieldTensor<?,T> src1, CooTensor src2)
      Adds a dense complex tensor to a real sparse tensor.
      Parameters:
      src1 - Complex dense tensor.
      src2 - Real sparse tensor.
      Returns:
      The result of the tensor addition.
    • addEq

      public static <T extends Field<T>> void addEq(AbstractDenseFieldTensor<?,T> src1, CooTensor src2)
      Computes element-wise addition between a complex dense tensor and a real sparse tensor. The result is stored in the complex dense tensor.
      Parameters:
      src1 - The complex dense tensor. Also, the storage for the computation.
      src2 - The real sparse tensor.
    • subEq

      public static <T extends Field<T>> void subEq(AbstractDenseFieldTensor<?,T> src1, CooTensor src2)
      Computes element-wise subtraction between a complex dense tensor and a real sparse tensor. The result is stored in the complex dense tensor.
      Parameters:
      src1 - The complex dense tensor. Also, the storage for the computation.
      src2 - The real sparse tensor.
    • sub

      public static <T extends Field<T>> AbstractDenseFieldTensor<?,T> sub(CooTensor src1, AbstractDenseFieldTensor<?,T> src2)
      Subtracts a complex dense tensor from a real 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