All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Private Attributes | List of all members
lar::util::Vector3DComparison< RealType > Struct Template Reference

Class comparing 2D vectors. More...

#include <RealComparisons.h>

Public Types

using Comp_t = RealComparisons< RealType >
 Type of base value comparer. More...
 
using Comp2D_t = Vector2DComparison< typename Comp_t::Value_t >
 Type of 2D vector comparer. More...
 

Public Member Functions

constexpr Vector3DComparison (Comp_t const &comparer)
 Copy the specified comparison. More...
 
 Vector3DComparison (Comp_t &&comparer)
 Steal the specified comparison. More...
 
constexpr Vector3DComparison (RealType threshold)
 Use the specified threshold. More...
 
constexpr Comp_t comp () const
 Returns the base value comparer. More...
 
constexpr Comp2D_t comp2D () const
 Returns the 2D vector comparer. More...
 
template<typename Vect >
constexpr bool zero (Vect const &v) const
 Returns whether the specified vector is null (within tolerance). More...
 
template<typename Vect >
constexpr bool nonZero (Vect const &v) const
 Returns whether the specified vector is not null (within tolerance). More...
 
template<typename VectA , typename VectB >
constexpr bool equal (VectA const &a, VectB const &b) const
 Returns whether the specified vectors match (within tolerance). More...
 
template<typename VectA , typename VectB >
constexpr bool nonEqual (VectA const &a, VectB const &b) const
 Returns whether the specified vectors do not match (within tolerance). More...
 

Private Attributes

Comp2D_t comparer
 

Detailed Description

template<typename RealType>
struct lar::util::Vector3DComparison< RealType >

Class comparing 2D vectors.

Definition at line 200 of file RealComparisons.h.

Member Typedef Documentation

template<typename RealType >
using lar::util::Vector3DComparison< RealType >::Comp2D_t = Vector2DComparison<typename Comp_t::Value_t>

Type of 2D vector comparer.

Definition at line 206 of file RealComparisons.h.

template<typename RealType >
using lar::util::Vector3DComparison< RealType >::Comp_t = RealComparisons<RealType>

Type of base value comparer.

Definition at line 203 of file RealComparisons.h.

Constructor & Destructor Documentation

template<typename RealType >
constexpr lar::util::Vector3DComparison< RealType >::Vector3DComparison ( Comp_t const &  comparer)
inline

Copy the specified comparison.

Definition at line 209 of file RealComparisons.h.

template<typename RealType >
lar::util::Vector3DComparison< RealType >::Vector3DComparison ( Comp_t &&  comparer)
inline

Steal the specified comparison.

Definition at line 213 of file RealComparisons.h.

213 : comparer(std::move(comparer)) {}
template<typename RealType >
constexpr lar::util::Vector3DComparison< RealType >::Vector3DComparison ( RealType  threshold)
inline

Use the specified threshold.

Definition at line 216 of file RealComparisons.h.

216 : comparer(threshold) {}

Member Function Documentation

template<typename RealType >
constexpr Comp_t lar::util::Vector3DComparison< RealType >::comp ( ) const
inline

Returns the base value comparer.

Definition at line 219 of file RealComparisons.h.

219 { return comp2D().comp(); }
constexpr Comp_t comp() const
Returns the basic value comparer.
constexpr Comp2D_t comp2D() const
Returns the 2D vector comparer.
template<typename RealType >
constexpr Comp2D_t lar::util::Vector3DComparison< RealType >::comp2D ( ) const
inline

Returns the 2D vector comparer.

Definition at line 222 of file RealComparisons.h.

222 { return comparer; }
template<typename RealType >
template<typename VectA , typename VectB >
constexpr bool lar::util::Vector3DComparison< RealType >::equal ( VectA const &  a,
VectB const &  b 
) const
inline

Returns whether the specified vectors match (within tolerance).

Definition at line 235 of file RealComparisons.h.

236  { return comp2D().equal(a, b) && comp().equal(a.Z(), b.Z()); }
constexpr bool equal(VectA const &a, VectB const &b) const
Returns whether the specified vectors match (within tolerance).
process_name gaushit a
constexpr Comp_t comp() const
Returns the base value comparer.
constexpr Comp2D_t comp2D() const
Returns the 2D vector comparer.
constexpr bool equal(Value_t a, Value_t b) const
Returns whether a and b are no farther than the threshold.
template<typename RealType >
template<typename VectA , typename VectB >
constexpr bool lar::util::Vector3DComparison< RealType >::nonEqual ( VectA const &  a,
VectB const &  b 
) const
inline

Returns whether the specified vectors do not match (within tolerance).

Definition at line 240 of file RealComparisons.h.

241  { return !equal(a, b); }
process_name gaushit a
constexpr bool equal(VectA const &a, VectB const &b) const
Returns whether the specified vectors match (within tolerance).
template<typename RealType >
template<typename Vect >
constexpr bool lar::util::Vector3DComparison< RealType >::nonZero ( Vect const &  v) const
inline

Returns whether the specified vector is not null (within tolerance).

Definition at line 231 of file RealComparisons.h.

231 { return !zero(v); }
constexpr bool zero(Vect const &v) const
Returns whether the specified vector is null (within tolerance).
template<typename RealType >
template<typename Vect >
constexpr bool lar::util::Vector3DComparison< RealType >::zero ( Vect const &  v) const
inline

Returns whether the specified vector is null (within tolerance).

Definition at line 226 of file RealComparisons.h.

227  { return comp2D().zero(v) && comp().zero(v.Z()); }
constexpr bool zero(Value_t value) const
Returns whether the value is no farther from 0 than the threshold.
constexpr Comp_t comp() const
Returns the base value comparer.
constexpr bool zero(Vect const &v) const
Returns whether the specified vector is null (within tolerance).
constexpr Comp2D_t comp2D() const
Returns the 2D vector comparer.

Member Data Documentation

template<typename RealType >
Comp2D_t lar::util::Vector3DComparison< RealType >::comparer
private

Definition at line 244 of file RealComparisons.h.


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