ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
detray::brute_force_collection< value_t, container_t > Class Template Reference

A collection of brute force surface finders, callable by index. More...

#include <detray/navigation/accelerators/brute_force.hpp>

Classes

struct  brute_forcer
 A nested surface finder that returns all surfaces in a range (brute force). More...

Public Types

using buffer_type
 Buffer type used to transfer offsets and stored descriptors.
using const_view_type
 Const view type for offsets and stored surface descriptors.
using size_type = dindex
 Index type used for collection sizes and volume slots.
using value_type = brute_forcer
 Query result representing a volume's brute-force surface range.
template<typename T>
using vector_type = typename container_t::template vector_type<T>
 Device/host vector type used to store values.
using view_type = dmulti_view<dvector_view<size_type>, dvector_view<value_t>>
 View type for offsets and stored surface descriptors.

Public Member Functions

constexpr brute_force_collection ()
 Default constructor.
template<concepts::device_view coll_view_t>
 brute_force_collection (coll_view_t &view)
 Device-side construction from a vecmem based view type.
constexpr brute_force_collection (vecmem::memory_resource &resource)
 Constructor from memory resource.
constexpr brute_force_collection (vecmem::memory_resource *resource)
 Constructor from memory resource.
auto all () -> vector_type< value_t > &
auto all () const -> const vector_type< value_t > &
constexpr auto empty () const noexcept -> bool
auto erase (typename vector_type< value_t >::iterator pos) noexcept(false)
 Remove surface from collection.
constexpr auto get_data () const noexcept -> const_view_type
constexpr auto get_data () noexcept -> view_type
auto & offsets ()
const auto & offsets () const
auto operator[] (const size_type i) -> value_type
 Create brute force surface finder from surface container - const.
auto operator[] (const size_type i) const -> value_type
 Create brute force surface finder from surface container - const.
template<detray::ranges::range sf_container_t>
requires std::is_same_v<typename sf_container_t::value_type, value_t>
auto push_back (const sf_container_t &surfaces) noexcept(false) -> void
 Add a new surface collection.
constexpr auto size () const noexcept -> size_type

Detailed Description

template<class value_t, typename container_t = host_container_types>
class detray::brute_force_collection< value_t, container_t >

A collection of brute force surface finders, callable by index.

This class fulfills all criteria to be used in the detector multi_store .

Template Parameters
value_tthe entry type in the collection (e.g. surface descriptors).
container_tthe types of underlying containers to be used.

Member Typedef Documentation

◆ buffer_type

template<class value_t, typename container_t = host_container_types>
using detray::brute_force_collection< value_t, container_t >::buffer_type
Initial value:
dmulti_buffer<dvector_buffer<size_type>, dvector_buffer<value_t>>

Buffer type used to transfer offsets and stored descriptors.

◆ const_view_type

template<class value_t, typename container_t = host_container_types>
using detray::brute_force_collection< value_t, container_t >::const_view_type
Initial value:
dmulti_view<dvector_view<const size_type>, dvector_view<const value_t>>

Const view type for offsets and stored surface descriptors.

Constructor & Destructor Documentation

◆ brute_force_collection() [1/3]

template<class value_t, typename container_t = host_container_types>
detray::brute_force_collection< value_t, container_t >::brute_force_collection ( vecmem::memory_resource * resource)
explicitconstexpr

Constructor from memory resource.

Parameters
resourceResource used to allocate offsets and surface storage.

◆ brute_force_collection() [2/3]

template<class value_t, typename container_t = host_container_types>
detray::brute_force_collection< value_t, container_t >::brute_force_collection ( vecmem::memory_resource & resource)
explicitconstexpr

Constructor from memory resource.

Parameters
resourceResource used to allocate offsets and surface storage.

◆ brute_force_collection() [3/3]

template<class value_t, typename container_t = host_container_types>
template<concepts::device_view coll_view_t>
detray::brute_force_collection< value_t, container_t >::brute_force_collection ( coll_view_t & view)
explicit

Device-side construction from a vecmem based view type.

Parameters
viewView containing the offsets and surface descriptors.

Member Function Documentation

◆ all() [1/2]

template<class value_t, typename container_t = host_container_types>
auto detray::brute_force_collection< value_t, container_t >::all ( ) ->vector_type< value_t > &
Returns
access to the surface container - non-const.

◆ all() [2/2]

template<class value_t, typename container_t = host_container_types>
auto detray::brute_force_collection< value_t, container_t >::all ( ) const->constvector_type< value_t > &
Returns
access to the surface container - const.

◆ empty()

template<class value_t, typename container_t = host_container_types>
auto detray::brute_force_collection< value_t, container_t >::empty ( ) const->bool
constexprnoexcept
Returns
Whether the collection contains any per-volume surface ranges.

◆ erase()

template<class value_t, typename container_t = host_container_types>
auto detray::brute_force_collection< value_t, container_t >::erase ( typename vector_type< value_t >::iterator pos)
noexcept

Remove surface from collection.

Parameters
posIterator to the surface descriptor to remove.
Returns
Iterator following the erased descriptor.

◆ get_data() [1/2]

template<class value_t, typename container_t = host_container_types>
auto detray::brute_force_collection< value_t, container_t >::get_data ( ) const->const_view_type
constexprnoexcept
Returns
the view on the brute force finders - const

◆ get_data() [2/2]

template<class value_t, typename container_t = host_container_types>
auto detray::brute_force_collection< value_t, container_t >::get_data ( ) ->view_type
constexprnoexcept
Returns
the view on the brute force finders - non-const

◆ offsets() [1/2]

template<class value_t, typename container_t = host_container_types>
auto & detray::brute_force_collection< value_t, container_t >::offsets ( )
Returns
access to the volume offsets

◆ offsets() [2/2]

template<class value_t, typename container_t = host_container_types>
const auto & detray::brute_force_collection< value_t, container_t >::offsets ( ) const
Returns
access to the volume offsets - const

◆ operator[]() [1/2]

template<class value_t, typename container_t = host_container_types>
auto detray::brute_force_collection< value_t, container_t >::operator[] ( const size_type i) ->value_type

Create brute force surface finder from surface container - const.

Parameters
iVolume index whose surface range is requested.
Returns
A finder spanning the surfaces assigned to that volume.

◆ operator[]() [2/2]

template<class value_t, typename container_t = host_container_types>
auto detray::brute_force_collection< value_t, container_t >::operator[] ( const size_type i) const->value_type

Create brute force surface finder from surface container - const.

Parameters
iVolume index whose surface range is requested.
Returns
A finder spanning the surfaces assigned to that volume.

◆ push_back()

template<class value_t, typename container_t = host_container_types>
template<detray::ranges::range sf_container_t>
requires std::is_same_v<typename sf_container_t::value_type, value_t>
auto detray::brute_force_collection< value_t, container_t >::push_back ( const sf_container_t & surfaces) ->void

Add a new surface collection.

Parameters
surfacesSurface descriptors to append as one volume's range.

◆ size()

template<class value_t, typename container_t = host_container_types>
auto detray::brute_force_collection< value_t, container_t >::size ( ) const->size_type
constexprnoexcept
Returns
number of surface collections (at least on per volume) - const