Reference documentation for deal.II version 9.2.0
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Public Member Functions | Public Attributes | List of all members
internal::MatrixFreeFunctions::FPArrayComparator< Number, VectorizedArrayType > Struct Template Reference

#include <deal.II/matrix_free/mapping_info.h>

Public Member Functions

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

Public Attributes

Number tolerance
 

Detailed Description

template<typename Number, typename VectorizedArrayType = VectorizedArray<Number>>
struct internal::MatrixFreeFunctions::FPArrayComparator< Number, VectorizedArrayType >

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 a 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 a<b? nor 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 566 of file mapping_info.h.

Constructor & Destructor Documentation

◆ FPArrayComparator()

template<typename Number , typename VectorizedArrayType = VectorizedArray<Number>>
internal::MatrixFreeFunctions::FPArrayComparator< Number, VectorizedArrayType >::FPArrayComparator ( const Number  scaling)

Member Function Documentation

◆ operator()() [1/5]

template<typename Number , typename VectorizedArrayType = VectorizedArray<Number>>
bool internal::MatrixFreeFunctions::FPArrayComparator< Number, VectorizedArrayType >::operator() ( const std::vector< Number > &  v1,
const std::vector< Number > &  v2 
) const

Compare two vectors of numbers (not necessarily of the same length)

◆ operator()() [2/5]

template<typename Number , typename VectorizedArrayType = VectorizedArray<Number>>
bool internal::MatrixFreeFunctions::FPArrayComparator< Number, VectorizedArrayType >::operator() ( const Tensor< 1, VectorizedArrayType::size(), Number > &  t1,
const Tensor< 1, VectorizedArrayType::size(), Number > &  t2 
) const

Compare two vectorized arrays (stored as tensors to avoid alignment issues).

◆ operator()() [3/5]

template<typename Number , typename VectorizedArrayType = VectorizedArray<Number>>
template<int dim>
bool internal::MatrixFreeFunctions::FPArrayComparator< Number, VectorizedArrayType >::operator() ( const Tensor< 1, dim, Tensor< 1, VectorizedArrayType::size(), Number >> &  t1,
const Tensor< 1, dim, Tensor< 1, VectorizedArrayType::size(), Number >> &  t2 
) const

Compare two rank-1 tensors of vectorized arrays (stored as tensors to avoid alignment issues).

◆ operator()() [4/5]

template<typename Number , typename VectorizedArrayType = VectorizedArray<Number>>
template<int dim>
bool internal::MatrixFreeFunctions::FPArrayComparator< Number, VectorizedArrayType >::operator() ( const Tensor< 2, dim, Tensor< 1, VectorizedArrayType::size(), Number >> &  t1,
const Tensor< 2, dim, Tensor< 1, VectorizedArrayType::size(), Number >> &  t2 
) const

Compare two rank-2 tensors of vectorized arrays (stored as tensors to avoid alignment issues).

◆ operator()() [5/5]

template<typename Number , typename VectorizedArrayType = VectorizedArray<Number>>
template<int dim>
bool internal::MatrixFreeFunctions::FPArrayComparator< Number, VectorizedArrayType >::operator() ( const std::array< Tensor< 2, dim, Number >, dim+1 > &  t1,
const std::array< Tensor< 2, dim, Number >, dim+1 > &  t2 
) const

Compare two arrays of tensors.

Member Data Documentation

◆ tolerance

template<typename Number , typename VectorizedArrayType = VectorizedArray<Number>>
Number internal::MatrixFreeFunctions::FPArrayComparator< Number, VectorizedArrayType >::tolerance

Definition at line 618 of file mapping_info.h.


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