Class Complex64Ops

java.lang.Object
org.flag4j.linalg.ops.common.complex.Complex64Ops

public final class Complex64Ops extends Object
This class provides low level methods for computing ops on complex tensors. These methods can be applied to either sparse or dense complex tensors.
  • Method Details

    • round

      public static Complex64[] round(Complex64[] src, int precision)
      Rounds the values of a tensor with specified precision.
      Parameters:
      src - Entries of the tensor to round.
      precision - Precision to round to (i.e. the number of decimal places).
      Returns:
      The result of rounding all data of the source tensor with the specified precision.
      Throws:
      IllegalArgumentException - If precision is negative.
    • roundToZero

      public static Complex64[] roundToZero(Complex64[] src, float threshold)
      Rounds values which are close to zero in absolute value to zero.
      Parameters:
      threshold - Threshold for rounding values to zero. That is, if a value in this tensor is less than the threshold in absolute value then it will be rounded to zero. This value must be non-negative.
      Returns:
      A copy of this matrix with rounded values.
      Throws:
      IllegalArgumentException - If threshold is negative.
    • isReal

      public static boolean isReal(Complex64[] entries)
      Checks whether a tensor contains only real values.
      Parameters:
      entries - Entries of dense tensor or non-zero data of sparse tensor.
      Returns:
      True if the tensor only contains real values. Returns false otherwise.
    • isComplex

      public static boolean isComplex(Complex64[] entries)
      Checks whether a tensor contains at least one non-real value.
      Parameters:
      entries - Entries of dense tensor or non-zero data of sparse tensor.
      Returns:
      True if the tensor contains at least one non-real value. Returns false otherwise.