Peano 4
Loading...
Searching...
No Matches
tarch::la::VectorCompare< N > Struct Template Reference

Comparison operator for boolean vectors. More...

#include <VectorCompare.h>

Inheritance diagram for tarch::la::VectorCompare< N >:

Public Member Functions

 VectorCompare (double accuracy=NUMERICAL_ZERO_DIFFERENCE)
 
bool operator() (const Vector< N, double > &left, const Vector< N, double > &right) const
 

Private Attributes

const double _accuracy
 

Detailed Description

template<int N>
struct tarch::la::VectorCompare< N >

Comparison operator for boolean vectors.

If you wanna store sets of vectors (e.g. in a map), the STL libraries are by default falling back to a bit-wise comparison. This might not be of use if you manage sets/maps of double vectors. In this case, you wanna the container take into account machine precision. In such a case, declare the map e.g. as follows:

std::map<tarch::la::Vector<DIMENSIONS,double> , int, tarch::la::VectorCompare<DIMENSIONS> > _vertex2IndexMap;
Comparison operator for boolean vectors.
Author
Tobias Weinzierl

Definition at line 31 of file VectorCompare.h.

Constructor & Destructor Documentation

◆ VectorCompare()

template<int N>
tarch::la::VectorCompare< N >::VectorCompare ( double accuracy = NUMERICAL_ZERO_DIFFERENCE)

Definition at line 35 of file VectorCompare.h.

Member Function Documentation

◆ operator()()

template<int N>
bool tarch::la::VectorCompare< N >::operator() ( const Vector< N, double > & left,
const Vector< N, double > & right ) const

Definition at line 40 of file VectorCompare.h.

References tarch::la::VectorCompare< N >::_accuracy, and tarch::la::firstGreater().

Here is the call graph for this function:

Field Documentation

◆ _accuracy

template<int N>
const double tarch::la::VectorCompare< N >::_accuracy
private

Definition at line 33 of file VectorCompare.h.

Referenced by tarch::la::VectorCompare< N >::operator()().


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