Parallel Colt 0.9.4

cern.colt.matrix.tfcomplex.algo
Class FComplexProperty

java.lang.Object
  extended by cern.colt.matrix.tfcomplex.algo.FComplexProperty

public class FComplexProperty
extends Object

Tests 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-5. The public static final variable ZERO represents a Property object with a tolerance of 0.0. The public static final variable SEVEN represents a Property object with a tolerance of 1.0E-7. 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-2) use the constructor and/or method setTolerance(float). 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.

Version:
1.1, 28/May/2000 (fixed strange bugs involving NaN, -inf, inf)
Author:
wolfgang.hoschek@cern.ch, Piotr Wendykier (piotr.wendykier@gmail.com)

Field Summary
static FComplexProperty DEFAULT
          The default Property object; currently has tolerance()==1.0E-5.
static FComplexProperty SEVEN
          A Property object with tolerance()==1.0E-7.
static FComplexProperty ZERO
          A Property object with tolerance()==0.0.
 
Constructor Summary
FComplexProperty(float newTolerance)
          Constructs an instance with a tolerance of Math.abs(newTolerance).
 
Method Summary
 boolean equals(FComplexMatrix1D A, FComplexMatrix1D B)
          Returns whether both given matrices A and B are equal.
 boolean equals(FComplexMatrix1D A, float[] value)
          Returns whether all cells of the given matrix A are equal to the given value.
 boolean equals(FComplexMatrix2D A, FComplexMatrix2D B)
          Returns whether both given matrices A and B are equal.
 boolean equals(FComplexMatrix2D A, float[] value)
          Returns whether all cells of the given matrix A are equal to the given value.
 boolean equals(FComplexMatrix3D A, FComplexMatrix3D B)
          Returns whether both given matrices A and B are equal.
 boolean equals(FComplexMatrix3D A, float[] value)
          Returns whether all cells of the given matrix A are equal to the given value.
 void setTolerance(float newTolerance)
          Sets the tolerance to Math.abs(newTolerance).
 float tolerance()
          Returns the current tolerance.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT

public static final FComplexProperty DEFAULT
The default Property object; currently has tolerance()==1.0E-5.


ZERO

public static final FComplexProperty ZERO
A Property object with tolerance()==0.0.


SEVEN

public static final FComplexProperty SEVEN
A Property object with tolerance()==1.0E-7.

Constructor Detail

FComplexProperty

public FComplexProperty(float newTolerance)
Constructs an instance with a tolerance of Math.abs(newTolerance).

Method Detail

setTolerance

public void setTolerance(float newTolerance)
Sets the tolerance to Math.abs(newTolerance).

Throws:
UnsupportedOperationException - if this==DEFAULT || this==ZERO || this==TWELVE.

tolerance

public float tolerance()
Returns the current tolerance.


equals

public boolean equals(FComplexMatrix1D A,
                      float[] 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(FComplexMatrix1D A,
                      FComplexMatrix1D 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(FComplexMatrix2D A,
                      float[] 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(FComplexMatrix2D A,
                      FComplexMatrix2D 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(FComplexMatrix3D A,
                      float[] 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(FComplexMatrix3D A,
                      FComplexMatrix3D 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.

Parallel Colt 0.9.4

Jump to the Parallel Colt Homepage