PSCF v1.1
|
Comparison of element-by-element differences between field arrays. More...
#include <FieldComparison.h>
Public Member Functions | |
FieldComparison (int begin=0) | |
Default constructor. More... | |
double | compare (FT const &a, FT const &b) |
Compare individual fields. More... | |
double | compare (DArray< FT > const &a, DArray< FT > const &b) |
Compare arrays of fields associated with different monomer types. More... | |
double | maxDiff () const |
Return the precomputed maximum element-by-element difference. More... | |
double | rmsDiff () const |
Return the precomputed root-mean-squared difference. More... | |
Comparison of element-by-element differences between field arrays.
The template argument FT may be RField<D> for representations of a field or fields on an r-grid or DArray<double> for representation using a symmetry-adapted basis.
Definition at line 27 of file FieldComparison.h.
Pscf::FieldComparison< FT >::FieldComparison | ( | int | begin = 0 | ) |
Default constructor.
Initializes maxDiff and rmsDiff to zero.
begin | first element of array/field to compare. |
Definition at line 20 of file FieldComparison.tpp.
double Pscf::FieldComparison< FT >::compare | ( | FT const & | a, |
FT const & | b | ||
) |
Compare individual fields.
Array dimensions must agree. An Exception is thrown if the capacities of fields a and b are not equal.
a | 1st field |
b | 2nd field |
Definition at line 28 of file FieldComparison.tpp.
References UTIL_CHECK.
Referenced by Pscf::Pspc::System< D >::compare().
double Pscf::FieldComparison< FT >::compare | ( | DArray< FT > const & | a, |
DArray< FT > const & | b | ||
) |
Compare arrays of fields associated with different monomer types.
All array dimensions must agree.
An exception is thrown if the capacities of the enclosing DArrays (the number of monomers) are not equal or if the capacities of any pair of individual fields (number of grid points or basis functions) are not equal.
a | 1st DArray of field |
b | 2nd DArray of field |
Definition at line 56 of file FieldComparison.tpp.
References Util::Array< Data >::capacity(), and UTIL_CHECK.
|
inline |
Return the precomputed maximum element-by-element difference.
This function returns the maximum difference between corresponding field array elements found by the most recent comparison.
Definition at line 76 of file FieldComparison.h.
Referenced by Pscf::Pspc::System< D >::compare().
|
inline |
Return the precomputed root-mean-squared difference.
This function returns the root-mean-squared difference between corresponding elements found by the most recent comparison.
Definition at line 85 of file FieldComparison.h.
Referenced by Pscf::Pspc::System< D >::compare().