Class ComplexProperties
java.lang.Object
org.flag4j.operations.common.complex.ComplexProperties
This class contains low-level implementations for operations which check if a complex tensor satisfies some property.
Implementations are agnostic to whether the tensor is sparse or dense.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
Checks if all entries of two arrays are 'close'.static boolean
Checks if all entries of two arrays are 'close'.static boolean
Checks whether a tensor contains at least one non-real value.static boolean
Checks whether a tensor contains only real values.static boolean
Checks if an array contains only zeros.
-
Constructor Details
-
ComplexProperties
private ComplexProperties()
-
-
Method Details
-
isReal
Checks whether a tensor contains only real values.- Parameters:
entries
- Entries of dense tensor or non-zero entries 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 entries of sparse tensor.- Returns:
- True if the tensor contains at least one non-real value. Returns false otherwise.
-
isZeros
Checks if an array contains only zeros.- Parameters:
src
- Array to check if it only contains zeros.- Returns:
- True if the
src
array contains only zeros.
-
allClose
Checks if all entries of two arrays are 'close'.- Parameters:
src1
- First array in comparison.src2
- Second array in comparison.- Returns:
- True if both arrays have the same length and all entries are 'close' element-wise, i.e.
elements
a
andb
at the same positions in the two arrays respectively and satisfy|a-b| <= (1E-05 + 1E-08*|b|)
. Otherwise, returns false. - See Also:
-
allClose
Checks if all entries of two arrays are 'close'.- Parameters:
src1
- First array in comparison.src2
- Second array in comparison.- Returns:
- True if both arrays have the same length and all entries are 'close' element-wise, i.e.
elements
a
andb
at the same positions in the two arrays respectively and satisfy|a-b| <= (absTol + relTol*|b|)
. Otherwise, returns false. - See Also:
-