PSCF v1.2
Pscf::Prdc::Cuda::RFieldDftComparison< D > Class Template Reference

Comparator for RFieldDft (k-grid) arrays, allocated on device. More...

#include <RFieldDftComparison.h>

Public Member Functions

 RFieldDftComparison ()
 Default constructor.
 
double compare (RFieldDft< D > const &a, RFieldDft< D > const &b)
 Compare individual fields.
 
double compare (DArray< RFieldDft< D > > const &a, DArray< RFieldDft< 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::Cuda::RFieldDftComparison< D >

Comparator for RFieldDft (k-grid) arrays, allocated on device.

Definition at line 26 of file cuda/RFieldDftComparison.h.

Constructor & Destructor Documentation

◆ RFieldDftComparison()

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

Default constructor.

Initializes maxDiff and rmsDiff to zero.

Member Function Documentation

◆ compare() [1/2]

template<int D>
double Pscf::Prdc::Cuda::RFieldDftComparison< D >::compare ( RFieldDft< D > const & a,
RFieldDft< 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)

◆ compare() [2/2]

template<int D>
double Pscf::Prdc::Cuda::RFieldDftComparison< D >::compare ( DArray< RFieldDft< D > > const & a,
DArray< RFieldDft< 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 fields
b2nd DArray of fields
Returns
maximum element-by-element difference (maxDiff)

◆ maxDiff()

template<int D>
double Pscf::Prdc::Cuda::RFieldDftComparison< 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 cuda/RFieldDftComparison.h.

◆ rmsDiff()

template<int D>
double Pscf::Prdc::Cuda::RFieldDftComparison< 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 cuda/RFieldDftComparison.h.


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