![]() |
Home | Libraries | People | FAQ | More |
boost::histogram::indexed_range::accessor — Pointer-like class to access value and index of current cell.
// In header: <boost/histogram/indexed.hpp> // Pointer-like class to access value and index of current cell. class accessor { public: // member classes/structs/unions // Array-like view into the current multi-dimensional index. class index_view { public: // construct/copy/destruct index_view(const cache_item *, const cache_item *); // public member functions auto begin() const noexcept; auto end() const noexcept; auto size() const noexcept; int operator[](unsigned) const noexcept; int at(unsigned) const; }; // construct/copy/destruct accessor(indexed_range &, value_iterator); // public member functions decltype(auto) operator *() const noexcept; decltype(auto) get() const noexcept; decltype(auto) operator->() const noexcept; int index(unsigned = 0) const noexcept; auto indices() const noexcept; template<unsigned N = 0> decltype(auto) bin(std::integral_constant< unsigned, N > = {}) const; decltype(auto) bin(unsigned) const; double density() const; };
Its methods allow one to query the current indices and bins. Furthermore, it acts like a pointer to the cell value.
accessor
public member functionsdecltype(auto) operator *() const noexcept;Returns the cell value.
decltype(auto) get() const noexcept;Returns the cell value.
decltype(auto) operator->() const noexcept;Access fields and methods of the cell object.
int index(unsigned d = 0) const noexcept;Access current index.
Parameters: |
|
auto indices() const noexcept;Access indices as an iterable range.
template<unsigned N = 0> decltype(auto) bin(std::integral_constant< unsigned, N > = {}) const;Access current bin.
Template Parameters: |
|
decltype(auto) bin(unsigned d) const;Access current bin.
Parameters: |
|
double density() const;Computes density in current cell.
The density is computed as the cell value divided by the product of bin widths. Axes without bin widths, like axis::category
, are treated as having unit bin with.