Class Complex64Ops
java.lang.Object
org.flag4j.linalg.ops.common.complex.Complex64Ops
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 Summary
Modifier and TypeMethodDescriptionstatic boolean
Checks whether a tensor contains at least one non-real value.static boolean
Checks whether a tensor contains only real values.static Complex64[]
Rounds the values of a tensor with specified precision.static Complex64[]
roundToZero
(Complex64[] src, float threshold) Rounds values which are close to zero in absolute value to zero.
-
Method Details
-
round
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
- Ifprecision
is negative.
-
roundToZero
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
- Ifthreshold
is negative.
-
isReal
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
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.
-