1<html> 2<head> 3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 4<title>Class template boolean</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="../../../histogram/reference.html#header.boost.histogram.axis.boolean_hpp" title="Header <boost/histogram/axis/boolean.hpp>"> 9<link rel="prev" href="../algorithm/sum.html" title="Function template sum"> 10<link rel="next" href="category.html" title="Class template category"> 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="../algorithm/sum.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.axis.boolean_hpp"><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="category.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a> 24</div> 25<div class="refentry"> 26<a name="boost.histogram.axis.boolean"></a><div class="titlepage"></div> 27<div class="refnamediv"> 28<h2><span class="refentrytitle">Class template boolean</span></h2> 29<p>boost::histogram::axis::boolean — Discrete axis for boolean data. </p> 30</div> 31<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2> 32<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: <<a class="link" href="../../../histogram/reference.html#header.boost.histogram.axis.boolean_hpp" title="Header <boost/histogram/axis/boolean.hpp>">boost/histogram/axis/boolean.hpp</a>> 33 34</span><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> MetaData<span class="special">></span> 35<span class="keyword">class</span> <a class="link" href="boolean.html" title="Class template boolean">boolean</a> <span class="special">:</span> <span class="keyword">public</span> boost::histogram::axis::iterator_mixin< boolean< MetaData > >, 36 <span class="keyword">public</span> metadata_base_t< MetaData > 37<span class="special">{</span> 38<span class="keyword">public</span><span class="special">:</span> 39 <span class="comment">// <a class="link" href="boolean.html#boost.histogram.axis.booleanconstruct-copy-destruct">construct/copy/destruct</a></span> 40 <span class="keyword">explicit</span> <a class="link" href="boolean.html#idm45503930996896-bb"><span class="identifier">boolean</span></a><span class="special">(</span><span class="identifier">metadata_type</span> <span class="special">=</span> <span class="special">{</span><span class="special">}</span><span class="special">)</span><span class="special">;</span> 41 42 <span class="comment">// <a class="link" href="boolean.html#idm45503931012928-bb">public member functions</a></span> 43 <span class="identifier">index_type</span> <a class="link" href="boolean.html#idm45503931012368-bb"><span class="identifier">index</span></a><span class="special">(</span><span class="identifier">value_type</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span> 44 <span class="identifier">value_type</span> <a class="link" href="boolean.html#idm45503931010416-bb"><span class="identifier">value</span></a><span class="special">(</span><span class="identifier">index_type</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span> 45 <span class="identifier">value_type</span> <a class="link" href="boolean.html#idm45503931008464-bb"><span class="identifier">bin</span></a><span class="special">(</span><span class="identifier">index_type</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span> 46 <span class="identifier">index_type</span> <a class="link" href="boolean.html#idm45503931006512-bb"><span class="identifier">size</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span> 47 <span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> M<span class="special">></span> <span class="keyword">bool</span> <a class="link" href="boolean.html#idm45503931005216-bb"><span class="keyword">operator</span><span class="special">==</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="boolean.html" title="Class template boolean">boolean</a><span class="special"><</span> <span class="identifier">M</span> <span class="special">></span> <span class="special">&</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span> 48 <span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> M<span class="special">></span> <span class="keyword">bool</span> <a class="link" href="boolean.html#idm45503931002432-bb"><span class="keyword">operator</span><span class="special">!=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="boolean.html" title="Class template boolean">boolean</a><span class="special"><</span> <span class="identifier">M</span> <span class="special">></span> <span class="special">&</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span> 49 <span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> Archive<span class="special">></span> <span class="keyword">void</span> <a class="link" href="boolean.html#idm45503930999648-bb"><span class="identifier">serialize</span></a><span class="special">(</span><span class="identifier">Archive</span> <span class="special">&</span><span class="special">,</span> <span class="keyword">unsigned</span><span class="special">)</span><span class="special">;</span> 50 51 <span class="comment">// <a class="link" href="boolean.html#idm45503930994368-bb">public static functions</a></span> 52 <span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keyword">bool</span> <a class="link" href="boolean.html#idm45503930993808-bb"><span class="identifier">inclusive</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span> 53 <span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keyword">unsigned</span> <a class="link" href="boolean.html#idm45503930991504-bb"><span class="identifier">options</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span> 54<span class="special">}</span><span class="special">;</span></pre></div> 55<div class="refsect1"> 56<a name="idm45113194613840"></a><h2>Description</h2> 57<p>Binning is a pass-though operation with zero cost, making this the fastest possible axis. The axis has no internal state apart from the optional metadata state. The axis has no under- and overflow bins. It cannot grow and cannot be reduced.</p> 58<p> 59</p> 60<div class="refsect2"> 61<a name="idm45113194612656"></a><h3>Template Parameters</h3> 62<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"> 63<pre class="literallayout"><span class="keyword">typename</span> MetaData</pre> 64<p>type to store meta data. </p> 65</li></ol></div> 66</div> 67<div class="refsect2"> 68<a name="idm45113194609488"></a><h3> 69<a name="boost.histogram.axis.booleanconstruct-copy-destruct"></a><code class="computeroutput">boolean</code> 70 public 71 construct/copy/destruct</h3> 72<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"> 73<pre class="literallayout"><span class="keyword">explicit</span> <a name="idm45503930996896-bb"></a><span class="identifier">boolean</span><span class="special">(</span><span class="identifier">metadata_type</span> meta <span class="special">=</span> <span class="special">{</span><span class="special">}</span><span class="special">)</span><span class="special">;</span></pre>Construct a boolean axis. <p> 74</p> 75<div class="variablelist"><table border="0" class="variablelist compact"> 76<colgroup> 77<col align="left" valign="top"> 78<col> 79</colgroup> 80<tbody><tr> 81<td><p><span class="term">Parameters:</span></p></td> 82<td><div class="variablelist"><table border="0" class="variablelist compact"> 83<colgroup> 84<col align="left" valign="top"> 85<col> 86</colgroup> 87<tbody><tr> 88<td><p><span class="term"><code class="computeroutput">meta</code></span></p></td> 89<td><p>description of the axis. </p></td> 90</tr></tbody> 91</table></div></td> 92</tr></tbody> 93</table></div> 94</li></ol></div> 95</div> 96<div class="refsect2"> 97<a name="idm45113194597040"></a><h3> 98<a name="idm45503931012928-bb"></a><code class="computeroutput">boolean</code> public member functions</h3> 99<div class="orderedlist"><ol class="orderedlist" type="1"> 100<li class="listitem"> 101<pre class="literallayout"><span class="identifier">index_type</span> <a name="idm45503931012368-bb"></a><span class="identifier">index</span><span class="special">(</span><span class="identifier">value_type</span> x<span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Return index for value argument. </li> 102<li class="listitem"> 103<pre class="literallayout"><span class="identifier">value_type</span> <a name="idm45503931010416-bb"></a><span class="identifier">value</span><span class="special">(</span><span class="identifier">index_type</span> i<span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Return value for index argument. </li> 104<li class="listitem"> 105<pre class="literallayout"><span class="identifier">value_type</span> <a name="idm45503931008464-bb"></a><span class="identifier">bin</span><span class="special">(</span><span class="identifier">index_type</span> i<span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Return bin for index argument. </li> 106<li class="listitem"> 107<pre class="literallayout"><span class="identifier">index_type</span> <a name="idm45503931006512-bb"></a><span class="identifier">size</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Returns the number of bins, without over- or underflow. </li> 108<li class="listitem"><pre class="literallayout"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> M<span class="special">></span> <span class="keyword">bool</span> <a name="idm45503931005216-bb"></a><span class="keyword">operator</span><span class="special">==</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="boolean.html" title="Class template boolean">boolean</a><span class="special"><</span> <span class="identifier">M</span> <span class="special">></span> <span class="special">&</span> o<span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li> 109<li class="listitem"><pre class="literallayout"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> M<span class="special">></span> <span class="keyword">bool</span> <a name="idm45503931002432-bb"></a><span class="keyword">operator</span><span class="special">!=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="boolean.html" title="Class template boolean">boolean</a><span class="special"><</span> <span class="identifier">M</span> <span class="special">></span> <span class="special">&</span> o<span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li> 110<li class="listitem"><pre class="literallayout"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> Archive<span class="special">></span> <span class="keyword">void</span> <a name="idm45503930999648-bb"></a><span class="identifier">serialize</span><span class="special">(</span><span class="identifier">Archive</span> <span class="special">&</span> ar<span class="special">,</span> <span class="keyword">unsigned</span><span class="special">)</span><span class="special">;</span></pre></li> 111</ol></div> 112</div> 113<div class="refsect2"> 114<a name="idm45113194534176"></a><h3> 115<a name="idm45503930994368-bb"></a><code class="computeroutput">boolean</code> public static functions</h3> 116<div class="orderedlist"><ol class="orderedlist" type="1"> 117<li class="listitem"> 118<pre class="literallayout"><span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keyword">bool</span> <a name="idm45503930993808-bb"></a><span class="identifier">inclusive</span><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Whether the axis is inclusive (see <code class="computeroutput"><a class="link" href="traits/is_inclusive.html" title="Struct template is_inclusive">axis::traits::is_inclusive</a></code>).</li> 119<li class="listitem"> 120<pre class="literallayout"><span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keyword">unsigned</span> <a name="idm45503930991504-bb"></a><span class="identifier">options</span><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Returns the options. </li> 121</ol></div> 122</div> 123</div> 124</div> 125<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 126<td align="left"></td> 127<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans 128 Dembinski<p> 129 Distributed under the Boost Software License, Version 1.0. (See accompanying 130 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 131 </p> 132</div></td> 133</tr></table> 134<hr> 135<div class="spirit-nav"> 136<a accesskey="p" href="../algorithm/sum.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.axis.boolean_hpp"><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="category.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a> 137</div> 138</body> 139</html> 140