Class DComplexProperty
- java.lang.Object
-
- cern.colt.matrix.tdcomplex.algo.DComplexProperty
-
public class DComplexProperty extends java.lang.ObjectTests matrices for equality.Except where explicitly indicated, all methods involving equality tests ( ==) allow for numerical instability, to a degree specified upon instance construction and returned by method
tolerance(). The public static final variable DEFAULT represents a default Property object with a tolerance of 1.0E-9. The public static final variable ZERO represents a Property object with a tolerance of 0.0. The public static final variable TWELVE represents a Property object with a tolerance of 1.0E-12. As long as you are happy with these tolerances, there is no need to construct Property objects. Simply use idioms like Property.DEFAULT.equals(A,B), Property.ZERO.equals(A,B), Property.TWELVE.equals(A,B).To work with a different tolerance (e.g. 1.0E-15 or 1.0E-5) use the constructor and/or method
setTolerance(double). Note that the public static final Property objects are immutable: Is is not possible to alter their tolerance. Any attempt to do so will throw an Exception.Note that this implementation is not synchronized.
-
-
Field Summary
Fields Modifier and Type Field and Description static DComplexPropertyDEFAULTThe default Property object; currently has tolerance()==1.0E-9.static DComplexPropertyTWELVEA Property object with tolerance()==1.0E-12.static DComplexPropertyZEROA Property object with tolerance()==0.0.
-
Constructor Summary
Constructors Constructor and Description DComplexProperty(double newTolerance)Constructs an instance with a tolerance of Math.abs(newTolerance).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleanequals(DComplexMatrix1D A, DComplexMatrix1D B)Returns whether both given matrices A and B are equal.booleanequals(DComplexMatrix1D A, double[] value)Returns whether all cells of the given matrix A are equal to the given value.booleanequals(DComplexMatrix2D A, DComplexMatrix2D B)Returns whether both given matrices A and B are equal.booleanequals(DComplexMatrix2D A, double[] value)Returns whether all cells of the given matrix A are equal to the given value.booleanequals(DComplexMatrix3D A, DComplexMatrix3D B)Returns whether both given matrices A and B are equal.booleanequals(DComplexMatrix3D A, double[] value)Returns whether all cells of the given matrix A are equal to the given value.voidsetTolerance(double newTolerance)Sets the tolerance to Math.abs(newTolerance).doubletolerance()Returns the current tolerance.
-
-
-
Field Detail
-
DEFAULT
public static final DComplexProperty DEFAULT
The default Property object; currently has tolerance()==1.0E-9.
-
ZERO
public static final DComplexProperty ZERO
A Property object with tolerance()==0.0.
-
TWELVE
public static final DComplexProperty TWELVE
A Property object with tolerance()==1.0E-12.
-
-
Constructor Detail
-
DComplexProperty
public DComplexProperty(double newTolerance)
Constructs an instance with a tolerance of Math.abs(newTolerance).
-
-
Method Detail
-
setTolerance
public void setTolerance(double newTolerance)
Sets the tolerance to Math.abs(newTolerance).- Throws:
java.lang.UnsupportedOperationException- if this==DEFAULT || this==ZERO || this==TWELVE.
-
tolerance
public double tolerance()
Returns the current tolerance.
-
equals
public boolean equals(DComplexMatrix1D A, double[] value)
Returns whether all cells of the given matrix A are equal to the given value.- Parameters:
A- the first matrix to compare.value- the value to compare against.- Returns:
- true if the matrix is equal to the value; false otherwise.
-
equals
public boolean equals(DComplexMatrix1D A, DComplexMatrix1D B)
Returns whether both given matrices A and B are equal.- Parameters:
A- the first matrix to compare.B- the second matrix to compare.- Returns:
- true if both matrices are equal; false otherwise.
-
equals
public boolean equals(DComplexMatrix2D A, double[] value)
Returns whether all cells of the given matrix A are equal to the given value.- Parameters:
A- the first matrix to compare.value- the value to compare against.- Returns:
- true if the matrix is equal to the value; false otherwise.
-
equals
public boolean equals(DComplexMatrix2D A, DComplexMatrix2D B)
Returns whether both given matrices A and B are equal.- Parameters:
A- the first matrix to compare.B- the second matrix to compare.- Returns:
- true if both matrices are equal; false otherwise.
-
equals
public boolean equals(DComplexMatrix3D A, double[] value)
Returns whether all cells of the given matrix A are equal to the given value.- Parameters:
A- the first matrix to compare.value- the value to compare against.- Returns:
- true if the matrix is equal to the value; false otherwise.
-
equals
public boolean equals(DComplexMatrix3D A, DComplexMatrix3D B)
Returns whether both given matrices A and B are equal.- Parameters:
A- the first matrix to compare.B- the second matrix to compare.- Returns:
- true if both matrices are equal; false otherwise.
-
-
DMelt 3.0 © DataMelt by jWork.ORG