PSCF v1.2
Pscf::Prdc::Cpu::CFieldComparison< D > Class Template Reference

Comparator for CField (k-grid) arrays. More...

#include <CFieldComparison.h>

Public Member Functions

 CFieldComparison ()
 Default constructor.
 
double compare (CField< D > const &a, CField< D > const &b)
 Compare individual fields.
 
double compare (DArray< CField< D > > const &a, DArray< CField< D > > const &b)
 Compare arrays of fields associated with different monomer types.
 
double maxDiff () const
 Return the precomputed maximum element-by-element difference.
 
double rmsDiff () const
 Return the precomputed root-mean-squared difference.
 

Detailed Description

template<int D>
class Pscf::Prdc::Cpu::CFieldComparison< D >

Comparator for CField (k-grid) arrays.

Definition at line 26 of file cpu/CFieldComparison.h.

Constructor & Destructor Documentation

◆ CFieldComparison()

template<int D>
Pscf::Prdc::Cuda::CFieldComparison< D >::CFieldComparison ( )

Default constructor.

Initializes maxDiff and rmsDiff to zero.

Definition at line 20 of file cpu/CFieldComparison.tpp.

Member Function Documentation

◆ compare() [1/2]

template<int D>
double Pscf::Prdc::Cuda::CFieldComparison< D >::compare ( CField< D > const & a,
CField< D > const & b )

Compare individual fields.

Array dimensions must agree. An Exception is thrown if the capacities of fields a and b are not equal.

Parameters
a1st field
b2nd field
Returns
maximum element-by-element difference (maxDiff)

Definition at line 28 of file cpu/CFieldComparison.tpp.

References Util::Array< Data >::capacity(), and UTIL_CHECK.

◆ compare() [2/2]

template<int D>
double Pscf::Prdc::Cuda::CFieldComparison< D >::compare ( DArray< CField< D > > const & a,
DArray< CField< D > > 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.

Parameters
a1st DArray of field
b2nd DArray of field
Returns
maximum element-by-element difference (maxDiff)

Definition at line 63 of file cpu/CFieldComparison.tpp.

References UTIL_CHECK.

◆ maxDiff()

template<int D>
double Pscf::Prdc::Cpu::CFieldComparison< D >::maxDiff ( ) const
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 74 of file cpu/CFieldComparison.h.

◆ rmsDiff()

template<int D>
double Pscf::Prdc::Cpu::CFieldComparison< D >::rmsDiff ( ) const
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 83 of file cpu/CFieldComparison.h.


The documentation for this class was generated from the following files: