LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
geo::vect::details Namespace Reference

Classes

struct  AccumulateImpl
 
struct  AccumulateImpl< Op, First, Second, Others... >
 
struct  AccumulateImpl< Op, T >
 
struct  AlwaysFalse
 
struct  BaseCoordTypes
 
struct  BaseCoordTypes< Vector, void >
 
struct  BindCoordManagersImpl
 
struct  BindCoordManagersImpl< Vector, 2U >
 
struct  BindCoordManagersImpl< Vector, 3U >
 
struct  BindCoordManagersImpl< Vector, 4U >
 
struct  BindCoordManagersImplBase
 
class  BoundCoordGetter
 
class  BoundCoordManager
 
struct  ConvertToDispatcher
 
struct  ConvertToDispatcher< Vector, Vector, Dim >
 
struct  ConvertToImpl
 
struct  ConvertToImpl< Dest, Source, 2U >
 
struct  ConvertToImpl< Dest, Source, 3U >
 
struct  ConvertToImpl< Dest, Source, 4U >
 
struct  ConvertToImplBase
 
class  CoordGetter
 Helper class for read of a single vector coordinate. More...
 
struct  CoordGetterTraits
 
class  CoordManager
 Helper class for read/write of a single vector coordinate. More...
 
struct  CoordManagerImpl
 
struct  CoordManagerImpl< Vector, 1U >
 
struct  CoordManagerImpl< Vector, 2U >
 
struct  CoordManagerImpl< Vector, 3U >
 
struct  CoordManagerImpl< Vector, 4U >
 
struct  CoordManagersImpl
 
struct  CoordManagersImpl< Vector, 2U >
 
struct  CoordManagersImpl< Vector, 3U >
 
struct  CoordManagersImpl< Vector, 4U >
 
struct  CoordManagersImplBase
 
struct  CoordManagerTraits
 
struct  HasGetter
 
struct  MemberFuncClassType
 
struct  MemberFuncClassType< Func Class::* >
 
struct  MemberFuncReturnType
 
struct  VectorScalar
 

Typedefs

template<typename Vector >
using VectorScalar_t = typename VectorScalar< Vector >::type
 
template<typename Vector >
using CoordinateArray_t = std::array< VectorScalar_t< Vector >, dimension< Vector >()>
 A STL array suitable to contain all coordinate values of a Vector. More...
 
template<typename T >
using MemberFuncReturn_t = typename MemberFuncReturnType< T >::type
 
template<typename T >
using MemberFuncClass_t = typename MemberFuncClassType< T >::type
 
template<typename Vector >
using VectorIndices_t = std::make_index_sequence< dimension< Vector >()>
 Type of sequence of indices up to Vector size. More...
 

Functions

template<typename Op , typename... T>
auto extended_accumulate (Op op, T &&...args)
 
template<typename... T>
auto extended_and (T...args) -> decltype(auto)
 
template<typename Vector >
constexpr bool HasX ()
 
template<typename Vector >
constexpr bool HasY ()
 
template<typename Vector >
constexpr bool HasZ ()
 
template<typename Vector >
constexpr bool HasT ()
 
template<typename Vector >
constexpr unsigned int dimension ()
 
template<typename Getter >
constexpr auto makeCoordReader (Getter getter)
 
template<typename Getter , typename Setter >
constexpr auto makeCoordManager (Getter getter, Setter setter)
 
template<typename T >
constexpr T && constexpr_forward (std::remove_reference_t< T > &t)
 
template<typename T >
constexpr T && constexpr_forward (std::remove_reference_t< T > &&t)
 
template<typename Vector >
constexpr auto makeVectorIndices ()
 
template<typename Vector >
constexpr auto makeVectorIndices (Vector &&)
 
template<typename T , T... Indices>
constexpr auto makeIndexSeqImpl (std::integer_sequence< T, Indices... >)
 
template<typename T , T N>
constexpr auto makeIndexSeq ()
 
template<std::size_t I, typename Data >
constexpr auto accessElement (Data &&data)
 
template<typename Vector , typename Coords , std::size_t... Indices>
constexpr Vector makeFromCoordsImpl (Coords &&coords, std::index_sequence< Indices... >)
 
template<typename Point , std::size_t... I>
bool isfiniteImpl (Point const &point, std::index_sequence< I... >)
 

Variables

template<typename Vector >
constexpr CoordManager_t< Vector > NoCoordManager { nullptr, nullptr }
 

Typedef Documentation

template<typename Vector >
using geo::vect::details::CoordinateArray_t = typedef std::array<VectorScalar_t<Vector>, dimension<Vector>()>

A STL array suitable to contain all coordinate values of a Vector.

Definition at line 152 of file geo_vectors_utils.h.

template<typename T >
using geo::vect::details::MemberFuncClass_t = typedef typename MemberFuncClassType<T>::type

Definition at line 173 of file geo_vectors_utils.h.

template<typename T >
using geo::vect::details::MemberFuncReturn_t = typedef typename MemberFuncReturnType<T>::type

Definition at line 164 of file geo_vectors_utils.h.

template<typename Vector >
using geo::vect::details::VectorIndices_t = typedef std::make_index_sequence<dimension<Vector>()>

Type of sequence of indices up to Vector size.

Definition at line 1370 of file geo_vectors_utils.h.

template<typename Vector >
using geo::vect::details::VectorScalar_t = typedef typename VectorScalar<Vector>::type

Definition at line 98 of file geo_vectors_utils.h.

Function Documentation

template<std::size_t I, typename Data >
constexpr auto geo::vect::details::accessElement ( Data &&  data)

Definition at line 1394 of file geo_vectors_utils.h.

References makeFromCoordsImpl().

1394 { return data[I]; }
template<typename T >
constexpr T&& geo::vect::details::constexpr_forward ( std::remove_reference_t< T > &  t)

Definition at line 1356 of file geo_vectors_utils.h.

1357  { return static_cast<T&&>(t); }
template<typename T >
constexpr T&& geo::vect::details::constexpr_forward ( std::remove_reference_t< T > &&  t)

Definition at line 1360 of file geo_vectors_utils.h.

1361  {
1362  static_assert(!std::is_lvalue_reference<T>(),
1363  "template argument substituting T is an lvalue reference type");
1364  return static_cast<T&&>(t);
1365  }
template<typename Vector >
constexpr unsigned int geo::vect::details::dimension ( )

Definition at line 140 of file geo_vectors_utils.h.

140  {
141  return HasT<Vector>()? 4U
142  : HasZ<Vector>()? 3U
143  : HasY<Vector>()? 2U
144  : HasX<Vector>()? 1U
145  : 0U;
146  } // dimension()
template<typename Op , typename... T>
auto geo::vect::details::extended_accumulate ( Op  op,
T &&...  args 
)

Definition at line 70 of file geo_vectors_utils.h.

Referenced by extended_and().

71  { return AccumulateImpl<Op, T...>::compute(op, std::forward<T>(args)...); }
template<typename... T>
auto geo::vect::details::extended_and ( T...  args) -> decltype(auto)

Definition at line 75 of file geo_vectors_utils.h.

References extended_accumulate().

Referenced by isfiniteImpl().

76  {
77  auto and_op = [](auto&& a, auto&& b) { return a && b; };
78  return extended_accumulate(and_op, std::forward<T>(args)...);
79  }
auto extended_accumulate(Op op, T &&...args)
template<typename Vector >
constexpr bool geo::vect::details::HasT ( )
template<typename Vector >
constexpr bool geo::vect::details::HasX ( )
template<typename Vector >
constexpr bool geo::vect::details::HasY ( )
template<typename Vector >
constexpr bool geo::vect::details::HasZ ( )
template<typename Point , std::size_t... I>
bool geo::vect::details::isfiniteImpl ( Point const &  point,
std::index_sequence< I... >   
)

Definition at line 1643 of file geo_vectors_utils.h.

References geo::vect::coord(), extended_and(), and geo::vect::isfinite().

Referenced by geo::vect::isfinite().

1644  { return extended_and(std::isfinite(coord(point, I).get())...); }
auto coord(Vector &v, unsigned int n) noexcept
Returns an object to manage the coordinate n of a vector.
bool isfinite(Vector const &v)
Returns whether all components of the vector are finite.
auto extended_and(T...args) -> decltype(auto)
template<typename Getter , typename Setter >
constexpr auto geo::vect::details::makeCoordManager ( Getter  getter,
Setter  setter 
)

Definition at line 299 of file geo_vectors_utils.h.

300  {
301  using Vector_t = std::remove_reference_t<MemberFuncClass_t<Getter>>;
302  return CoordManager<Vector_t, Setter>{getter, setter};
303  }
Helper class for read/write of a single vector coordinate.
recob::tracking::Vector_t Vector_t
template<typename Getter >
constexpr auto geo::vect::details::makeCoordReader ( Getter  getter)

Definition at line 240 of file geo_vectors_utils.h.

241  {
242  using Vector_t = std::remove_reference_t<MemberFuncClass_t<Getter>>;
243  return CoordGetter<Vector_t>{ getter };
244  }
Helper class for read of a single vector coordinate.
recob::tracking::Vector_t Vector_t
template<typename Vector , typename Coords , std::size_t... Indices>
constexpr Vector geo::vect::details::makeFromCoordsImpl ( Coords &&  coords,
std::index_sequence< Indices... >   
)

Definition at line 1398 of file geo_vectors_utils.h.

Referenced by accessElement().

1399  {
1400  return
1401  { accessElement<Indices>(constexpr_forward<Coords>(coords))... };
1402  }
template<typename T , T N>
constexpr auto geo::vect::details::makeIndexSeq ( )

Definition at line 1388 of file geo_vectors_utils.h.

1389  { return makeIndexSeqImpl<T>(std::make_integer_sequence<T, N>{}); }
template<typename T , T... Indices>
constexpr auto geo::vect::details::makeIndexSeqImpl ( std::integer_sequence< T, Indices... >  )

Definition at line 1381 of file geo_vectors_utils.h.

References lar::dump::array().

1384  { return std::array<T, sizeof...(Indices)>{{ Indices... }}; }
auto array(Array const &a)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:228
template<typename Vector >
constexpr auto geo::vect::details::makeVectorIndices ( )

Definition at line 1373 of file geo_vectors_utils.h.

1373 { return VectorIndices_t<Vector>{}; }
std::make_index_sequence< dimension< Vector >()> VectorIndices_t
Type of sequence of indices up to Vector size.
template<typename Vector >
constexpr auto geo::vect::details::makeVectorIndices ( Vector &&  )

Definition at line 1376 of file geo_vectors_utils.h.

1377  { return makeVectorIndices<Vector>(); }

Variable Documentation

template<typename Vector >
constexpr CoordManager_t<Vector> geo::vect::details::NoCoordManager { nullptr, nullptr }

Definition at line 1407 of file geo_vectors_utils.h.