• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<html>
2<head>
3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
4<title>Concepts</title>
5<link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
6<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7<link rel="home" href="../index.html" title="Chapter 1. Boost.Histogram">
8<link rel="up" href="../index.html" title="Chapter 1. Boost.Histogram">
9<link rel="prev" href="benchmarks.html" title="Benchmarks">
10<link rel="next" href="reference.html" title="Reference">
11</head>
12<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
13<table cellpadding="2" width="100%"><tr>
14<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
15<td align="center"><a href="../../../../../index.html">Home</a></td>
16<td align="center"><a href="../../../../libraries.htm">Libraries</a></td>
17<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
18<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
19<td align="center"><a href="../../../../../more/index.htm">More</a></td>
20</tr></table>
21<hr>
22<div class="spirit-nav">
23<a accesskey="p" href="benchmarks.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="reference.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
24</div>
25<div class="section">
26<div class="titlepage"><div><div><h2 class="title" style="clear: both">
27<a name="histogram.concepts"></a><a class="link" href="concepts.html" title="Concepts">Concepts</a>
28</h2></div></div></div>
29<div class="toc"><dl class="toc">
30<dt><span class="section"><a href="concepts.html#histogram.concepts.Axis">Axis</a></span></dt>
31<dt><span class="section"><a href="concepts.html#histogram.concepts.DiscreteAxis">DiscreteAxis</a></span></dt>
32<dt><span class="section"><a href="concepts.html#histogram.concepts.IntervalAxis">IntervalAxis</a></span></dt>
33<dt><span class="section"><a href="concepts.html#histogram.concepts.Transform">Transform</a></span></dt>
34<dt><span class="section"><a href="concepts.html#histogram.concepts.Storage">Storage</a></span></dt>
35<dt><span class="section"><a href="concepts.html#histogram.concepts.Accumulator">Accumulator</a></span></dt>
36</dl></div>
37<p>
38      Users can extend the library with various new types whose concepts are defined
39      here.
40    </p>
41<div class="section">
42<div class="titlepage"><div><div><h3 class="title">
43<a name="histogram.concepts.Axis"></a><a class="link" href="concepts.html#histogram.concepts.Axis" title="Axis">Axis</a>
44</h3></div></div></div>
45<p>
46        An <span class="bold"><strong>Axis</strong></span> maps input values to indices. It
47        holds state specific to that axis, like the number of bins and any metadata.
48        Must be <a href="https://en.cppreference.com/w/cpp/named_req/CopyConstructible" target="_top">CopyConstructible</a>,
49        <a href="https://en.cppreference.com/w/cpp/named_req/CopyAssignable" target="_top">CopyAssignable</a>,
50        and <span class="bold"><strong>nothrow</strong></span> <a href="https://en.cppreference.com/w/cpp/named_req/MoveAssignable" target="_top">MoveAssignable</a>.
51      </p>
52<h5>
53<a name="histogram.concepts.Axis.h0"></a>
54        <span class="phrase"><a name="histogram.concepts.Axis.associated_types"></a></span><a class="link" href="concepts.html#histogram.concepts.Axis.associated_types">Associated
55        Types</a>
56      </h5>
57<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
58<li class="listitem">
59            <a class="link" href="concepts.html#histogram.concepts.DiscreteAxis" title="DiscreteAxis"><span class="bold"><strong>DiscreteAxis</strong></span></a>
60          </li>
61<li class="listitem">
62            <a class="link" href="concepts.html#histogram.concepts.IntervalAxis" title="IntervalAxis"><span class="bold"><strong>IntervalAxis</strong></span></a>
63          </li>
64</ul></div>
65<h5>
66<a name="histogram.concepts.Axis.h1"></a>
67        <span class="phrase"><a name="histogram.concepts.Axis.required_features"></a></span><a class="link" href="concepts.html#histogram.concepts.Axis.required_features">Required
68        features</a>
69      </h5>
70<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
71<li class="listitem">
72            <code class="computeroutput"><span class="identifier">A</span></code> is a type meeting the
73            requirements of <span class="bold"><strong>Axis</strong></span>
74          </li>
75<li class="listitem">
76            <code class="computeroutput"><span class="identifier">a</span></code> is a value of type
77            <code class="computeroutput"><span class="identifier">A</span></code>
78          </li>
79<li class="listitem">
80            <code class="computeroutput"><span class="identifier">I</span></code> is an alias for <code class="computeroutput"><a class="link" href="reference.html#header.boost.histogram.fwd_hpp" title="Header &lt;boost/histogram/fwd.hpp&gt;">boost::histogram::axis::index_type</a></code>
81          </li>
82</ul></div>
83<div class="table">
84<a name="histogram.concepts.Axis.valid_expressions"></a><p class="title"><b>Table 1.1. Valid expressions</b></p>
85<div class="table-contents"><table class="table" summary="Valid expressions">
86<colgroup>
87<col>
88<col>
89<col>
90</colgroup>
91<thead><tr>
92<th>
93                <p>
94                  Expression
95                </p>
96              </th>
97<th>
98                <p>
99                  Returns
100                </p>
101              </th>
102<th>
103                <p>
104                  Semantics, Pre/Post-conditions
105                </p>
106              </th>
107</tr></thead>
108<tbody>
109<tr>
110<td>
111                <p>
112                  <code class="computeroutput"><span class="identifier">a</span><span class="special">.</span><span class="identifier">size</span><span class="special">()</span></code>
113                </p>
114              </td>
115<td>
116                <p>
117                  <code class="computeroutput"><span class="identifier">I</span></code>
118                </p>
119              </td>
120<td>
121                <p>
122                  Const member function which returns the number of bins of the axis.
123                  All indices from <code class="computeroutput"><span class="number">0</span></code>
124                  to <code class="computeroutput"><span class="identifier">a</span><span class="special">.</span><span class="identifier">size</span><span class="special">()</span>
125                  <span class="special">-</span> <span class="number">1</span></code>
126                  must be valid and address a bin of the axis.
127                </p>
128              </td>
129</tr>
130<tr>
131<td>
132                <p>
133                  <code class="computeroutput"><span class="identifier">a</span><span class="special">.</span><span class="identifier">index</span><span class="special">(</span><span class="identifier">v</span><span class="special">)</span></code>
134                </p>
135              </td>
136<td>
137                <p>
138                  <code class="computeroutput"><span class="identifier">I</span></code>
139                </p>
140              </td>
141<td>
142                <p>
143                  Const member function which maps a value <code class="computeroutput"><span class="identifier">v</span></code>
144                  to an index. The mapping must be injective: each value must be
145                  uniquely mapped to one index. If the value is not covered by the
146                  axis, return either <code class="computeroutput"><span class="special">-</span><span class="number">1</span></code> or <code class="computeroutput"><span class="identifier">a</span><span class="special">.</span><span class="identifier">size</span><span class="special">()</span></code>. The value <code class="computeroutput"><span class="special">-</span><span class="number">1</span></code> indicates that the value is lower
147                  than the lowest value covered by the axis. The value <code class="computeroutput"><span class="identifier">a</span><span class="special">.</span><span class="identifier">size</span><span class="special">()</span></code>
148                  indicates that the value is above the uppermost value covered by
149                  the axis. By convention, <span class="emphasis"><em>NaN</em></span>-values are mapped
150                  to <code class="computeroutput"><span class="identifier">a</span><span class="special">.</span><span class="identifier">size</span><span class="special">()</span></code>.
151                </p>
152              </td>
153</tr>
154<tr>
155<td>
156                <p>
157                  <code class="computeroutput"><span class="identifier">a</span><span class="special">.</span><span class="identifier">get_allocator</span><span class="special">()</span></code>
158                </p>
159              </td>
160<td>
161                <p>
162                  <code class="computeroutput"><span class="identifier">Alloc</span></code>
163                </p>
164              </td>
165<td>
166                <p>
167                  Const member function which returns the allocator <code class="computeroutput"><span class="identifier">Alloc</span></code> used by this axis. May
168                  be omitted if <code class="computeroutput"><span class="identifier">A</span></code>
169                  does not use allocators. If this member function exists, also a
170                  special constructor must exists so that <code class="computeroutput"><span class="identifier">A</span><span class="special">(</span><span class="identifier">a</span><span class="special">.</span><span class="identifier">get_allocator</span><span class="special">())</span></code> is a valid expression.
171                </p>
172              </td>
173</tr>
174</tbody>
175</table></div>
176</div>
177<br class="table-break"><h5>
178<a name="histogram.concepts.Axis.h2"></a>
179        <span class="phrase"><a name="histogram.concepts.Axis.optional_features"></a></span><a class="link" href="concepts.html#histogram.concepts.Axis.optional_features">Optional
180        features</a>
181      </h5>
182<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
183<li class="listitem">
184            <code class="computeroutput"><span class="identifier">A</span></code> is a type meeting the
185            requirements of <span class="bold"><strong>Axis</strong></span>
186          </li>
187<li class="listitem">
188            <code class="computeroutput"><span class="identifier">a</span></code> and <code class="computeroutput"><span class="identifier">b</span></code>
189            are values of type <code class="computeroutput"><span class="identifier">A</span></code>
190          </li>
191<li class="listitem">
192            <code class="computeroutput"><span class="identifier">i</span></code> and <code class="computeroutput"><span class="identifier">j</span></code>
193            are indices of type <code class="computeroutput"><a class="link" href="reference.html#header.boost.histogram.fwd_hpp" title="Header &lt;boost/histogram/fwd.hpp&gt;">boost::histogram::axis::index_type</a></code>
194          </li>
195<li class="listitem">
196            <code class="computeroutput"><span class="identifier">n</span></code> is a value of type
197            <code class="computeroutput"><span class="keyword">unsigned</span></code>
198          </li>
199<li class="listitem">
200            <code class="computeroutput"><span class="identifier">M</span></code> is a metadata type
201            that is <a href="https://en.cppreference.com/w/cpp/named_req/CopyConstructible" target="_top">CopyConstructible</a>
202            and <a href="https://en.cppreference.com/w/cpp/named_req/CopyAssignable" target="_top">CopyAssignable</a>
203            and <span class="bold"><strong>nothrow</strong></span> <a href="https://en.cppreference.com/w/cpp/named_req/MoveAssignable" target="_top">MoveAssignable</a>.
204          </li>
205<li class="listitem">
206            <code class="computeroutput"><span class="identifier">ar</span></code> is a value of an archive
207            with Boost.Serialization semantics
208          </li>
209</ul></div>
210<div class="table">
211<a name="histogram.concepts.Axis.valid_expressions0"></a><p class="title"><b>Table 1.2. Valid expressions</b></p>
212<div class="table-contents"><table class="table" summary="Valid expressions">
213<colgroup>
214<col>
215<col>
216<col>
217</colgroup>
218<thead><tr>
219<th>
220                <p>
221                  Expression
222                </p>
223              </th>
224<th>
225                <p>
226                  Returns
227                </p>
228              </th>
229<th>
230                <p>
231                  Semantics, Pre/Post-conditions
232                </p>
233              </th>
234</tr></thead>
235<tbody>
236<tr>
237<td>
238                <p>
239                  <code class="computeroutput"><span class="identifier">a</span><span class="special">.</span><span class="identifier">update</span><span class="special">(</span><span class="identifier">v</span><span class="special">)</span></code>
240                </p>
241              </td>
242<td>
243                <p>
244                  <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">I</span><span class="special">,</span>
245                  <span class="identifier">I</span><span class="special">&gt;</span></code>
246                </p>
247              </td>
248<td>
249                <p>
250                  Non-const member function which maps a value to an index (first
251                  argument of the returned pair) and offset (second argument of the
252                  returned pair). If the value is not covered by the axis, this method
253                  may grow the current axis size (<code class="computeroutput"><span class="identifier">old_size</span></code>)
254                  by the number of bins needed to contain the value or more (<code class="computeroutput"><span class="identifier">new_size</span></code>). If the value is below
255                  the lowest value covered by the axis, return index <code class="computeroutput"><span class="number">0</span></code> and offset <code class="computeroutput"><span class="identifier">new_size</span>
256                  <span class="special">-</span> <span class="identifier">old_size</span></code>.
257                  If the value is above the uppermost value covered by the axis,
258                  return index <code class="computeroutput"><span class="identifier">new_size</span>
259                  <span class="special">-</span> <span class="number">1</span></code>
260                  and a negative offset <code class="computeroutput"><span class="identifier">old_size</span>
261                  <span class="special">-</span> <span class="identifier">new_size</span></code>.
262                  If the value is outside, but the axis is not enlarged, then return
263                  an index equivalent to <code class="computeroutput"><span class="identifier">a</span><span class="special">.</span><span class="identifier">index</span><span class="special">(</span><span class="identifier">v</span><span class="special">)</span></code> and offset <code class="computeroutput"><span class="number">0</span></code>.
264                </p>
265              </td>
266</tr>
267<tr>
268<td>
269                <p>
270                  <code class="computeroutput"><span class="identifier">A</span><span class="special">(</span><span class="identifier">a</span><span class="special">,</span>
271                  <span class="identifier">i</span><span class="special">,</span>
272                  <span class="identifier">j</span><span class="special">,</span>
273                  <span class="identifier">n</span><span class="special">)</span></code>
274                </p>
275              </td>
276<td>
277              </td>
278<td>
279                <p>
280                  Special constructor used by the reduce algorithm. <code class="computeroutput"><span class="identifier">a</span></code> is the original axis instance,
281                  <code class="computeroutput"><span class="identifier">i</span></code> and <code class="computeroutput"><span class="identifier">j</span></code> are the index range to keep
282                  in the reduced axis. If <code class="computeroutput"><span class="identifier">n</span></code>
283                  is larger than 1, <code class="computeroutput"><span class="identifier">n</span></code>
284                  adjacent bins are merged into one larger cell. If this constructor
285                  is not implemented, <code class="computeroutput"><a class="link" href="../boost/histogram/algorithm/reduce_idm45503931121408.html" title="Function template reduce">boost::histogram::algorithm::reduce</a></code>
286                  throws an exception on an attempt to reduce this axis.
287                </p>
288              </td>
289</tr>
290<tr>
291<td>
292                <p>
293                  <code class="computeroutput"><span class="identifier">a</span><span class="special">.</span><span class="identifier">options</span><span class="special">()</span></code>
294                </p>
295              </td>
296<td>
297                <p>
298                  <code class="computeroutput"><span class="keyword">unsigned</span></code>
299                </p>
300              </td>
301<td>
302                <p>
303                  Static constexpr member function which returns the <code class="computeroutput"><a class="link" href="reference.html#header.boost.histogram.axis.option_hpp" title="Header &lt;boost/histogram/axis/option.hpp&gt;">axis options</a></code>
304                  for this axis.
305                </p>
306              </td>
307</tr>
308<tr>
309<td>
310                <p>
311                  <code class="computeroutput"><span class="identifier">a</span><span class="special">.</span><span class="identifier">inclusive</span><span class="special">()</span></code>
312                </p>
313              </td>
314<td>
315                <p>
316                  <code class="computeroutput"><span class="keyword">bool</span></code>
317                </p>
318              </td>
319<td>
320                <p>
321                  Static constexpr member function which returns true, if the axis
322                  has a bin for every possible input value, and false otherwise.
323                  Faster code can be generated if all axes types in a histogram are
324                  inclusive. An axis with underflow and overflow bins is always inclusive.
325                  An axis may be inclusive even if underflow or overflow bins are
326                  missing. For example, a category axis is inclusive if either it
327                  has an overflow bin or if it is growing.
328                </p>
329              </td>
330</tr>
331<tr>
332<td>
333                <p>
334                  <code class="computeroutput"><span class="identifier">a</span><span class="special">.</span><span class="identifier">metadata</span><span class="special">()</span></code>
335                </p>
336              </td>
337<td>
338                <p>
339                  <code class="computeroutput"><span class="identifier">M</span><span class="special">&amp;</span></code>
340                </p>
341              </td>
342<td>
343                <p>
344                  Const and non-const member functions must exist, which both returns
345                  a mutable reference to the metadata associated with the axis (usually
346                  a string).
347                </p>
348              </td>
349</tr>
350<tr>
351<td>
352                <p>
353                  <code class="computeroutput"><span class="identifier">a</span> <span class="special">==</span>
354                  <span class="identifier">b</span></code>
355                </p>
356              </td>
357<td>
358                <p>
359                  <code class="computeroutput"><span class="keyword">bool</span></code>
360                </p>
361              </td>
362<td>
363                <p>
364                  Returns <code class="computeroutput"><span class="keyword">true</span></code> if all
365                  state variables compare equal, including any metadata. Otherwise
366                  returns <code class="computeroutput"><span class="keyword">false</span></code>. If
367                  <code class="computeroutput"><span class="identifier">a</span> <span class="special">==</span>
368                  <span class="identifier">b</span></code> is implemented, also
369                  <code class="computeroutput"><span class="identifier">a</span> <span class="special">!=</span>
370                  <span class="identifier">b</span></code> must be implemented.
371                  If this binary operator is not implemented, the library considers
372                  the axes equal if their types are the same.
373                </p>
374              </td>
375</tr>
376<tr>
377<td>
378                <p>
379                  <code class="computeroutput"><span class="identifier">a</span> <span class="special">!=</span>
380                  <span class="identifier">b</span></code>
381                </p>
382              </td>
383<td>
384                <p>
385                  <code class="computeroutput"><span class="keyword">bool</span></code>
386                </p>
387              </td>
388<td>
389                <p>
390                  Must be implemented if <code class="computeroutput"><span class="identifier">a</span>
391                  <span class="special">==</span> <span class="identifier">b</span></code>
392                  is implemented and must be equal to <code class="computeroutput"><span class="special">!(</span><span class="identifier">a</span> <span class="special">==</span>
393                  <span class="identifier">b</span><span class="special">)</span></code>.
394                </p>
395              </td>
396</tr>
397<tr>
398<td>
399                <p>
400                  <code class="computeroutput"><span class="identifier">os</span> <span class="special">&lt;&lt;</span>
401                  <span class="identifier">a</span></code>
402                </p>
403              </td>
404<td>
405                <p>
406                  <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ostream</span><span class="special">&lt;</span><span class="identifier">CharT</span><span class="special">,</span>
407                  <span class="identifier">Traits</span><span class="special">&gt;&amp;</span></code>
408                </p>
409              </td>
410<td>
411                <p>
412                  <code class="computeroutput"><span class="identifier">os</span></code> is a value of
413                  type <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ostream</span><span class="special">&lt;</span><span class="identifier">CharT</span><span class="special">,</span>
414                  <span class="identifier">Traits</span><span class="special">&gt;</span></code>.
415                  Streams a text representation of the axis. May not mutate <code class="computeroutput"><span class="identifier">a</span></code>.
416                </p>
417              </td>
418</tr>
419<tr>
420<td>
421                <p>
422                  <code class="computeroutput"><span class="identifier">a</span><span class="special">.</span><span class="identifier">serialize</span><span class="special">(</span><span class="identifier">ar</span><span class="special">,</span>
423                  <span class="identifier">n</span><span class="special">)</span></code>
424                </p>
425              </td>
426<td>
427              </td>
428<td>
429                <p>
430                  Saves to the archive or loads serialised state from the archive.
431                  The version number <code class="computeroutput"><span class="identifier">n</span></code>
432                  is the stored version when the object is loaded or the current
433                  version when the object is saved.
434                </p>
435              </td>
436</tr>
437</tbody>
438</table></div>
439</div>
440<br class="table-break"><h5>
441<a name="histogram.concepts.Axis.h3"></a>
442        <span class="phrase"><a name="histogram.concepts.Axis.models"></a></span><a class="link" href="concepts.html#histogram.concepts.Axis.models">Models</a>
443      </h5>
444<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
445<li class="listitem">
446            <code class="computeroutput"><a class="link" href="../boost/histogram/axis/boolean.html" title="Class template boolean">boost::histogram::axis::boolean</a></code>
447          </li>
448<li class="listitem">
449            <code class="computeroutput"><a class="link" href="../boost/histogram/axis/category.html" title="Class template category">boost::histogram::axis::category</a></code>
450          </li>
451<li class="listitem">
452            <code class="computeroutput"><a class="link" href="../boost/histogram/axis/integer.html" title="Class template integer">boost::histogram::axis::integer</a></code>
453          </li>
454<li class="listitem">
455            <code class="computeroutput"><a class="link" href="../boost/histogram/axis/regular.html" title="Class template regular">boost::histogram::axis::regular</a></code>
456          </li>
457<li class="listitem">
458            <code class="computeroutput"><a class="link" href="../boost/histogram/axis/variable.html" title="Class template variable">boost::histogram::axis::variable</a></code>
459          </li>
460</ul></div>
461</div>
462<div class="section">
463<div class="titlepage"><div><div><h3 class="title">
464<a name="histogram.concepts.DiscreteAxis"></a><a class="link" href="concepts.html#histogram.concepts.DiscreteAxis" title="DiscreteAxis">DiscreteAxis</a>
465</h3></div></div></div>
466<p>
467        A <span class="bold"><strong>DiscreteAxis</strong></span> is one of two optional refinements
468        of the <a class="link" href="concepts.html#histogram.concepts.Axis" title="Axis"><span class="bold"><strong>Axis</strong></span></a>
469        concept, the other one is the <a class="link" href="concepts.html#histogram.concepts.IntervalAxis" title="IntervalAxis">IntervalAxis</a>.
470        This concept is for axes in which each bin represents a single value instead
471        of an interval.
472      </p>
473<p>
474        Discrete axes can be further divided into ordered and unordered. An axis
475        is ordered, when bin indices i &lt; j &lt; k imply that value[i] &lt; value[j]
476        &lt; value[k] or value[i] &gt; value[j] &gt; value[k] for all i, j, k. The
477        <code class="computeroutput"><a class="link" href="../boost/histogram/axis/integer.html" title="Class template integer">integer axis</a></code>
478        is ordered and the <code class="computeroutput"><a class="link" href="../boost/histogram/axis/category.html" title="Class template category">category
479        axis</a></code> is unordered.
480      </p>
481<p>
482        An unordered discrete axis cannot have an underflow bin. Since there is no
483        order, one can have at most one extra bin that counts values not handled
484        by the axis. By convention the overflow bin is used for that.
485      </p>
486<h5>
487<a name="histogram.concepts.DiscreteAxis.h0"></a>
488        <span class="phrase"><a name="histogram.concepts.DiscreteAxis.associated_types"></a></span><a class="link" href="concepts.html#histogram.concepts.DiscreteAxis.associated_types">Associated
489        Types</a>
490      </h5>
491<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
492<li class="listitem">
493            <a class="link" href="concepts.html#histogram.concepts.Axis" title="Axis"><span class="bold"><strong>Axis</strong></span></a>
494          </li>
495<li class="listitem">
496            <a class="link" href="concepts.html#histogram.concepts.IntervalAxis" title="IntervalAxis"><span class="bold"><strong>IntervalAxis</strong></span></a>
497          </li>
498</ul></div>
499<h5>
500<a name="histogram.concepts.DiscreteAxis.h1"></a>
501        <span class="phrase"><a name="histogram.concepts.DiscreteAxis.optional_features"></a></span><a class="link" href="concepts.html#histogram.concepts.DiscreteAxis.optional_features">Optional
502        features</a>
503      </h5>
504<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
505<li class="listitem">
506            <code class="computeroutput"><span class="identifier">A</span></code> is a type meeting the
507            requirements of <span class="bold"><strong>DiscreteAxis</strong></span>
508          </li>
509<li class="listitem">
510            <code class="computeroutput"><span class="identifier">a</span></code> is a value of type
511            <code class="computeroutput"><span class="identifier">A</span></code>
512          </li>
513<li class="listitem">
514            <code class="computeroutput"><span class="identifier">V</span></code> is the type accepted
515            for conversion into an index
516          </li>
517<li class="listitem">
518            <code class="computeroutput"><span class="identifier">v</span></code> is a value of type
519            <code class="computeroutput"><span class="identifier">V</span></code>
520          </li>
521<li class="listitem">
522            <code class="computeroutput"><span class="identifier">i</span></code> is a value of type
523            <code class="computeroutput"><a class="link" href="reference.html#header.boost.histogram.fwd_hpp" title="Header &lt;boost/histogram/fwd.hpp&gt;">boost::histogram::axis::index_type</a></code>
524          </li>
525<li class="listitem">
526            <code class="computeroutput"><span class="identifier">AxisIter</span></code> is an <span class="emphasis"><em>RandomAccessIterator</em></span>
527            over the bins of <code class="computeroutput"><span class="identifier">A</span></code>
528          </li>
529<li class="listitem">
530            <code class="computeroutput"><span class="identifier">ReAxisIter</span></code> is a reverse
531            <span class="emphasis"><em>RandomAccessIterator</em></span> over the bins of <code class="computeroutput"><span class="identifier">A</span></code>
532          </li>
533</ul></div>
534<div class="table">
535<a name="histogram.concepts.DiscreteAxis.valid_expressions"></a><p class="title"><b>Table 1.3. Valid expressions</b></p>
536<div class="table-contents"><table class="table" summary="Valid expressions">
537<colgroup>
538<col>
539<col>
540<col>
541</colgroup>
542<thead><tr>
543<th>
544                <p>
545                  Expression
546                </p>
547              </th>
548<th>
549                <p>
550                  Returns
551                </p>
552              </th>
553<th>
554                <p>
555                  Semantics, Pre/Post-conditions
556                </p>
557              </th>
558</tr></thead>
559<tbody>
560<tr>
561<td>
562                <p>
563                  <code class="computeroutput"><span class="identifier">a</span><span class="special">.</span><span class="identifier">ordered</span><span class="special">()</span></code>
564                </p>
565              </td>
566<td>
567                <p>
568                  <code class="computeroutput"><span class="keyword">bool</span></code>
569                </p>
570              </td>
571<td>
572                <p>
573                  Static constexpr member function which returns true if the axis
574                  is ordered and false otherwise. If this is absent, the library
575                  checks whether the value type is arithmetic instead, see <code class="computeroutput"><a class="link" href="../boost/histogram/axis/traits/ordered.html" title="Function template ordered">boost::histogram::axis::traits::ordered</a></code>.
576                </p>
577              </td>
578</tr>
579<tr>
580<td>
581                <p>
582                  <code class="computeroutput"><span class="identifier">a</span><span class="special">.</span><span class="identifier">value</span><span class="special">(</span><span class="identifier">i</span><span class="special">)</span></code>
583                </p>
584              </td>
585<td>
586                <p>
587                  <code class="computeroutput"><span class="identifier">V</span></code>
588                </p>
589              </td>
590<td>
591                <p>
592                  Const member function which maps an index to a value. The mapping
593                  must be injective: each index must be uniquely mapped to one value.
594                  The effect must be exactly the inverse of <code class="computeroutput"><span class="identifier">a</span><span class="special">.</span><span class="identifier">index</span><span class="special">(</span><span class="identifier">v</span><span class="special">)</span></code>. The return value may be a const
595                  reference, if the lifetime of the referred object is equal to the
596                  lifetime of the axis.
597                </p>
598              </td>
599</tr>
600<tr>
601<td>
602                <p>
603                  <code class="computeroutput"><span class="identifier">a</span><span class="special">.</span><span class="identifier">bin</span><span class="special">(</span><span class="identifier">i</span><span class="special">)</span></code>
604                </p>
605              </td>
606<td>
607                <p>
608                  <code class="computeroutput"><span class="identifier">V</span></code>
609                </p>
610              </td>
611<td>
612                <p>
613                  Must have the same effect as <code class="computeroutput"><span class="identifier">a</span><span class="special">.</span><span class="identifier">value</span><span class="special">(</span><span class="identifier">i</span><span class="special">)</span></code>.
614                </p>
615              </td>
616</tr>
617<tr>
618<td>
619                <p>
620                  <code class="computeroutput"><span class="identifier">s</span><span class="special">.</span><span class="identifier">begin</span><span class="special">()</span></code>
621                </p>
622              </td>
623<td>
624                <p>
625                  <code class="computeroutput"><span class="identifier">AxisIter</span></code>
626                </p>
627              </td>
628<td>
629                <p>
630                  Const member function which return an iterator to the bin with
631                  index <code class="computeroutput"><span class="number">0</span></code>.
632                </p>
633              </td>
634</tr>
635<tr>
636<td>
637                <p>
638                  <code class="computeroutput"><span class="identifier">s</span><span class="special">.</span><span class="identifier">end</span><span class="special">()</span></code>
639                </p>
640              </td>
641<td>
642                <p>
643                  <code class="computeroutput"><span class="identifier">AxisIter</span></code>
644                </p>
645              </td>
646<td>
647                <p>
648                  Const member function which returns an iterator to the bin with
649                  index <code class="computeroutput"><span class="identifier">s</span><span class="special">.</span><span class="identifier">size</span><span class="special">()</span></code>.
650                </p>
651              </td>
652</tr>
653<tr>
654<td>
655                <p>
656                  <code class="computeroutput"><span class="identifier">s</span><span class="special">.</span><span class="identifier">rbegin</span><span class="special">()</span></code>
657                </p>
658              </td>
659<td>
660                <p>
661                  <code class="computeroutput"><span class="identifier">ReAxisIter</span></code>
662                </p>
663              </td>
664<td>
665                <p>
666                  Const member function which return a reverse iterator to the bin
667                  with index <code class="computeroutput"><span class="identifier">s</span><span class="special">.</span><span class="identifier">size</span><span class="special">()-</span><span class="number">1</span></code>.
668                </p>
669              </td>
670</tr>
671<tr>
672<td>
673                <p>
674                  <code class="computeroutput"><span class="identifier">s</span><span class="special">.</span><span class="identifier">rend</span><span class="special">()</span></code>
675                </p>
676              </td>
677<td>
678                <p>
679                  <code class="computeroutput"><span class="identifier">ReAxisIter</span></code>
680                </p>
681              </td>
682<td>
683                <p>
684                  Const member function which returns an iterator to the bin with
685                  index <code class="computeroutput"><span class="special">-</span><span class="number">1</span></code>.
686                </p>
687              </td>
688</tr>
689</tbody>
690</table></div>
691</div>
692<br class="table-break"><div class="tip"><table border="0" summary="Tip">
693<tr>
694<td rowspan="2" align="center" valign="top" width="25"><img alt="[Tip]" src="../../../../../doc/src/images/tip.png"></td>
695<th align="left">Tip</th>
696</tr>
697<tr><td align="left" valign="top"><p>
698          The complete iterator interface can be added to a user-defined axis which
699          implements <code class="computeroutput"><span class="identifier">a</span><span class="special">.</span><span class="identifier">bin</span><span class="special">(</span><span class="identifier">i</span><span class="special">)</span></code> by
700          inheriting from the <code class="computeroutput"><a class="link" href="../boost/histogram/axis/iterator_mixin.html" title="Class template iterator_mixin">iterator_mixin</a></code>.
701        </p></td></tr>
702</table></div>
703<h5>
704<a name="histogram.concepts.DiscreteAxis.h2"></a>
705        <span class="phrase"><a name="histogram.concepts.DiscreteAxis.models"></a></span><a class="link" href="concepts.html#histogram.concepts.DiscreteAxis.models">Models</a>
706      </h5>
707<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
708<li class="listitem">
709            <code class="computeroutput"><a class="link" href="../boost/histogram/axis/category.html" title="Class template category">boost::histogram::axis::category</a></code>
710          </li>
711<li class="listitem">
712            <code class="computeroutput"><a class="link" href="../boost/histogram/axis/integer.html" title="Class template integer">boost::histogram::axis::integer</a></code>,
713            if first template parameter is <code class="computeroutput"><span class="keyword">int</span></code>
714          </li>
715</ul></div>
716</div>
717<div class="section">
718<div class="titlepage"><div><div><h3 class="title">
719<a name="histogram.concepts.IntervalAxis"></a><a class="link" href="concepts.html#histogram.concepts.IntervalAxis" title="IntervalAxis">IntervalAxis</a>
720</h3></div></div></div>
721<p>
722        A <span class="bold"><strong>IntervalAxis</strong></span> is one of two optional refinements
723        of the <a class="link" href="concepts.html#histogram.concepts.Axis" title="Axis"><span class="bold"><strong>Axis</strong></span></a>
724        concept, the other one is the <a class="link" href="concepts.html#histogram.concepts.DiscreteAxis" title="DiscreteAxis">DiscreteAxis</a>.
725        It is for ordered values that form intervals with a well-defined lower and
726        upper edge, and a center. Each bin represents an interval of values.
727      </p>
728<h5>
729<a name="histogram.concepts.IntervalAxis.h0"></a>
730        <span class="phrase"><a name="histogram.concepts.IntervalAxis.associated_types"></a></span><a class="link" href="concepts.html#histogram.concepts.IntervalAxis.associated_types">Associated
731        Types</a>
732      </h5>
733<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
734<li class="listitem">
735            <a class="link" href="concepts.html#histogram.concepts.Axis" title="Axis"><span class="bold"><strong>Axis</strong></span></a>
736          </li>
737<li class="listitem">
738            <a class="link" href="concepts.html#histogram.concepts.DiscreteAxis" title="DiscreteAxis"><span class="bold"><strong>DiscreteAxis</strong></span></a>
739          </li>
740</ul></div>
741<h5>
742<a name="histogram.concepts.IntervalAxis.h1"></a>
743        <span class="phrase"><a name="histogram.concepts.IntervalAxis.optional_features"></a></span><a class="link" href="concepts.html#histogram.concepts.IntervalAxis.optional_features">Optional
744        features</a>
745      </h5>
746<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
747<li class="listitem">
748            <code class="computeroutput"><span class="identifier">A</span></code> is a type meeting the
749            requirements of <span class="bold"><strong>IntervalAxis</strong></span>
750          </li>
751<li class="listitem">
752            <code class="computeroutput"><span class="identifier">a</span></code> is a value of type
753            <code class="computeroutput"><span class="identifier">A</span></code>
754          </li>
755<li class="listitem">
756            <code class="computeroutput"><span class="identifier">V</span></code> is the type accepted
757            for conversion into an index
758          </li>
759<li class="listitem">
760            <code class="computeroutput"><span class="identifier">B</span></code> is the type that represents
761            the bin interval
762          </li>
763<li class="listitem">
764            <code class="computeroutput"><span class="identifier">v</span></code> is a value of type
765            <code class="computeroutput"><span class="identifier">V</span></code>
766          </li>
767<li class="listitem">
768            <code class="computeroutput"><span class="identifier">i</span></code> is a value of type
769            <code class="computeroutput"><a class="link" href="reference.html#header.boost.histogram.fwd_hpp" title="Header &lt;boost/histogram/fwd.hpp&gt;">boost::histogram::axis::index_type</a></code>
770          </li>
771<li class="listitem">
772            <code class="computeroutput"><span class="identifier">j</span></code> is a value of type
773            <code class="computeroutput"><a class="link" href="reference.html#header.boost.histogram.fwd_hpp" title="Header &lt;boost/histogram/fwd.hpp&gt;">boost::histogram::axis::real_index_type</a></code>
774          </li>
775<li class="listitem">
776            <code class="computeroutput"><span class="identifier">AxisIter</span></code> is an <span class="emphasis"><em>RandomAccessIterator</em></span>
777            over the bins of <code class="computeroutput"><span class="identifier">A</span></code>
778          </li>
779<li class="listitem">
780            <code class="computeroutput"><span class="identifier">ReAxisIter</span></code> is a reverse
781            <span class="emphasis"><em>RandomAccessIterator</em></span> over the bins of <code class="computeroutput"><span class="identifier">A</span></code>
782          </li>
783</ul></div>
784<div class="table">
785<a name="histogram.concepts.IntervalAxis.valid_expressions"></a><p class="title"><b>Table 1.4. Valid expressions</b></p>
786<div class="table-contents"><table class="table" summary="Valid expressions">
787<colgroup>
788<col>
789<col>
790<col>
791</colgroup>
792<thead><tr>
793<th>
794                <p>
795                  Expression
796                </p>
797              </th>
798<th>
799                <p>
800                  Returns
801                </p>
802              </th>
803<th>
804                <p>
805                  Semantics, Pre/Post-conditions
806                </p>
807              </th>
808</tr></thead>
809<tbody>
810<tr>
811<td>
812                <p>
813                  <code class="computeroutput"><span class="identifier">a</span><span class="special">.</span><span class="identifier">value</span><span class="special">(</span><span class="identifier">i</span><span class="special">)</span></code>
814                </p>
815              </td>
816<td>
817                <p>
818                  <code class="computeroutput"><span class="identifier">V</span></code>
819                </p>
820              </td>
821<td>
822                <p>
823                  Const member function which maps an index to a value. The mapping
824                  must be injective: each index must be uniquely mapped to one value.
825                  The result of <code class="computeroutput"><span class="identifier">a</span><span class="special">.</span><span class="identifier">value</span><span class="special">(</span><span class="identifier">a</span><span class="special">.</span><span class="identifier">index</span><span class="special">(</span><span class="identifier">v</span><span class="special">))</span></code> should agree to very high precision
826                  with <code class="computeroutput"><span class="identifier">v</span></code> (the mapping
827                  may not be exact due to the finite precision of floating point
828                  computations). The return value may be a const reference, if the
829                  lifetime of the referred object is equal to the lifetime of the
830                  axis. <code class="computeroutput"><span class="identifier">a</span><span class="special">.</span><span class="identifier">value</span><span class="special">(</span><span class="identifier">j</span><span class="special">)</span></code>
831                  is expected to return the lower edge of the bin, <code class="computeroutput"><span class="identifier">a</span><span class="special">.</span><span class="identifier">value</span><span class="special">(</span><span class="identifier">j</span><span class="special">+</span><span class="number">1</span><span class="special">)</span></code>
832                  the upper edge, and <code class="computeroutput"><span class="identifier">a</span><span class="special">.</span><span class="identifier">value</span><span class="special">(</span><span class="identifier">j</span>
833                  <span class="special">+</span> <span class="number">0.5</span><span class="special">)</span></code> the center.
834                </p>
835              </td>
836</tr>
837<tr>
838<td>
839                <p>
840                  <code class="computeroutput"><span class="identifier">a</span><span class="special">.</span><span class="identifier">bin</span><span class="special">(</span><span class="identifier">i</span><span class="special">)</span></code>
841                </p>
842              </td>
843<td>
844                <p>
845                  <code class="computeroutput"><span class="identifier">B</span></code>
846                </p>
847              </td>
848<td>
849                <p>
850                  Const member function which returns an instance that represents
851                  the current bin. Nothing about the type is required, but it is
852                  recommended that the type has the methods <code class="computeroutput"><span class="identifier">B</span><span class="special">::</span><span class="identifier">lower</span><span class="special">()</span></code>, <code class="computeroutput"><span class="identifier">B</span><span class="special">::</span><span class="identifier">upper</span><span class="special">()</span></code>, and <code class="computeroutput"><span class="identifier">B</span><span class="special">::</span><span class="identifier">center</span><span class="special">()</span></code> similar to the types used by
853                  the builtin axis models. The return value may be a const reference,
854                  if the lifetime of the referred object is equal to the lifetime
855                  of the axis.
856                </p>
857              </td>
858</tr>
859<tr>
860<td>
861                <p>
862                  <code class="computeroutput"><span class="identifier">s</span><span class="special">.</span><span class="identifier">begin</span><span class="special">()</span></code>
863                </p>
864              </td>
865<td>
866                <p>
867                  <code class="computeroutput"><span class="identifier">AxisIter</span></code>
868                </p>
869              </td>
870<td>
871                <p>
872                  Const member function which return an iterator to the bin with
873                  index <code class="computeroutput"><span class="number">0</span></code>.
874                </p>
875              </td>
876</tr>
877<tr>
878<td>
879                <p>
880                  <code class="computeroutput"><span class="identifier">s</span><span class="special">.</span><span class="identifier">end</span><span class="special">()</span></code>
881                </p>
882              </td>
883<td>
884                <p>
885                  <code class="computeroutput"><span class="identifier">AxisIter</span></code>
886                </p>
887              </td>
888<td>
889                <p>
890                  Const member function which returns an iterator to the bin with
891                  index <code class="computeroutput"><span class="identifier">s</span><span class="special">.</span><span class="identifier">size</span><span class="special">()</span></code>.
892                </p>
893              </td>
894</tr>
895<tr>
896<td>
897                <p>
898                  <code class="computeroutput"><span class="identifier">s</span><span class="special">.</span><span class="identifier">rbegin</span><span class="special">()</span></code>
899                </p>
900              </td>
901<td>
902                <p>
903                  <code class="computeroutput"><span class="identifier">ReAxisIter</span></code>
904                </p>
905              </td>
906<td>
907                <p>
908                  Const member function which return a reverse iterator to the bin
909                  with index <code class="computeroutput"><span class="identifier">s</span><span class="special">.</span><span class="identifier">size</span><span class="special">()-</span><span class="number">1</span></code>.
910                </p>
911              </td>
912</tr>
913<tr>
914<td>
915                <p>
916                  <code class="computeroutput"><span class="identifier">s</span><span class="special">.</span><span class="identifier">rend</span><span class="special">()</span></code>
917                </p>
918              </td>
919<td>
920                <p>
921                  <code class="computeroutput"><span class="identifier">ReAxisIter</span></code>
922                </p>
923              </td>
924<td>
925                <p>
926                  Const member function which returns an iterator to the bin with
927                  index <code class="computeroutput"><span class="special">-</span><span class="number">1</span></code>.
928                </p>
929              </td>
930</tr>
931</tbody>
932</table></div>
933</div>
934<br class="table-break"><div class="tip"><table border="0" summary="Tip">
935<tr>
936<td rowspan="2" align="center" valign="top" width="25"><img alt="[Tip]" src="../../../../../doc/src/images/tip.png"></td>
937<th align="left">Tip</th>
938</tr>
939<tr><td align="left" valign="top"><p>
940          The complete iterator interface can be added to a user-defined axis which
941          implements <code class="computeroutput"><span class="identifier">a</span><span class="special">.</span><span class="identifier">bin</span><span class="special">(</span><span class="identifier">i</span><span class="special">)</span></code> by
942          inheriting from the <code class="computeroutput"><a class="link" href="../boost/histogram/axis/iterator_mixin.html" title="Class template iterator_mixin">iterator_mixin</a></code>.
943        </p></td></tr>
944</table></div>
945<h5>
946<a name="histogram.concepts.IntervalAxis.h2"></a>
947        <span class="phrase"><a name="histogram.concepts.IntervalAxis.models"></a></span><a class="link" href="concepts.html#histogram.concepts.IntervalAxis.models">Models</a>
948      </h5>
949<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
950<li class="listitem">
951            <code class="computeroutput"><a class="link" href="../boost/histogram/axis/regular.html" title="Class template regular">boost::histogram::axis::regular</a></code>
952          </li>
953<li class="listitem">
954            <code class="computeroutput"><a class="link" href="../boost/histogram/axis/variable.html" title="Class template variable">boost::histogram::axis::variable</a></code>
955          </li>
956<li class="listitem">
957            <code class="computeroutput"><a class="link" href="../boost/histogram/axis/integer.html" title="Class template integer">boost::histogram::axis::integer</a></code>,
958            if first template parameter is a floating point type
959          </li>
960</ul></div>
961</div>
962<div class="section">
963<div class="titlepage"><div><div><h3 class="title">
964<a name="histogram.concepts.Transform"></a><a class="link" href="concepts.html#histogram.concepts.Transform" title="Transform">Transform</a>
965</h3></div></div></div>
966<p>
967        A <span class="bold"><strong>Transform</strong></span> implements a monotonic mapping
968        between two real-valued domains, external and internal. It is used to extend
969        the <code class="computeroutput"><a class="link" href="../boost/histogram/axis/regular.html" title="Class template regular">regular axis</a></code>.
970        The bins in the internal domain are of equal width, while the bins in the
971        external domain are non-equal width. Must be <a href="https://en.cppreference.com/w/cpp/named_req/DefaultConstructible" target="_top">DefaultConstructible</a>,
972        <a href="https://en.cppreference.com/w/cpp/named_req/CopyConstructible" target="_top">CopyConstructible</a>,
973        and <a href="https://en.cppreference.com/w/cpp/named_req/CopyAssignable" target="_top">CopyAssignable</a>.
974      </p>
975<h5>
976<a name="histogram.concepts.Transform.h0"></a>
977        <span class="phrase"><a name="histogram.concepts.Transform.required_features"></a></span><a class="link" href="concepts.html#histogram.concepts.Transform.required_features">Required
978        features</a>
979      </h5>
980<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
981<li class="listitem">
982            <code class="computeroutput"><span class="identifier">T</span></code> is a type meeting the
983            requirements of <span class="bold"><strong>Transform</strong></span>
984          </li>
985<li class="listitem">
986            <code class="computeroutput"><span class="identifier">t</span></code> is a value of type
987            <code class="computeroutput"><span class="identifier">T</span></code>
988          </li>
989<li class="listitem">
990            <code class="computeroutput"><span class="identifier">X</span></code> is a type with the
991            semantics of a floating-point type
992          </li>
993<li class="listitem">
994            <code class="computeroutput"><span class="identifier">x</span></code> is a value of type
995            <code class="computeroutput"><span class="identifier">X</span></code>
996          </li>
997<li class="listitem">
998            <code class="computeroutput"><span class="identifier">Y</span></code> is a floating-point
999            type
1000          </li>
1001<li class="listitem">
1002            <code class="computeroutput"><span class="identifier">y</span></code> is a value of type
1003            <code class="computeroutput"><span class="identifier">Y</span></code>
1004          </li>
1005</ul></div>
1006<div class="table">
1007<a name="histogram.concepts.Transform.valid_expressions"></a><p class="title"><b>Table 1.5. Valid expressions</b></p>
1008<div class="table-contents"><table class="table" summary="Valid expressions">
1009<colgroup>
1010<col>
1011<col>
1012<col>
1013</colgroup>
1014<thead><tr>
1015<th>
1016                <p>
1017                  Expression
1018                </p>
1019              </th>
1020<th>
1021                <p>
1022                  Returns
1023                </p>
1024              </th>
1025<th>
1026                <p>
1027                  Semantics, Pre/Post-conditions
1028                </p>
1029              </th>
1030</tr></thead>
1031<tbody>
1032<tr>
1033<td>
1034                <p>
1035                  <code class="computeroutput"><span class="identifier">t</span><span class="special">.</span><span class="identifier">forward</span><span class="special">(</span><span class="identifier">x</span><span class="special">)</span></code>
1036                </p>
1037              </td>
1038<td>
1039                <p>
1040                  <code class="computeroutput"><span class="identifier">Y</span></code>
1041                </p>
1042              </td>
1043<td>
1044                <p>
1045                  Const or static member function which maps the external value to
1046                  the corresponding internal value. The return type <code class="computeroutput"><span class="identifier">Y</span></code> may differ from <code class="computeroutput"><span class="identifier">X</span></code>.
1047                </p>
1048              </td>
1049</tr>
1050<tr>
1051<td>
1052                <p>
1053                  <code class="computeroutput"><span class="identifier">t</span><span class="special">.</span><span class="identifier">inverse</span><span class="special">(</span><span class="identifier">y</span><span class="special">)</span></code>
1054                </p>
1055              </td>
1056<td>
1057                <p>
1058                  <code class="computeroutput"><span class="identifier">X</span></code>
1059                </p>
1060              </td>
1061<td>
1062                <p>
1063                  Const or static member function which maps the internal value to
1064                  the corresponding external value. The result of <code class="computeroutput"><span class="identifier">t</span><span class="special">.</span><span class="identifier">inverse</span><span class="special">(</span><span class="identifier">t</span><span class="special">.</span><span class="identifier">forward</span><span class="special">(</span><span class="identifier">x</span><span class="special">))</span></code> must be approximately equal to
1065                  <code class="computeroutput"><span class="identifier">x</span></code> within floating-point
1066                  precision.
1067                </p>
1068              </td>
1069</tr>
1070<tr>
1071<td>
1072                <p>
1073                  <code class="computeroutput"><span class="identifier">t</span> <span class="special">==</span>
1074                  <span class="identifier">u</span></code>
1075                </p>
1076              </td>
1077<td>
1078                <p>
1079                  <code class="computeroutput"><span class="keyword">bool</span></code>
1080                </p>
1081              </td>
1082<td>
1083                <p>
1084                  <code class="computeroutput"><span class="identifier">u</span></code> is another value
1085                  of type <code class="computeroutput"><span class="identifier">T</span></code>. Returns
1086                  <code class="computeroutput"><span class="keyword">true</span></code> if both values
1087                  have the same state. Otherwise returns <code class="computeroutput"><span class="keyword">false</span></code>.
1088                  May be omitted if <code class="computeroutput"><span class="identifier">T</span></code>
1089                  is stateless. If this binary operator is not implemented, the library
1090                  considers the arguments equal, if and only if their types are the
1091                  same.
1092                </p>
1093              </td>
1094</tr>
1095</tbody>
1096</table></div>
1097</div>
1098<br class="table-break"><h5>
1099<a name="histogram.concepts.Transform.h1"></a>
1100        <span class="phrase"><a name="histogram.concepts.Transform.optional_features"></a></span><a class="link" href="concepts.html#histogram.concepts.Transform.optional_features">Optional
1101        features</a>
1102      </h5>
1103<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1104<li class="listitem">
1105            <code class="computeroutput"><span class="identifier">T</span></code> is a type meeting the
1106            requirements of <span class="bold"><strong>Transform</strong></span>
1107          </li>
1108<li class="listitem">
1109            <code class="computeroutput"><span class="identifier">t</span></code> is a value of type
1110            <code class="computeroutput"><span class="identifier">T</span></code>
1111          </li>
1112<li class="listitem">
1113            <code class="computeroutput"><span class="identifier">ar</span></code> is a value of an archive
1114            with Boost.Serialization semantics
1115          </li>
1116</ul></div>
1117<div class="table">
1118<a name="histogram.concepts.Transform.valid_expressions0"></a><p class="title"><b>Table 1.6. Valid expressions</b></p>
1119<div class="table-contents"><table class="table" summary="Valid expressions">
1120<colgroup>
1121<col>
1122<col>
1123<col>
1124</colgroup>
1125<thead><tr>
1126<th>
1127                <p>
1128                  Expression
1129                </p>
1130              </th>
1131<th>
1132                <p>
1133                  Returns
1134                </p>
1135              </th>
1136<th>
1137                <p>
1138                  Semantics, Pre/Post-conditions
1139                </p>
1140              </th>
1141</tr></thead>
1142<tbody><tr>
1143<td>
1144                <p>
1145                  <code class="computeroutput"><span class="identifier">t</span><span class="special">.</span><span class="identifier">serialize</span><span class="special">(</span><span class="identifier">ar</span><span class="special">,</span>
1146                  <span class="identifier">n</span><span class="special">)</span></code>
1147                </p>
1148              </td>
1149<td>
1150              </td>
1151<td>
1152                <p>
1153                  <code class="computeroutput"><span class="identifier">ar</span></code> is a value of
1154                  an archive with Boost.Serialization semantics and <code class="computeroutput"><span class="identifier">n</span></code> is an unsigned integral value.
1155                  Saves to the archive or loads serialized state from the archive.
1156                  The version number <code class="computeroutput"><span class="identifier">n</span></code>
1157                  is the stored version when the object is loaded or the current
1158                  version when the object is saved.
1159                </p>
1160              </td>
1161</tr></tbody>
1162</table></div>
1163</div>
1164<br class="table-break"><h5>
1165<a name="histogram.concepts.Transform.h2"></a>
1166        <span class="phrase"><a name="histogram.concepts.Transform.models"></a></span><a class="link" href="concepts.html#histogram.concepts.Transform.models">Models</a>
1167      </h5>
1168<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1169<li class="listitem">
1170            <code class="computeroutput"><a class="link" href="../boost/histogram/axis/transform/id.html" title="Struct id">boost::histogram::axis::transform::id</a></code>
1171          </li>
1172<li class="listitem">
1173            <code class="computeroutput"><a class="link" href="../boost/histogram/axis/transform/log.html" title="Struct log">boost::histogram::axis::transform::log</a></code>
1174          </li>
1175<li class="listitem">
1176            <code class="computeroutput"><a class="link" href="../boost/histogram/axis/transform/sqrt.html" title="Struct sqrt">boost::histogram::axis::transform::sqrt</a></code>
1177          </li>
1178<li class="listitem">
1179            <code class="computeroutput"><a class="link" href="../boost/histogram/axis/transform/pow.html" title="Struct pow">boost::histogram::axis::transform::pow</a></code>
1180          </li>
1181</ul></div>
1182</div>
1183<div class="section">
1184<div class="titlepage"><div><div><h3 class="title">
1185<a name="histogram.concepts.Storage"></a><a class="link" href="concepts.html#histogram.concepts.Storage" title="Storage">Storage</a>
1186</h3></div></div></div>
1187<p>
1188        A <span class="bold"><strong>Storage</strong></span> handles memory for the bin counters
1189        and provides a uniform vector-like interface for accessing cell values for
1190        reading and writing. Must be <a href="https://en.cppreference.com/w/cpp/named_req/DefaultConstructible" target="_top">DefaultConstructible</a>,
1191        <a href="https://en.cppreference.com/w/cpp/named_req/CopyConstructible" target="_top">CopyConstructible</a>,
1192        and <a href="https://en.cppreference.com/w/cpp/named_req/CopyAssignable" target="_top">CopyAssignable</a>.
1193      </p>
1194<h5>
1195<a name="histogram.concepts.Storage.h0"></a>
1196        <span class="phrase"><a name="histogram.concepts.Storage.required_features"></a></span><a class="link" href="concepts.html#histogram.concepts.Storage.required_features">Required
1197        features</a>
1198      </h5>
1199<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1200<li class="listitem">
1201            <code class="computeroutput"><span class="identifier">S</span></code> is a type meeting the
1202            requirements of <span class="bold"><strong>Storage</strong></span>
1203          </li>
1204<li class="listitem">
1205            <code class="computeroutput"><span class="identifier">s</span></code> is a value of types
1206            <code class="computeroutput"><span class="identifier">S</span></code>
1207          </li>
1208<li class="listitem">
1209            <code class="computeroutput"><span class="identifier">i</span></code> and <code class="computeroutput"><span class="identifier">n</span></code>
1210            are values of type <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span></code>
1211          </li>
1212<li class="listitem">
1213            <code class="computeroutput"><span class="identifier">Alloc</span></code> is an allocator
1214            type for <code class="computeroutput"><span class="identifier">S</span></code>
1215          </li>
1216</ul></div>
1217<div class="table">
1218<a name="histogram.concepts.Storage.valid_expressions"></a><p class="title"><b>Table 1.7. Valid expressions</b></p>
1219<div class="table-contents"><table class="table" summary="Valid expressions">
1220<colgroup>
1221<col>
1222<col>
1223<col>
1224</colgroup>
1225<thead><tr>
1226<th>
1227                <p>
1228                  Expression
1229                </p>
1230              </th>
1231<th>
1232                <p>
1233                  Returns
1234                </p>
1235              </th>
1236<th>
1237                <p>
1238                  Semantics, Pre/Post-conditions
1239                </p>
1240              </th>
1241</tr></thead>
1242<tbody>
1243<tr>
1244<td>
1245                <p>
1246                  <code class="computeroutput"><span class="identifier">S</span><span class="special">::</span><span class="identifier">value_type</span></code>
1247                </p>
1248              </td>
1249<td>
1250              </td>
1251<td>
1252                <p>
1253                  Cell element type, may be either an integral type, floating-point
1254                  type, or a type meeting the requirements of <a class="link" href="concepts.html#histogram.concepts.Accumulator" title="Accumulator"><span class="bold"><strong>Accumulator</strong></span></a>.
1255                </p>
1256              </td>
1257</tr>
1258<tr>
1259<td>
1260                <p>
1261                  <code class="computeroutput"><span class="identifier">S</span><span class="special">::</span><span class="identifier">reference</span></code>
1262                </p>
1263              </td>
1264<td>
1265              </td>
1266<td>
1267                <p>
1268                  <code class="computeroutput"><span class="identifier">S</span><span class="special">::</span><span class="identifier">value_type</span><span class="special">&amp;</span></code>
1269                  or a proxy class which acts like a reference.
1270                </p>
1271              </td>
1272</tr>
1273<tr>
1274<td>
1275                <p>
1276                  <code class="computeroutput"><span class="identifier">S</span><span class="special">::</span><span class="identifier">const_reference</span></code>
1277                </p>
1278              </td>
1279<td>
1280              </td>
1281<td>
1282                <p>
1283                  <code class="computeroutput"><span class="keyword">const</span> <span class="identifier">S</span><span class="special">::</span><span class="identifier">value_type</span><span class="special">&amp;</span></code> or a proxy class which acts
1284                  like a const reference. Implicitly convertible to <code class="computeroutput"><span class="identifier">S</span><span class="special">::</span><span class="identifier">value_type</span></code>.
1285                </p>
1286              </td>
1287</tr>
1288<tr>
1289<td>
1290                <p>
1291                  <code class="computeroutput"><span class="identifier">S</span><span class="special">::</span><span class="identifier">iterator</span></code>
1292                </p>
1293              </td>
1294<td>
1295              </td>
1296<td>
1297                <p>
1298                  Returns an STL-compliant iterator type which dereferences to <code class="computeroutput"><span class="identifier">S</span><span class="special">::</span><span class="identifier">reference</span></code>.
1299                </p>
1300              </td>
1301</tr>
1302<tr>
1303<td>
1304                <p>
1305                  <code class="computeroutput"><span class="identifier">S</span><span class="special">::</span><span class="identifier">const_iterator</span></code>
1306                </p>
1307              </td>
1308<td>
1309              </td>
1310<td>
1311                <p>
1312                  Returns an STL-compliant iterator type which dereferences to <code class="computeroutput"><span class="identifier">S</span><span class="special">::</span><span class="identifier">const_reference</span></code>.
1313                </p>
1314              </td>
1315</tr>
1316<tr>
1317<td>
1318                <p>
1319                  <code class="computeroutput"><span class="identifier">S</span><span class="special">::</span><span class="identifier">has_threading_support</span></code>
1320                </p>
1321              </td>
1322<td>
1323                <p>
1324                  bool
1325                </p>
1326              </td>
1327<td>
1328                <p>
1329                  Static constexpr member. True, if storage supports parallel read-write
1330                  access to all cells. False, if such parallel access would either
1331                  cause data corruption or require synchronization so that effectively
1332                  only one cell can be accessed at a time, making cell-access single-threaded.
1333                </p>
1334              </td>
1335</tr>
1336<tr>
1337<td>
1338                <p>
1339                  <code class="computeroutput"><span class="identifier">s</span><span class="special">.</span><span class="identifier">size</span><span class="special">()</span></code>
1340                </p>
1341              </td>
1342<td>
1343                <p>
1344                  <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span></code>
1345                </p>
1346              </td>
1347<td>
1348                <p>
1349                  Const member function which returns the current number of cells
1350                  in the storage.
1351                </p>
1352              </td>
1353</tr>
1354<tr>
1355<td>
1356                <p>
1357                  <code class="computeroutput"><span class="identifier">s</span><span class="special">.</span><span class="identifier">reset</span><span class="special">(</span><span class="identifier">n</span><span class="special">)</span></code>
1358                </p>
1359              </td>
1360<td>
1361              </td>
1362<td>
1363                <p>
1364                  Non-const member function which discards current cell values, changes
1365                  storage size to <code class="computeroutput"><span class="identifier">n</span></code>
1366                  and initializes all cells to the default-constructed state.
1367                </p>
1368              </td>
1369</tr>
1370<tr>
1371<td>
1372                <p>
1373                  <code class="computeroutput"><span class="identifier">s</span><span class="special">.</span><span class="identifier">begin</span><span class="special">()</span></code>
1374                </p>
1375              </td>
1376<td>
1377                <p>
1378                  <code class="computeroutput"><span class="identifier">S</span><span class="special">::</span><span class="identifier">iterator</span></code>
1379                </p>
1380              </td>
1381<td>
1382                <p>
1383                  Non-const member function which returns the iterator to the first
1384                  storage cell.
1385                </p>
1386              </td>
1387</tr>
1388<tr>
1389<td>
1390                <p>
1391                  <code class="computeroutput"><span class="identifier">s</span><span class="special">.</span><span class="identifier">begin</span><span class="special">()</span></code>
1392                </p>
1393              </td>
1394<td>
1395                <p>
1396                  <code class="computeroutput"><span class="identifier">S</span><span class="special">::</span><span class="identifier">const_iterator</span></code>
1397                </p>
1398              </td>
1399<td>
1400                <p>
1401                  Likewise, but a const member function which returns the const_iterator.
1402                </p>
1403              </td>
1404</tr>
1405<tr>
1406<td>
1407                <p>
1408                  <code class="computeroutput"><span class="identifier">s</span><span class="special">.</span><span class="identifier">end</span><span class="special">()</span></code>
1409                </p>
1410              </td>
1411<td>
1412                <p>
1413                  <code class="computeroutput"><span class="identifier">S</span><span class="special">::</span><span class="identifier">iterator</span></code>
1414                </p>
1415              </td>
1416<td>
1417                <p>
1418                  Member function which returns the iterator to the cell after the
1419                  last valid storage cell.
1420                </p>
1421              </td>
1422</tr>
1423<tr>
1424<td>
1425                <p>
1426                  <code class="computeroutput"><span class="identifier">s</span><span class="special">.</span><span class="identifier">end</span><span class="special">()</span></code>
1427                </p>
1428              </td>
1429<td>
1430                <p>
1431                  <code class="computeroutput"><span class="identifier">S</span><span class="special">::</span><span class="identifier">const_iterator</span></code>
1432                </p>
1433              </td>
1434<td>
1435                <p>
1436                  Likewise, but a const member function which returns the const_iterator.
1437                </p>
1438              </td>
1439</tr>
1440<tr>
1441<td>
1442                <p>
1443                  <code class="computeroutput"><span class="identifier">s</span><span class="special">[</span><span class="identifier">i</span><span class="special">]</span></code>
1444                </p>
1445              </td>
1446<td>
1447                <p>
1448                  <code class="computeroutput"><span class="identifier">S</span><span class="special">::</span><span class="identifier">reference</span></code>
1449                </p>
1450              </td>
1451<td>
1452                <p>
1453                  Member function which returns a reference to the cell which is
1454                  addressed by <code class="computeroutput"><span class="identifier">i</span></code>.
1455                  The index <code class="computeroutput"><span class="identifier">i</span></code> must
1456                  be valid: <code class="computeroutput"><span class="identifier">i</span> <span class="special">&lt;</span>
1457                  <span class="identifier">s</span><span class="special">.</span><span class="identifier">size</span><span class="special">()</span></code>.
1458                </p>
1459              </td>
1460</tr>
1461<tr>
1462<td>
1463                <p>
1464                  <code class="computeroutput"><span class="identifier">s</span><span class="special">[</span><span class="identifier">i</span><span class="special">]</span></code>
1465                </p>
1466              </td>
1467<td>
1468                <p>
1469                  <code class="computeroutput"><span class="identifier">S</span><span class="special">::</span><span class="identifier">const_reference</span></code>
1470                </p>
1471              </td>
1472<td>
1473                <p>
1474                  Likewise, but a const member function which returns a const reference.
1475                </p>
1476              </td>
1477</tr>
1478<tr>
1479<td>
1480                <p>
1481                  <code class="computeroutput"><span class="identifier">s</span> <span class="special">==</span>
1482                  <span class="identifier">t</span></code>
1483                </p>
1484              </td>
1485<td>
1486                <p>
1487                  <code class="computeroutput"><span class="keyword">bool</span></code>
1488                </p>
1489              </td>
1490<td>
1491                <p>
1492                  <code class="computeroutput"><span class="identifier">t</span></code> is another value
1493                  of a type which meets the requirements of <span class="bold"><strong>Storage</strong></span>.
1494                  Returns <code class="computeroutput"><span class="keyword">true</span></code> if arguments
1495                  have the same number of cells and all cells compare equal. Otherwise
1496                  returns <code class="computeroutput"><span class="keyword">false</span></code>.
1497                </p>
1498              </td>
1499</tr>
1500<tr>
1501<td>
1502                <p>
1503                  <code class="computeroutput"><span class="identifier">s</span><span class="special">.</span><span class="identifier">get_allocator</span><span class="special">()</span></code>
1504                </p>
1505              </td>
1506<td>
1507                <p>
1508                  <code class="computeroutput"><span class="identifier">Alloc</span></code>
1509                </p>
1510              </td>
1511<td>
1512                <p>
1513                  Const member function which returns the allocator used by <code class="computeroutput"><span class="identifier">S</span></code>. Must be omitted if <code class="computeroutput"><span class="identifier">S</span></code> does not use allocators. If
1514                  this member function exists, also a special constructor must exist
1515                  so that <code class="computeroutput"><span class="identifier">S</span><span class="special">(</span><span class="identifier">s</span><span class="special">.</span><span class="identifier">get_allocator</span><span class="special">())</span></code>
1516                  is a valid expression.
1517                </p>
1518              </td>
1519</tr>
1520</tbody>
1521</table></div>
1522</div>
1523<br class="table-break"><h5>
1524<a name="histogram.concepts.Storage.h1"></a>
1525        <span class="phrase"><a name="histogram.concepts.Storage.optional_features"></a></span><a class="link" href="concepts.html#histogram.concepts.Storage.optional_features">Optional
1526        features</a>
1527      </h5>
1528<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1529<li class="listitem">
1530            <code class="computeroutput"><span class="identifier">S</span></code> is a type meeting the
1531            requirements of <span class="bold"><strong>Storage</strong></span>
1532          </li>
1533<li class="listitem">
1534            <code class="computeroutput"><span class="identifier">s</span></code> is a value of types
1535            <code class="computeroutput"><span class="identifier">S</span></code>
1536          </li>
1537<li class="listitem">
1538            <code class="computeroutput"><span class="identifier">x</span></code> is convertible to
1539            <code class="computeroutput"><span class="keyword">double</span></code>
1540          </li>
1541<li class="listitem">
1542            <code class="computeroutput"><span class="identifier">ar</span></code> is a value of an archive
1543            with Boost.Serialization semantics
1544          </li>
1545</ul></div>
1546<div class="table">
1547<a name="histogram.concepts.Storage.valid_expressions0"></a><p class="title"><b>Table 1.8. Valid expressions</b></p>
1548<div class="table-contents"><table class="table" summary="Valid expressions">
1549<colgroup>
1550<col>
1551<col>
1552<col>
1553</colgroup>
1554<thead><tr>
1555<th>
1556                <p>
1557                  Expression
1558                </p>
1559              </th>
1560<th>
1561                <p>
1562                  Returns
1563                </p>
1564              </th>
1565<th>
1566                <p>
1567                  Semantics, Pre/Post-conditions
1568                </p>
1569              </th>
1570</tr></thead>
1571<tbody>
1572<tr>
1573<td>
1574                <p>
1575                  <code class="computeroutput"><span class="identifier">s</span> <span class="special">*=</span>
1576                  <span class="identifier">x</span></code>
1577                </p>
1578              </td>
1579<td>
1580                <p>
1581                  <code class="computeroutput"><span class="identifier">S</span><span class="special">&amp;</span></code>
1582                </p>
1583              </td>
1584<td>
1585                <p>
1586                  Scales all cell values by the factor <code class="computeroutput"><span class="identifier">x</span></code>
1587                  and returns a reference to self.
1588                </p>
1589              </td>
1590</tr>
1591<tr>
1592<td>
1593                <p>
1594                  <code class="computeroutput"><span class="identifier">s</span><span class="special">.</span><span class="identifier">serialize</span><span class="special">(</span><span class="identifier">ar</span><span class="special">,</span>
1595                  <span class="identifier">n</span><span class="special">)</span></code>
1596                </p>
1597              </td>
1598<td>
1599              </td>
1600<td>
1601                <p>
1602                  <code class="computeroutput"><span class="identifier">ar</span></code> is a value of
1603                  an archive with Boost.Serialization semantics and <code class="computeroutput"><span class="identifier">n</span></code> is an unsigned integral value.
1604                  Saves to the archive or loads serialized state from the archive.
1605                  The version number <code class="computeroutput"><span class="identifier">n</span></code>
1606                  is the stored version when the object is loaded or the current
1607                  version when the object is saved.
1608                </p>
1609              </td>
1610</tr>
1611</tbody>
1612</table></div>
1613</div>
1614<br class="table-break"><h5>
1615<a name="histogram.concepts.Storage.h2"></a>
1616        <span class="phrase"><a name="histogram.concepts.Storage.models"></a></span><a class="link" href="concepts.html#histogram.concepts.Storage.models">Models</a>
1617      </h5>
1618<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1619<li class="listitem">
1620            <code class="computeroutput"><a class="link" href="../boost/histogram/unlimited_storage.html" title="Class template unlimited_storage">boost::histogram::unlimited_storage</a></code>
1621          </li>
1622<li class="listitem">
1623            <code class="computeroutput"><a class="link" href="../boost/histogram/storage_adaptor.html" title="Class template storage_adaptor">boost::histogram::storage_adaptor</a></code>
1624          </li>
1625<li class="listitem">
1626            <code class="computeroutput"><a class="link" href="reference.html#boost.histogram.dense_storage">boost::histogram::dense_storage</a></code>
1627          </li>
1628<li class="listitem">
1629            <code class="computeroutput"><a class="link" href="reference.html#boost.histogram.weight_storage">boost::histogram::weight_storage</a></code>
1630          </li>
1631<li class="listitem">
1632            <code class="computeroutput"><a class="link" href="reference.html#boost.histogram.profile_storage">boost::histogram::profile_storage</a></code>
1633          </li>
1634<li class="listitem">
1635            <code class="computeroutput"><a class="link" href="reference.html#boost.histogram.weighted_profile_storage">boost::histogram::weighted_profile_storage</a></code>
1636          </li>
1637</ul></div>
1638</div>
1639<div class="section">
1640<div class="titlepage"><div><div><h3 class="title">
1641<a name="histogram.concepts.Accumulator"></a><a class="link" href="concepts.html#histogram.concepts.Accumulator" title="Accumulator">Accumulator</a>
1642</h3></div></div></div>
1643<p>
1644        An <span class="bold"><strong>Accumulator</strong></span> is a functor which consumes
1645        the argument to update some internal state. Must be <a href="https://en.cppreference.com/w/cpp/named_req/DefaultConstructible" target="_top">DefaultConstructible</a>,
1646        <a href="https://en.cppreference.com/w/cpp/named_req/CopyConstructible" target="_top">CopyConstructible</a>,
1647        and <a href="https://en.cppreference.com/w/cpp/named_req/CopyAssignable" target="_top">CopyAssignable</a>.
1648      </p>
1649<h5>
1650<a name="histogram.concepts.Accumulator.h0"></a>
1651        <span class="phrase"><a name="histogram.concepts.Accumulator.required_features"></a></span><a class="link" href="concepts.html#histogram.concepts.Accumulator.required_features">Required
1652        features</a>
1653      </h5>
1654<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1655<li class="listitem">
1656            <code class="computeroutput"><span class="identifier">A</span></code> is a type meeting the
1657            requirements of <span class="bold"><strong>Accumulator</strong></span>
1658          </li>
1659<li class="listitem">
1660            <code class="computeroutput"><span class="identifier">a</span></code> and <code class="computeroutput"><span class="identifier">b</span></code>
1661            are values of type <code class="computeroutput"><span class="identifier">A</span></code>
1662          </li>
1663<li class="listitem">
1664            <code class="computeroutput"><span class="identifier">ts</span><span class="special">...</span></code>
1665            is a pack of values of arbitrary types
1666          </li>
1667</ul></div>
1668<div class="table">
1669<a name="histogram.concepts.Accumulator.valid_expressions"></a><p class="title"><b>Table 1.9. Valid expressions</b></p>
1670<div class="table-contents"><table class="table" summary="Valid expressions">
1671<colgroup>
1672<col>
1673<col>
1674<col>
1675</colgroup>
1676<thead><tr>
1677<th>
1678                <p>
1679                  Expression
1680                </p>
1681              </th>
1682<th>
1683                <p>
1684                  Returns
1685                </p>
1686              </th>
1687<th>
1688                <p>
1689                  Semantics, Pre/Post-conditions
1690                </p>
1691              </th>
1692</tr></thead>
1693<tbody>
1694<tr>
1695<td>
1696                <p>
1697                  <code class="computeroutput"><span class="identifier">a</span><span class="special">(</span><span class="identifier">ts</span><span class="special">...)</span></code>
1698                  or <code class="computeroutput"><span class="special">++</span><span class="identifier">a</span></code>
1699                </p>
1700              </td>
1701<td>
1702              </td>
1703<td>
1704                <p>
1705                  Either a call operator accepting a fixed number of arguments must
1706                  be implemented, or the pre-increment operator. The call operator
1707                  may not be templated and not overloaded, except to support weights
1708                  as described under optional features.
1709                </p>
1710              </td>
1711</tr>
1712<tr>
1713<td>
1714                <p>
1715                  <code class="computeroutput"><span class="identifier">a</span> <span class="special">==</span>
1716                  <span class="identifier">b</span></code>
1717                </p>
1718              </td>
1719<td>
1720                <p>
1721                  <code class="computeroutput"><span class="keyword">bool</span></code>
1722                </p>
1723              </td>
1724<td>
1725                <p>
1726                  Returns <code class="computeroutput"><span class="keyword">true</span></code> if all
1727                  state variables compare equal. Otherwise returns <code class="computeroutput"><span class="keyword">false</span></code>.
1728                </p>
1729              </td>
1730</tr>
1731<tr>
1732<td>
1733                <p>
1734                  <code class="computeroutput"><span class="identifier">a</span> <span class="special">!=</span>
1735                  <span class="identifier">b</span></code>
1736                </p>
1737              </td>
1738<td>
1739                <p>
1740                  <code class="computeroutput"><span class="keyword">bool</span></code>
1741                </p>
1742              </td>
1743<td>
1744                <p>
1745                  Must be implemented if <code class="computeroutput"><span class="identifier">a</span>
1746                  <span class="special">==</span> <span class="identifier">b</span></code>
1747                  is implemented and must be equal to <code class="computeroutput"><span class="special">!(</span><span class="identifier">a</span> <span class="special">==</span>
1748                  <span class="identifier">b</span><span class="special">)</span></code>.
1749                </p>
1750              </td>
1751</tr>
1752</tbody>
1753</table></div>
1754</div>
1755<br class="table-break"><h5>
1756<a name="histogram.concepts.Accumulator.h1"></a>
1757        <span class="phrase"><a name="histogram.concepts.Accumulator.optional_features"></a></span><a class="link" href="concepts.html#histogram.concepts.Accumulator.optional_features">Optional
1758        features</a>
1759      </h5>
1760<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1761<li class="listitem">
1762            <code class="computeroutput"><span class="identifier">A</span></code> is a type meeting the
1763            requirements of <span class="bold"><strong>Accumulator</strong></span>
1764          </li>
1765<li class="listitem">
1766            <code class="computeroutput"><span class="identifier">a</span></code> and <code class="computeroutput"><span class="identifier">b</span></code>
1767            are values of type <code class="computeroutput"><span class="identifier">A</span></code>
1768          </li>
1769<li class="listitem">
1770            <code class="computeroutput"><span class="identifier">w</span></code> is a value of type
1771            <code class="computeroutput"><a class="link" href="../boost/histogram/weight_type.html" title="Struct template weight_type">boost::histogram::weight_type</a></code>,
1772            where <code class="computeroutput"><span class="identifier">T</span></code> is a number type
1773          </li>
1774<li class="listitem">
1775            <code class="computeroutput"><span class="identifier">ts</span><span class="special">...</span></code>
1776            is a pack of values of arbitrary types
1777          </li>
1778<li class="listitem">
1779            <code class="computeroutput"><span class="identifier">v</span></code> is a number value (integral
1780            or floating point)
1781          </li>
1782</ul></div>
1783<div class="table">
1784<a name="histogram.concepts.Accumulator.valid_expressions0"></a><p class="title"><b>Table 1.10. Valid expressions</b></p>
1785<div class="table-contents"><table class="table" summary="Valid expressions">
1786<colgroup>
1787<col>
1788<col>
1789<col>
1790</colgroup>
1791<thead><tr>
1792<th>
1793                <p>
1794                  Expression
1795                </p>
1796              </th>
1797<th>
1798                <p>
1799                  Return
1800                </p>
1801              </th>
1802<th>
1803                <p>
1804                  Semantics, Pre/Post-conditions
1805                </p>
1806              </th>
1807</tr></thead>
1808<tbody>
1809<tr>
1810<td>
1811                <p>
1812                  <code class="computeroutput"><span class="identifier">a</span> <span class="special">+=</span>
1813                  <span class="identifier">v</span></code> or <code class="computeroutput"><span class="identifier">a</span><span class="special">(</span><span class="identifier">w</span><span class="special">,</span> <span class="identifier">ts</span><span class="special">...)</span></code>
1814                </p>
1815              </td>
1816<td>
1817              </td>
1818<td>
1819                <p>
1820                  Does a weighted fill of the accumulator. Use this to implement
1821                  weight support for an accumulator that is normally filled with
1822                  <code class="computeroutput"><span class="special">++</span><span class="identifier">a</span></code>
1823                  or <code class="computeroutput"><span class="identifier">a</span><span class="special">(</span><span class="identifier">ts</span><span class="special">...)</span></code>,
1824                  respectively. Only the corresponding matching form may be implemented:
1825                  <code class="computeroutput"><span class="identifier">a</span> <span class="special">+=</span>
1826                  <span class="identifier">v</span></code> for <code class="computeroutput"><span class="special">++</span><span class="identifier">a</span></code>, <code class="computeroutput"><span class="identifier">a</span><span class="special">(</span><span class="identifier">w</span><span class="special">,</span> <span class="identifier">ts</span><span class="special">...)</span></code> for <code class="computeroutput"><span class="identifier">a</span><span class="special">(</span><span class="identifier">ts</span><span class="special">...)</span></code>. The implementations may not
1827                  be templated and not overloaded.
1828                </p>
1829              </td>
1830</tr>
1831<tr>
1832<td>
1833                <p>
1834                  <code class="computeroutput"><span class="identifier">a</span> <span class="special">+=</span>
1835                  <span class="identifier">b</span></code>
1836                </p>
1837              </td>
1838<td>
1839                <p>
1840                  <code class="computeroutput"><span class="identifier">A</span><span class="special">&amp;</span></code>
1841                </p>
1842              </td>
1843<td>
1844                <p>
1845                  Adds a second accumulator <code class="computeroutput"><span class="identifier">b</span></code>
1846                  of type <code class="computeroutput"><span class="identifier">A</span></code>. The
1847                  result must be the same as if <code class="computeroutput"><span class="identifier">a</span></code>
1848                  had been filled with all arguments of <code class="computeroutput"><span class="identifier">b</span></code>.
1849                </p>
1850              </td>
1851</tr>
1852<tr>
1853<td>
1854                <p>
1855                  <code class="computeroutput"><span class="identifier">a</span> <span class="special">*=</span>
1856                  <span class="identifier">x</span></code>
1857                </p>
1858              </td>
1859<td>
1860                <p>
1861                  <code class="computeroutput"><span class="identifier">A</span><span class="special">&amp;</span></code>
1862                </p>
1863              </td>
1864<td>
1865                <p>
1866                  Scales the accumulator state by the real value <code class="computeroutput"><span class="identifier">x</span></code>.
1867                  The result must be the same as if <code class="computeroutput"><span class="identifier">a</span></code>
1868                  had been filled with all arguments scaled by <code class="computeroutput"><span class="identifier">x</span></code>.
1869                </p>
1870              </td>
1871</tr>
1872<tr>
1873<td>
1874                <p>
1875                  <code class="computeroutput"><span class="identifier">os</span> <span class="special">&lt;&lt;</span>
1876                  <span class="identifier">a</span></code>
1877                </p>
1878              </td>
1879<td>
1880                <p>
1881                  <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ostream</span><span class="special">&lt;</span><span class="identifier">CharT</span><span class="special">,</span>
1882                  <span class="identifier">Traits</span><span class="special">&gt;&amp;</span></code>
1883                </p>
1884              </td>
1885<td>
1886                <p>
1887                  <code class="computeroutput"><span class="identifier">os</span></code> is a value of
1888                  type <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ostream</span><span class="special">&lt;</span><span class="identifier">CharT</span><span class="special">,</span>
1889                  <span class="identifier">Traits</span><span class="special">&gt;</span></code>.
1890                  Streams a text representation of the axis. May not mutate <code class="computeroutput"><span class="identifier">a</span></code>.
1891                </p>
1892              </td>
1893</tr>
1894<tr>
1895<td>
1896                <p>
1897                  <code class="computeroutput"><span class="identifier">a</span><span class="special">.</span><span class="identifier">serialize</span><span class="special">(</span><span class="identifier">ar</span><span class="special">,</span>
1898                  <span class="identifier">n</span><span class="special">)</span></code>
1899                </p>
1900              </td>
1901<td>
1902              </td>
1903<td>
1904                <p>
1905                  <code class="computeroutput"><span class="identifier">ar</span></code> is a value of
1906                  an archive with Boost.Serialization semantics and <code class="computeroutput"><span class="identifier">n</span></code> is an unsigned integral value.
1907                  Saves to the archive or loads serialized state from the archive.
1908                  The version number <code class="computeroutput"><span class="identifier">n</span></code>
1909                  is the stored version when the object is loaded or the current
1910                  version when the object is saved.
1911                </p>
1912              </td>
1913</tr>
1914</tbody>
1915</table></div>
1916</div>
1917<br class="table-break"><h5>
1918<a name="histogram.concepts.Accumulator.h2"></a>
1919        <span class="phrase"><a name="histogram.concepts.Accumulator.models"></a></span><a class="link" href="concepts.html#histogram.concepts.Accumulator.models">Models</a>
1920      </h5>
1921<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1922<li class="listitem">
1923            <code class="computeroutput"><a class="link" href="../boost/histogram/accumulators/sum.html" title="Class template sum">boost::histogram::accumulators::sum</a></code>
1924          </li>
1925<li class="listitem">
1926            <code class="computeroutput"><a class="link" href="../boost/histogram/accumulators/weighted_sum.html" title="Class template weighted_sum">boost::histogram::accumulators::weighted_sum</a></code>
1927          </li>
1928<li class="listitem">
1929            <code class="computeroutput"><a class="link" href="../boost/histogram/accumulators/mean.html" title="Class template mean">boost::histogram::accumulators::mean</a></code>
1930          </li>
1931<li class="listitem">
1932            <code class="computeroutput"><a class="link" href="../boost/histogram/accumulators/weighted_mean.html" title="Class template weighted_mean">boost::histogram::accumulators::weighted_mean</a></code>
1933          </li>
1934</ul></div>
1935</div>
1936</div>
1937<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
1938<td align="left"></td>
1939<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
1940      Dembinski<p>
1941        Distributed under the Boost Software License, Version 1.0. (See accompanying
1942        file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
1943      </p>
1944</div></td>
1945</tr></table>
1946<hr>
1947<div class="spirit-nav">
1948<a accesskey="p" href="benchmarks.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="reference.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
1949</div>
1950</body>
1951</html>
1952