Class AggregateSemiring

java.lang.Object
org.flag4j.linalg.ops.common.semiring_ops.AggregateSemiring

public final class AggregateSemiring extends Object
This utility class contains methods useful for aggregating arrays of Semiring's.
  • Method Details

    • sum

      public static <T extends Semiring<T>> T sum(T... entries)
      Computes the sum of all data in this tensor. This can be applied to either real dense or spase tensors.
      Parameters:
      entries - Entries of the tensor.
      Returns:
      The sum of all data in this tensor. If {data.length == 0}, null will be returned.
    • prod

      public static <T extends Semiring<T>> T prod(T... entries)
      Computes the sum of all data in this tensor. This can be applied to either real dense or spase tensors.
      Parameters:
      entries - Entries of the tensor.
      Returns:
      The sum of all data in this tensor. If {data.length == 0}, null will be returned.