Class RealDenseProperties
java.lang.Object
org.flag4j.linalg.ops.dense.real.RealDenseProperties
This class contains low-level implementations for ops which check if a tensor satisfies some property.
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isAntiSymmetric
(double[] src, Shape shape) Checks if a real dense matrix is anti-symmetric.static boolean
isCloseToIdentity
(Matrix src) Checks if a matrix is the identity matrix approximately.static boolean
isIdentity
(Matrix src) Checks if a matrix is the identity matrix exactly.static boolean
isSymmetric
(double[] src, Shape shape) Checks if a real dense matrix is symmetric.
-
Method Details
-
isSymmetric
Checks if a real dense matrix is symmetric. That is, if the matrix is equal to its transpose.- Parameters:
src
- Entries of the matrix.shape
- Shape of the matrix.- Returns:
- True if this matrix is symmetric
-
isAntiSymmetric
Checks if a real dense matrix is anti-symmetric. That is, if the matrix is equal to its negative transpose.- Parameters:
src
- Entries of the matrix.shape
- Shape of the matrix.- Returns:
- True if this matrix is anti-symmetric
-
isIdentity
Checks if a matrix is the identity matrix exactly.- Parameters:
src
- Matrix of interest to check if it is the identity matrix.- Returns:
- True if the
src
matrix is exactly the identity matrix.
-
isCloseToIdentity
Checks if a matrix is the identity matrix approximately. Specifically, if the diagonal data are no farther than 1.001E-5 in absolute value from 1.0 and the non-diagonal data are no larger than 1e-08 in absolute value. These tolerances are derived from theinvalid reference
TensorBase#allClose(Object)
- Parameters:
src
- Matrix of interest to check if it is the identity matrix.- Returns:
- True if the
src
matrix is exactly the identity matrix.
-