|
using | CounterMap_t = HoughTransformCounters< KEY, COUNTER, SIZE, ALLOC, SUBCOUNTERS > |
| This class. More...
|
|
using | Base_t = lar::CountersMap< KEY, COUNTER, SIZE, ALLOC, SUBCOUNTERS > |
| Base class. More...
|
|
using | BaseMap_t = typename Base_t::BaseMap_t |
|
using | Allocator_t = typename Base_t::Allocator_t |
|
using | Key_t = typename Base_t::Key_t |
|
using | SubCounter_t = typename Base_t::SubCounter_t |
|
using | CounterBlock_t = typename Base_t::CounterBlock_t |
|
using | const_iterator = typename Base_t::const_iterator |
|
using | PairValue_t = std::pair< const_iterator, SubCounter_t > |
| Pair identifying a counter and its current value. More...
|
|
using | Key_t = KEY |
| type of counter key in the map More...
|
|
using | Counter_t = COUNTER |
| type of the single counter More...
|
|
using | Allocator_t = ALLOC |
| type of the single counter More...
|
|
using | CounterMap_t = CountersMap< KEY, COUNTER, SIZE, ALLOC, SUBCOUNTERS > |
| This class. More...
|
|
using | SubCounter_t = Counter_t |
| Type of the subcounter (that is, the actual counter) More...
|
|
using | CounterBlock_t = typename Traits_t::CounterBlock_t |
|
using | BaseMap_t = typename Traits_t::template BaseMap_t< typename std::allocator_traits< Allocator_t >::template rebind_alloc< typename Traits_t::MapValue_t > > |
| Type of the map used in the implementation. More...
|
|
using | value_type = std::pair< const Key_t, SubCounter_t > |
|
using | mapped_type = SubCounter_t |
|
using | allocator_type = Allocator_t |
| type of the single counter More...
|
|
|
| HoughTransformCounters () |
| Default constructor (empty map) More...
|
|
| HoughTransformCounters (Allocator_t alloc) |
| Constructor, specifies an allocator. More...
|
|
SubCounter_t | set (Key_t key, SubCounter_t value) |
| Sets the specified counter to a count value. More...
|
|
SubCounter_t | increment (Key_t key) |
| Increments by 1 the specified counter. More...
|
|
SubCounter_t | decrement (Key_t key) |
| Decrements by 1 the specified counter. More...
|
|
SubCounter_t | set (Key_t key_begin, Key_t key_end, SubCounter_t value) |
| Sets the specified range of counters to a count value. More...
|
|
void | increment (Key_t key_begin, Key_t key_end) |
| Increments by 1 the specified range of counters. More...
|
|
PairValue_t | increment_and_get_max (Key_t key_begin, Key_t key_end) |
| Increments by 1 the specified counters and returns the maximum. More...
|
|
PairValue_t | increment_and_get_max (Key_t key_begin, Key_t key_end, SubCounter_t current_max) |
| Increments by 1 the specified counters and returns the maximum. More...
|
|
void | decrement (Key_t key_begin, Key_t key_end) |
| Decrements by 1 the specified range of counters. More...
|
|
PairValue_t | get_max (SubCounter_t current_max) const |
| Returns the largest counter. More...
|
|
PairValue_t | get_max () const |
| Increments by 1 the specified counters and returns the maximum. More...
|
|
| CountersMap () |
| Default constructor (empty map) More...
|
|
| CountersMap (Allocator_t alloc) |
| Constructor, specifies an allocator. More...
|
|
SubCounter_t | operator[] (Key_t key) const |
| Read-only access to an element; returns 0 if no counter is present. More...
|
|
SubCounter_t | set (Key_t key, SubCounter_t value) |
| Sets the specified counter to a count. More...
|
|
SubCounter_t | increment (Key_t key) |
| Increments by 1 the specified counter. More...
|
|
SubCounter_t | decrement (Key_t key) |
| Decrements by 1 the specified counter. More...
|
|
bool | empty () const |
| Returns whether the map has no counters. More...
|
|
std::make_unsigned< Key_t >::type | n_counters () const |
| Returns the number of allocated counters. More...
|
|
template<typename OALLOC > |
bool | is_equal (const std::map< Key_t, SubCounter_t, std::less< Key_t >, OALLOC > &to, Key_t &first_difference) const |
| Returns whether the counters in this map are equivalent to another. More...
|
|
template<typename OALLOC > |
bool | is_equal (const std::map< Key_t, SubCounter_t, std::less< Key_t >, OALLOC > &to) const |
| Returns whether the counters in this map are equivalent to another. More...
|
|
const_iterator | begin () const |
| Returns an iterator to the begin of the counters. More...
|
|
const_iterator | end () const |
| Returns an iterator past-the-end of the counters. More...
|
|
template<typename KEY, typename COUNTER, size_t SIZE, typename ALLOC = std::allocator<std::pair<KEY, std::array<COUNTER, SIZE>>>, unsigned int SUBCOUNTERS = 1>
class cluster::HoughTransformCounters< KEY, COUNTER, SIZE, ALLOC, SUBCOUNTERS >
CountersMap with access optimized for Hough Transform algorithm.
- Parameters
-
KEY | the type of the key of the counters map |
COUNTER | the type of a basic counter (can be signed or unsigned) |
BLOCKSIZE | the number of counters in a cluster |
ALLOC | allocator for the underlying STL map |
SUBCOUNTERS | split each counter in subcounters (not implemented yet) |
- See Also
- CountersMap
In addition to the standard CountersMap interface, a special range increment, increment with max detection and decrement methods are provided.
Definition at line 281 of file HoughBaseAlg.h.
template<typename K , typename C , size_t S, typename A , unsigned int SC>
Returns the largest counter.
- Parameters
-
current_max | only counters larger than this will be considered |
- Returns
- pair with an iterator to the largest counter and its value
- See Also
- get_max(), increment_and_get_max(Key_t, Key_t)
All counters are parsed, and the first one with the largest count is returned. The return value consist of a pair: the second is the largest counter value, the first member is the constant iterator pointing to the first (lowest key) counter with that (get its key with const_iterator::key() method).
This method does not update the maximum if it's not (strictly) larger than current_max. If no such a maximum is found, the maximum in the return value is equal to current_max, while the iterator points to the end of the map (end()).
Definition at line 150 of file HoughBaseAlg.cxx.
156 while (iCBlock !=
cend) {
158 for (
size_t index = 0; index < block.size(); ++index) {
159 if (block[index] > max.second)
const_iterator end() const
Returns an iterator past-the-end of the counters.
static const_iterator make_const_iterator(typename BaseMap_t::const_iterator it, size_t ix)
Creates a const_iterator (useful in derived classes)
auto cend(FixedBins< T, C > const &) noexcept
BaseMap_t counter_map
the actual data structure for counters
template<typename K , typename C , size_t S, typename A , unsigned int SC>
Increments by 1 the specified counters and returns the maximum.
- Parameters
-
current_max | only counters larger than this will be considered |
- Returns
- pair with an iterator to the largest counter and its value
- See Also
- get_max(SubCounter_t), increment_and_get_max(Key_t, Key_t)
This method works like get_max() method, except that it does not update the maximum if it's not (strictly) larger than current_max. If no such a maximum is found, the maximum in the return value is equal to current_max, while the iterator points to the end of the map (end()).
Definition at line 169 of file HoughBaseAlg.cxx.
171 return get_max(std::numeric_limits<SubCounter_t>::max());
template<typename KEY, typename COUNTER, size_t SIZE, typename ALLOC = std::allocator<std::pair<KEY, std::array<COUNTER, SIZE>>>, unsigned int SUBCOUNTERS = 1>
Increments by 1 the specified counters and returns the maximum.
- Parameters
-
key_begin | key of the first counter to be increased |
key_end | key of the first counter not to be increased |
- Returns
- pair with an iterator to the largest counter and its value
- See Also
- increment(Key_t, Key_t)
This method works like the corresponding increment() method, and in addition it returns the location of the counter with the largest count (after the increase). The return value consist of a pair: the second is the largest counter value in the range after the increase, the first member is the constant iterator pointing to the first (lowest key) counter with that (get its key with const_iterator::key() method).
If no maximum is found, the maximum in the return value is equal to current_max, while the iterator points to the end of the map (end()). Note that if all the counters are at the minimum possible value, no maximum will be returned.
Definition at line 382 of file HoughBaseAlg.h.
template<typename KEY, typename COUNTER, size_t SIZE, typename ALLOC = std::allocator<std::pair<KEY, std::array<COUNTER, SIZE>>>, unsigned int SUBCOUNTERS = 1>
Increments by 1 the specified counters and returns the maximum.
- Parameters
-
key_begin | key of the first counter to be increased |
key_end | key of the first counter not to be increased |
current_max | only counters larger than this will be considered |
- Returns
- pair with an iterator to the largest counter and its value
- See Also
- increment(Key_t, Key_t), increment_and_get_max(Key_t, Key_t)
This method works like increment_and_get_max() method, except that it does not update the maximum if it's not (strictly) larger than current_max. If no such a maximum is found, the maximum in the return value is equal to current_max, while the iterator points to the end of the map (end()).
Definition at line 402 of file HoughBaseAlg.h.