Class AggregateReal
java.lang.Object
org.flag4j.operations.common.real.AggregateReal
This class contains several low-level methods useful for computing aggregation operations on dense/sparse tensors.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic double
max
(double[] entries) Computes the maximum value in a tensor.static double
maxAbs
(double... entries) Computes the maximum absolute value in a tensor.static double
min
(double[] entries) Computes the minimum value in a tensor.static double
minAbs
(double[] entries) Computes the minimum absolute value in a tensor.static double
sum
(double[] entries) Computes the sum of all entries in this tensor.
-
Constructor Details
-
AggregateReal
private AggregateReal()
-
-
Method Details
-
sum
public static double sum(double[] entries) Computes the sum of all entries 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 entries in this tensor.
-
min
public static double min(double[] entries) Computes the minimum value in a tensor. Note, if the entries array is empty, this method will return 0 allowing this method to be used for real sparse or dense tensors.- Parameters:
entries
- Entries of the tensor.- Returns:
- The minimum value in the tensor.
-
max
public static double max(double[] entries) Computes the maximum value in a tensor. Note, if the entries array is empty, this method will return 0 allowing this method to be used for real sparse or dense tensors.- Parameters:
entries
- Entries of the tensor.- Returns:
- The maximum value in the tensor.
-
minAbs
public static double minAbs(double[] entries) Computes the minimum absolute value in a tensor. Note, if the entries array is empty, this method will return 0 allowing this method to be used for real sparse or dense tensors.- Parameters:
entries
- Entries of the tensor.- Returns:
- The minimum absolute value in the tensor.
-
maxAbs
public static double maxAbs(double... entries) Computes the maximum absolute value in a tensor. Note, if the entries array is empty, this method will return 0 allowing this method to be used for real sparse or dense tensors.- Parameters:
entries
- Entries of the tensor.- Returns:
- The maximum absolute value in the tensor.
-