improved doxygen docs

This commit is contained in:
Hans Dembinski 2021-11-15 09:24:22 +01:00
parent c234637336
commit b7e69a0cf9
4 changed files with 26 additions and 16 deletions

View File

@ -23,11 +23,11 @@ def select(condition, *tags):
def is_detail(x): def is_detail(x):
if x.text is not None: if x.text is not None:
if "detail" in x.text: if "detail" in x.text.lower():
return True return True
m = re.match(r"(?:typename)? *([A-Za-z0-9_\:]+)", x.text) m = re.match(r"(?:typename)? *([A-Za-z0-9_\:]+)", x.text)
if m is not None: if m is not None:
s = m.group(1) s = m.group(1).lower()
if s.startswith("detail") or s.endswith("_impl"): if s.startswith("detail") or s.endswith("_impl"):
x.text = s x.text = s
return True return True
@ -103,6 +103,12 @@ for item in select(
else: else:
log("removing unnamed template parameter from", parent.tag, name) log("removing unnamed template parameter from", parent.tag, name)
# hide macros with detail in the name
for item in select(lambda x: "DETAIL" in x.get("name").split("_"), "macro"):
parent = parent_map[item]
parent.remove(item)
log("removing macro", item.get("name"))
# replace any type with "detail" in its name with "unspecified" # replace any type with "detail" in its name with "unspecified"
for item in select(is_detail, "type"): for item in select(is_detail, "type"):
log("replacing", '"%s"' % item.text, 'with "unspecified"') log("replacing", '"%s"' % item.text, 'with "unspecified"')

View File

@ -57,7 +57,11 @@ constexpr auto operator-(bitset<B1>, bitset<B2>) {
@tparam Pos position of the bit in the set. @tparam Pos position of the bit in the set.
*/ */
template <unsigned Pos> template <unsigned Pos>
struct bit : bitset<(1 << Pos)> {}; #ifndef BOOST_HISTOGRAM_DOXYGEN_INVOKED
using bit = bitset<(1 << Pos)>;
#else
struct bit;
#endif
/// All options off. /// All options off.
using none_t = bitset<0>; using none_t = bitset<0>;

View File

@ -208,16 +208,16 @@ struct get_options;
an axis type and represents compile-time boolean which is true or false, depending on an axis type and represents compile-time boolean which is true or false, depending on
whether the axis is inclusive or not. whether the axis is inclusive or not.
An inclusive axis has a bin for every possible input value. In other words, all
possible input values always end up in a valid cell and there is no need to keep track
of input tuples that need to be discarded. A histogram which consists entirely of
inclusive axes can be filled more efficiently, which can be a factor 2 faster.
An axis with underflow and overflow bins is always inclusive, but an axis may be An axis with underflow and overflow bins is always inclusive, but an axis may be
inclusive under other conditions. The meta-function checks for the method `constexpr inclusive under other conditions. The meta-function checks for the method `constexpr
static bool inclusive()`, and uses the result. If this method is not present, it uses static bool inclusive()`, and uses the result. If this method is not present, it uses
get_options<Axis> and checks whether the underflow and overflow bits are present. get_options<Axis> and checks whether the underflow and overflow bits are present.
An inclusive axis has a bin for every possible input value. A histogram which consists
only of inclusive axes can be filled more efficiently, since input values always
end up in a valid cell and there is no need to keep track of input tuples that need to
be discarded.
@tparam Axis axis type @tparam Axis axis type
*/ */
template <class Axis> template <class Axis>

View File

@ -150,14 +150,14 @@ class BOOST_ATTRIBUTE_NODISCARD histogram;
namespace detail { namespace detail {
/* Most of the histogram code is generic and works for any number of axes. Buffers with a /*
* fixed maximum capacity are used in some places, which have a size equal to the rank of Most of the histogram code is generic and works for any number of axes. Buffers with a
* a histogram. The buffers are statically allocated to improve performance, which means fixed maximum capacity are used in some places, which have a size equal to the rank of
* that they need a preset maximum capacity. 32 seems like a safe upper limit for the rank a histogram. The buffers are allocated from the stack to improve performance, which
* (you can nevertheless increase it here if necessary): the simplest non-trivial axis has means in C++ that they need a preset maximum capacity. 32 seems like a safe upper limit
* 2 bins; even if counters are used which need only a byte of storage per bin, 32 axes for the rank. You can nevertheless increase it with the compile-time flag
* would generate of 4 GB. BOOST_HISTOGRAM_DETAIL_AXES_LIMIT, if necessary.
*/ */
#ifndef BOOST_HISTOGRAM_DETAIL_AXES_LIMIT #ifndef BOOST_HISTOGRAM_DETAIL_AXES_LIMIT
#define BOOST_HISTOGRAM_DETAIL_AXES_LIMIT 32 #define BOOST_HISTOGRAM_DETAIL_AXES_LIMIT 32
#endif #endif