SpatialOps
SpatialOps::FieldComparisonHelper< FieldT > Class Template Reference

static helper class for field comparison functions More...

#include <FieldComparisons.h>

Friends

bool field_equal_abs (const FieldT &f1, const FieldT &f2, double error)
 Returns if f1 is element-wise equal to f2 within a certain absolute tolerance. More...
 
bool field_equal_ulp (const FieldT &f1, const FieldT &f2, const unsigned int ulps)
 Returns if f1 is element-wise equal to f2 within a certain number of ulps. More...
 

Detailed Description

template<typename FieldT>
class SpatialOps::FieldComparisonHelper< FieldT >

static helper class for field comparison functions

This class contains private helper functions for the field_equal functions.

Template Parameters
FieldT– Any type of SpatialField

Definition at line 45 of file FieldComparisons.h.

Friends And Related Function Documentation

◆ field_equal_abs

template<typename FieldT >
bool field_equal_abs ( const FieldT &  f1,
const FieldT &  f2,
double  error = 0.0 
)
friend

Returns if f1 is element-wise equal to f2 within a certain absolute tolerance.

WARNING: Slow in general and comparison with external fields will incur copy penalties.

Template Parameters
FieldT– Any type of SpatialField
Parameters
f1– Field 1
f2– Field 2
error– Allowable absolute value of error.

Definition at line 201 of file FieldComparisons.h.

◆ field_equal_ulp

template<typename FieldT >
bool field_equal_ulp ( const FieldT &  f1,
const FieldT &  f2,
const unsigned int  ulps 
)
friend

Returns if f1 is element-wise equal to f2 within a certain number of ulps.

This function determines the amount of ulps two floating point numbers are off and compares them to the allowed tolerance. Ulp stands for Unit in the Last Place and is a measure of rounding error in floating point numbers. A more detailed article can be found at: http://en.wikipedia.org/wiki/Unit_in_the_last_place

WARNING: Slow in general and comparison with external fields will incur copy penalties.

Template Parameters
FieldT– Any type of SpatialField
Parameters
f1– Field 1
f2– Field 2
ulps– Allowable difference in ulps

Definition at line 270 of file FieldComparisons.h.


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