Reference documentation for deal.II version 8.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Public Attributes | List of all members
internal::MatrixFreeFunctions::FPArrayComparator< Number > Struct Template Reference

#include <helper_functions.h>

Public Member Functions

 FPArrayComparator (const Number scaling)
 
bool operator() (const std::vector< Number > &v1, const std::vector< Number > &v2) const
 
template<int dim>
bool operator() (const Tensor< 1, dim, Tensor< 1, VectorizedArray< Number >::n_array_elements, Number > > &t1, const Tensor< 1, dim, Tensor< 1, VectorizedArray< Number >::n_array_elements, Number > > &t2) const
 
template<int dim>
bool operator() (const Tensor< 2, dim, Tensor< 1, VectorizedArray< Number >::n_array_elements, Number > > &t1, const Tensor< 2, dim, Tensor< 1, VectorizedArray< Number >::n_array_elements, Number > > &t2) const
 

Public Attributes

Number tolerance
 

Detailed Description

template<typename Number>
struct internal::MatrixFreeFunctions::FPArrayComparator< Number >

A class that is used to compare floating point arrays (e.g. std::vectors, Tensor<1,dim>, etc.). The idea of this class is to consider two arrays as equal if they are the same within a given tolerance. We use this comparator class within an std::map<> of the given arrays. Note that this comparison operator does not satisfy all the mathematical properties one usually wants to have (consider e.g. the numbers a=0, b=0.1, c=0.2 with tolerance 0.15; the operator gives a<c, but neither of a<b? or b<c? is satisfied). This is not a problem in the use cases for this class, but be careful when using it in other contexts.

Definition at line 165 of file helper_functions.h.


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