[DEV] add v1.76.0

This commit is contained in:
2021-10-05 21:37:46 +02:00
parent a97e9ae7d4
commit d0115b733d
45133 changed files with 4744437 additions and 1026325 deletions

View File

@@ -0,0 +1,82 @@
# Copyright Peter Dimov, Hans Dembinski 2018-2019
# Distributed under the Boost Software License, Version 1.0.
# See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt
# We support CMake 3.5, but prefer 3.16 policies and behavior
cmake_minimum_required(VERSION 3.5...3.16)
project(boost_histogram VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)
add_library(boost_histogram INTERFACE)
add_library(Boost::histogram ALIAS boost_histogram)
target_include_directories(boost_histogram INTERFACE include)
target_compile_features(boost_histogram INTERFACE cxx_std_14)
target_link_libraries(boost_histogram
INTERFACE
Boost::config
Boost::core
Boost::mp11
Boost::throw_exception
Boost::variant2
)
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
# Standalone build, fetch dependencies
# Fetch support files
message(STATUS "Fetching BoostFetch.cmake")
file(DOWNLOAD
"https://raw.githubusercontent.com/boostorg/cmake/develop/include/BoostFetch.cmake"
"${CMAKE_BINARY_DIR}/BoostFetch.cmake"
)
include("${CMAKE_BINARY_DIR}/BoostFetch.cmake")
boost_fetch(boostorg/cmake TAG develop NO_ADD_SUBDIR)
FetchContent_GetProperties(boostorg_cmake)
list(APPEND CMAKE_MODULE_PATH ${boostorg_cmake_SOURCE_DIR}/include)
# Enable testing
include(CTest)
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $<CONFIG>)
if(BUILD_TESTING)
set(BUILD_TESTING OFF) # do not build tests of dependencies
boost_fetch(boostorg/assert TAG develop EXCLUDE_FROM_ALL) # needed by core
boost_fetch(boostorg/config TAG develop EXCLUDE_FROM_ALL)
boost_fetch(boostorg/core TAG develop EXCLUDE_FROM_ALL)
boost_fetch(boostorg/mp11 TAG develop EXCLUDE_FROM_ALL)
boost_fetch(boostorg/throw_exception TAG develop EXCLUDE_FROM_ALL)
boost_fetch(boostorg/variant2 TAG develop EXCLUDE_FROM_ALL)
## No cmake support yet
# boost_fetch(boostorg/accumulators TAG develop)
# boost_fetch(boostorg/range TAG develop)
# boost_fetch(boostorg/serialization TAG develop)
# boost_fetch(boostorg/units TAG develop)
set(BUILD_TESTING ON)
endif()
endif()
if (BUILD_TESTING)
add_subdirectory(test)
# do not pollute the superproject with the benchmarks
if(NOT BOOST_SUPERPROJECT_VERSION)
add_subdirectory(benchmark)
endif()
endif()

View File

@@ -0,0 +1,73 @@
# Contributing to Boost.Histogram
## Star the project
If you like Boost.Histogram, please star the project on Github! We want Boost.Histogram to be the best histogram library out there. If you give it a star, it becomes more visible and will gain more users. More users mean more user feedback to make the library even better.
## Support
Feel free to ask questions on https://gitter.im/boostorg/histogram.
## Reporting Issues
We value your feedback about issues you encounter. The more information you provide the easier it is for developers to resolve the problem.
Issues should be reported to the [issue tracker](
https://github.com/boostorg/histogram/issues?state=open).
Issues can also be used to submit feature requests.
Don't be shy: if you are friendly, we are friendly!
## Submitting Pull Requests
Fork the main repository. Base your changes on the `develop` branch. Make a new branch for any feature or bug-fix in your fork. Start developing. You can start a pull request when you feel the change is ready for review.
Please rebase your branch to the original `develop` branch before submitting (which may have diverged from your fork in the meantime).
For general advice on how to set up the Boost project for development, see the Getting Started section on
https://github.com/boostorg/wiki/wiki.
To build the documentation, you need to install a few extra things, see
https://www.boost.org/doc/libs/1_74_0/doc/html/quickbook/install.html.
## Running Tests
### With b2
Boost comes with a build system called `b2`, which is the most efficient way to run the develop-test cycle. It takes a few extra steps and some reading to set up, but the payoff is worth it. If you followed the advice from the previous section, you should be all set up to run the tests from the Boost Histogram project folder with `b2 cxxstd=latest warnings-as-errors=on test`. You can also test the examples by executing `b2 cxxstd=latest examples`. To make the tests complete faster, you can use the option `-j4` (or another number) to build in parallel.
### With cmake
Alternatively, you can build and test Boost Histogram with `cmake`. This does not require setting up all of Boost, just a checkout of Boost Histogram. It requires very little setup, but it is not as efficient for development as using `b2`. Anyway, to use `cmake`, you do in the project folder
```sh
mkdir build
cd build
cmake ..
ctest -C Debug --output-on-failure
```
### Reporting failures
Please report any tests failures to the issue tracker along with the test output and information on your system:
* platform (Linux, Windows, OSX, ...)
* compiler and version
### Test coverage
Boost.Histogram maintains 100% line coverage. Coverage is automatically checked by CI. To generate a report locally, you need to build the code with gcc-8 and coverage instrumentation enabled, do `b2 toolset=gcc-8 cxxstd=latest coverage=on test`. To generate the coverage report, run `tools/cov.sh` from the project root directory of Boost.Histogram. This will generate a new folder `coverage-report` with a HTML report. Open `coverage-report/index.html` in a browser.
Notes: Generating coverage data is very fickle. You need to use gcc-5 or gcc-8 and a matching version of gcov, other gcc versions (6, 7, 9) are known to be broken or are not supported by lcov, which is used to process the raw coverage data. Generating coverage data with clang and llvm-cov is not supported by lcov. The best results are obtained with gcc-5. gcc-8 is known to report lines as missed which are impossible to miss.
## Coding Style
Follow the [Boost Library Requirements and Guidelines](https://www.boost.org/development/requirements.html) and the established style in Boost.Histogram.
### Code formatting
Using `clang-format -style=file` is recommended, which should pick up the `.clang-format` file of the project. All names are written with small letters and `_`. Template parameters are capitalized and in camel-case.
### Documentation
Doxygen comments should be added for all user-facing functions and methods. Implementation details are not documented (everything in the `boost::histogram::detail` namespace is an implementation detail that can change at any time).

37
libs/histogram/Jamfile Normal file
View File

@@ -0,0 +1,37 @@
# Copyright Mateusz Loskot 2018 <mateusz@loskot.net>
# Copyright Klemens David Morgenstern, Hans P. Dembinski 2016-2017
#
# Use, modification and distribution is subject to the Boost Software License,
# Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
# Special builds for Boost Histogram:
#
# Generate coverage data: b2 cxxstd=latest coverage=on test//all
# Test without exceptions and rtti: b2 cxxstd=latest exception-handling=off rtti=off test//minimal
# Test with sanitizers: b2 toolset=clang cxxstd=latest histogram_ubasan test
import common ;
project
: requirements
<implicit-dependency>/boost//headers
<include>$(BOOST_ROOT)
<toolset>clang:<cxxflags>"-pedantic -Wextra -Wsign-compare -Wstrict-aliasing -fstrict-aliasing -Wvexing-parse"
<toolset>gcc:<cxxflags>"-pedantic -Wextra -Wsign-compare -Wstrict-aliasing -fstrict-aliasing"
<toolset>msvc:<cxxflags>"/bigobj"
<toolset>intel-win:<cxxflags>"/bigobj"
: default-build
<warnings>all
;
path-constant THIS_PATH : . ;
# only works with clang because of -fsanitize-blacklist
variant histogram_ubasan : debug :
<cxxflags>"-fno-omit-frame-pointer -O0 -fno-inline -fsanitize=address,leak,undefined -fno-sanitize-recover=all -fsanitize-blacklist=$(THIS_PATH)/tools/blacklist.supp"
<linkflags>"-fsanitize=address,leak,undefined"
;
build-project test ;
build-project examples ;

23
libs/histogram/LICENSE Normal file
View File

@@ -0,0 +1,23 @@
Boost Software License - Version 1.0 - August 17th, 2003
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:
The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

115
libs/histogram/README.md Normal file
View File

@@ -0,0 +1,115 @@
<!--
Copyright Hans Dembinski 2016 - 2019.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
https://www.boost.org/LICENSE_1_0.txt)
-->
![](doc/logo/color.svg)
**Fast multi-dimensional histogram with convenient interface for C++14**
Coded with ❤. Powered by the [Boost community](https://www.boost.org) and the [Scikit-HEP Project](http://scikit-hep.org). Licensed under the [Boost Software License](http://www.boost.org/LICENSE_1_0.txt).
**Supported compiler versions** gcc >= 5.5, clang >= 3.8, msvc >= 14.1
**Supported C++ versions** 14, 17, 20
Branch | Linux, OSX, Windows | Coverage
------- | ---------------------- | --------
develop | ![Fast](https://github.com/boostorg/histogram/workflows/Fast/badge.svg?branch=develop) | [![Coveralls](https://coveralls.io/repos/github/boostorg/histogram/badge.svg?branch=develop)](https://coveralls.io/github/boostorg/histogram?branch=develop)
master | ![Fast](https://github.com/boostorg/histogram/workflows/Fast/badge.svg?branch=master) | [![Coveralls](https://coveralls.io/repos/github/boostorg/histogram/badge.svg?branch=master)](https://coveralls.io/github/boostorg/histogram?branch=master)
Boost.Histogram is a very fast state-of-the-art multi-dimensional generalised [histogram](https://en.wikipedia.org/wiki/Histogram) class for the beginner and expert alike.
* Header-only
* Easy to use, easy to customise
* Just count or use arbitrary accumulators in each cell to compute means, minimum, maximum, ...
* Supports multi-threading and restricted environments (no heap allocation, exceptions or RTTI)
* Has [Python bindings](https://github.com/scikit-hep/boost-histogram)
Check out the [full documentation](https://www.boost.org/doc/libs/develop/libs/histogram/doc/html/index.html).
💡 Boost.Histogram is a mature library with 100 % of code lines covered by unit tests, benchmarked for performance, and has extensive documentation. If you still find some issue or find the documentation lacking, tell us about it by [submitting an issue](https://github.com/boostorg/histogram/issues). Chat with us on the [Boost channel on Slack](https://cpplang.slack.com) and [Gitter](https://gitter.im/boostorg/histogram).
## Code examples
The following stripped-down example was taken from the [Getting started](https://www.boost.org/doc/libs/develop/libs/histogram/doc/html/histogram/getting_started.html) section in the documentation. Have a look into the docs to see the full version with comments and more examples.
Example: Make and fill a 1d-histogram ([try it live on Wandbox](https://wandbox.org/permlink/NSM2ZiDyntUi6RDC)). The core of this example [compiles into 53 lines of assembly code](https://godbolt.org/z/632yzE).
```cpp
#include <boost/histogram.hpp>
#include <boost/format.hpp> // used here for printing
#include <iostream>
int main() {
using namespace boost::histogram;
// make 1d histogram with 4 regular bins from 0 to 2
auto h = make_histogram( axis::regular<>(4, 0.0, 2.0) );
// push some values into the histogram
for (auto&& value : { 0.4, 1.1, 0.3, 1.7, 10. })
h(value);
// iterate over bins
for (auto&& x : indexed(h)) {
std::cout << boost::format("bin %i [ %.1f, %.1f ): %i\n")
% x.index() % x.bin().lower() % x.bin().upper() % *x;
}
std::cout << std::flush;
/* program output:
bin 0 [ 0.0, 0.5 ): 2
bin 1 [ 0.5, 1.0 ): 0
bin 2 [ 1.0, 1.5 ): 1
bin 3 [ 1.5, 2.0 ): 1
*/
}
```
## Features
* Extremely customisable multi-dimensional histogram
* Simple, convenient, STL and Boost-compatible interface
* Counters with high dynamic range, cannot overflow or be capped [[1]](#note1)
* Better performance than other libraries (see benchmarks for details)
* Efficient use of memory [[1]](#note1)
* Hand-crafted C++17 deduction guides for axes and histogram types
* Support for custom axis types: define how input values should map to indices
* Support for under-/overflow bins (can be disabled individually to reduce memory consumption)
* Support for axes that grow automatically with input values [[2]](#note2)
* Support for weighted increments
* Support for profiles and more generally, user-defined accumulators in cells [[3]](#note3)
* Support for completely stack-based histograms
* Support for compilation without exceptions or RTTI [[4]](#note4)
* Support for adding, subtracting, multiplying, dividing, and scaling histograms
* Support for custom allocators
* Support for programming with units [[5]](#note5)
* Optional serialization based on [Boost.Serialization](https://www.boost.org/doc/libs/release/libs/serialization/)
<b id="note1">Note 1</b> In the standard configuration, if you don't use weighted increments. The counter capacity is increased dynamically as the cell counts grow. When even the largest plain integral type would overflow, the storage switches to a multiprecision integer similar to those in [Boost.Multiprecision](https://www.boost.org/doc/libs/release/libs/multiprecision/), which is only limited by available memory.
<b id="note2">Note 2</b> An axis can be configured to grow when a value is encountered that is outside of its range. It then grows new bins towards this value so that the value ends up in the new highest or lowest bin.
<b id="note3">Note 3</b> The histogram can be configured to hold an arbitrary accumulator in each cell instead of a simple counter. Extra values can be passed to the histogram, for example, to compute the mean and variance of values which fall into the same cell. This feature can be used to calculate variance estimates for each cell, which are useful when you need to fit a statistical model to the cell values.
<b id="note4">Note 4</b> The library throws exceptions when exceptions are enabled. When exceptions are disabled, a user-defined exception handler is called instead upon a throw and the program terminates, see [boost::throw_exception](https://www.boost.org/doc/libs/master/libs/exception/doc/throw_exception.html) for details. Disabling exceptions improves performance by 10 % to 20 % in benchmarks. The library does not use RTTI (only CTTI) so disabling it has no effect.
<b id="note5">Note 5</b> Builtin axis types can be configured to only accept dimensional quantities, like those from [Boost.Units](https://www.boost.org/doc/libs/release/libs/units/). This means you get a useful error if you accidentally try to fill a length where the histogram axis expects a time, for example.
## Benchmarks
Boost.Histogram is more flexible and faster than other C/C++ libraries. It was compared to:
- [GNU Scientific Library](https://www.gnu.org/software/gsl)
- [ROOT framework from CERN](https://root.cern.ch)
Details on the benchmark are given in the [documentation](https://www.boost.org/doc/libs/develop/libs/histogram/doc/html/histogram/benchmarks.html).
## What users say
**John Buonagurio** | Manager at [**E<sup><i>x</i></sup>ponent<sup>&reg;</sup>**](https://www.exponent.com)
*"I just wanted to say 'thanks' for your awesome Histogram library. I'm working on a software package for processing meteorology data and I'm using it to generate wind roses with the help of Qt and QwtPolar. Looks like you thought of just about everything here &ndash; the circular axis type was practically designed for this application, everything 'just worked'."*

View File

@@ -0,0 +1,61 @@
# Copyright 2019 Hans Dembinski
# Distributed under the Boost Software License, Version 1.0.
# See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt
include(BoostFetch)
# setup for google benchmark
set(CMAKE_BUILD_TYPE Release) # ok, only set in local scope
option(BENCHMARK_ENABLE_TESTING "" OFF)
boost_fetch(google/benchmark)
function(add_benchmark NAME)
cmake_parse_arguments(PARSE_ARGV 1 _ "" "" ";INCLUDE_DIRECTORIES;LINK_LIBRARIES;COMPILE_OPTIONS")
if(__UNPARSED_ARGUMENTS)
message(AUTHOR_WARNING "add_benchmark: extra arguments ignored: ${__UNPARSED_ARGUMENTS}")
endif()
set(SOURCE ${NAME})
set(NAME benchmark_${NAME})
if(DEFINED BUILD_TESTING AND NOT BUILD_TESTING)
return()
endif()
add_executable(${NAME} ${SOURCE})
target_include_directories(${NAME} PRIVATE ${__INCLUDE_DIRECTORIES})
target_link_libraries(${NAME} PRIVATE Boost::histogram benchmark_main ${__LINK_LIBRARIES})
target_compile_options(${NAME} PRIVATE -DNDEBUG -O3 -march=native -funsafe-math-optimizations ${__COMPILE_OPTIONS})
endfunction()
add_benchmark(axis_size)
add_benchmark(axis_index)
add_benchmark(histogram_filling)
add_benchmark(histogram_iteration)
find_package(Threads)
if (Threads_FOUND)
add_benchmark(histogram_parallel_filling)
endif()
find_package(GSL)
if (GSL_FOUND)
add_benchmark(
histogram_filling_gsl
INCLUDE_DIRECTORIES ${GSL_INCLUDE_DIRS}
LINK_LIBRARIES ${GSL_LIBRARIES})
endif()
find_package(ROOT QUIET)
if (ROOT_FOUND)
add_benchmark(
histogram_filling_root
INCLUDE_DIRECTORIES ${ROOT_INCLUDE_DIRS}
LINK_LIBRARIES ${ROOT_LIBRARIES}
COMPILE_OPTIONS -frtti -fexceptions
)
# add ROOT linker flags? ${ROOT_EXE_LINKER_FLAGS}
endif()

View File

@@ -0,0 +1,77 @@
// Copyright 2018 Hans Dembinski
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt
// or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <benchmark/benchmark.h>
#include <boost/histogram/axis.hpp>
#include <numeric>
#include "../test/throw_exception.hpp"
#include "generator.hpp"
#include <cassert>
struct assert_check {
assert_check() {
assert(false); // don't run with asserts enabled
}
} _;
using namespace boost::histogram;
template <class Distribution>
static void regular(benchmark::State& state) {
auto a = axis::regular<>(100, 0.0, 1.0);
generator<Distribution> gen;
for (auto _ : state) benchmark::DoNotOptimize(a.index(gen()));
}
template <class Distribution>
static void circular(benchmark::State& state) {
auto a = axis::circular<>(100, 0.0, 1.0);
generator<Distribution> gen;
for (auto _ : state) benchmark::DoNotOptimize(a.index(gen()));
}
template <class T, class Distribution>
static void integer(benchmark::State& state) {
auto a = axis::integer<T>(0, 1);
generator<Distribution> gen;
for (auto _ : state) benchmark::DoNotOptimize(a.index(gen()));
}
template <class Distribution>
static void variable(benchmark::State& state) {
std::vector<double> v;
for (double x = 0; x <= state.range(0); ++x) { v.push_back(x / state.range(0)); }
auto a = axis::variable<>(v);
generator<Distribution> gen;
for (auto _ : state) benchmark::DoNotOptimize(a.index(gen()));
}
static void category(benchmark::State& state) {
std::vector<int> v(state.range(0));
std::iota(v.begin(), v.end(), 0);
auto a = axis::category<int>(v);
generator<uniform_int> gen(static_cast<int>(state.range(0)));
for (auto _ : state) benchmark::DoNotOptimize(a.index(gen()));
}
static void boolean(benchmark::State& state) {
auto a = axis::boolean<>();
generator<uniform_int> gen(1);
for (auto _ : state) benchmark::DoNotOptimize(a.index(static_cast<bool>(gen())));
}
BENCHMARK_TEMPLATE(regular, uniform);
BENCHMARK_TEMPLATE(regular, normal);
BENCHMARK_TEMPLATE(circular, uniform);
BENCHMARK_TEMPLATE(circular, normal);
BENCHMARK_TEMPLATE(integer, int, uniform);
BENCHMARK_TEMPLATE(integer, int, normal);
BENCHMARK_TEMPLATE(integer, double, uniform);
BENCHMARK_TEMPLATE(integer, double, normal);
BENCHMARK_TEMPLATE(variable, uniform)->RangeMultiplier(10)->Range(10, 10000);
BENCHMARK_TEMPLATE(variable, normal)->RangeMultiplier(10)->Range(10, 10000);
BENCHMARK(category)->RangeMultiplier(10)->Range(10, 10000);
BENCHMARK(boolean);

View File

@@ -0,0 +1,38 @@
// Copyright 2018 Hans Dembinski
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt
// or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <boost/histogram/axis.hpp>
#include <iostream>
#define SHOW_SIZE(x) std::cout << #x << " " << sizeof(x) << std::endl
int main() {
using namespace boost::histogram;
using regular = axis::regular<>;
using regular_float = axis::regular<float>;
using regular_pow = axis::regular<double, axis::transform::pow>;
using regular_no_metadata = axis::regular<double, axis::transform::id, axis::null_type>;
using circular = axis::circular<>;
using variable = axis::variable<>;
using integer = axis::integer<>;
using category = axis::category<>;
using boolean = axis::boolean<>;
using boolean_no_metadata = axis::boolean<axis::null_type>;
using variant = axis::variant<regular, circular, variable, integer, category, boolean>;
SHOW_SIZE(regular);
SHOW_SIZE(regular_float);
SHOW_SIZE(regular_pow);
SHOW_SIZE(regular_no_metadata);
SHOW_SIZE(circular);
SHOW_SIZE(variable);
SHOW_SIZE(integer);
SHOW_SIZE(category);
SHOW_SIZE(boolean);
SHOW_SIZE(boolean_no_metadata);
SHOW_SIZE(variant);
}

View File

@@ -0,0 +1,7 @@
#!/bin/bash
# Copyright Hans Dembinski 2019
# Distributed under the Boost Software License, Version 1.0.
# See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt
for cpu in /sys/devices/system/cpu/cpu? ; do echo performance > $cpu/cpufreq/scaling_governor; done

View File

@@ -0,0 +1,7 @@
#!/bin/bash
# Copyright Hans Dembinski 2019
# Distributed under the Boost Software License, Version 1.0.
# See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt
for cpu in /sys/devices/system/cpu/cpu? ; do echo powersave > $cpu/cpufreq/scaling_governor; done

View File

@@ -0,0 +1,50 @@
// Copyright 2019 Hans Dembinski
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt
// or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <array>
#include <random>
using uniform = std::uniform_real_distribution<>;
using uniform_int = std::uniform_int_distribution<>;
using normal = std::normal_distribution<>;
template <class Distribution, class... Ts>
Distribution init(Ts...);
template <>
uniform init<uniform>() {
return uniform{0.0, 1.0};
}
template <>
normal init<normal>() {
return normal{0.5, 0.3};
}
template <>
uniform_int init<uniform_int, int>(int n) {
return uniform_int{0, n};
}
template <class Distribution, std::size_t N = 1 << 15>
struct generator : std::array<double, N> {
using base_t = std::array<double, N>;
template <class... Ts>
generator(Ts... ts) {
std::default_random_engine rng(1);
auto dis = init<Distribution>(ts...);
std::generate(base_t::begin(), base_t::end(), [&] { return dis(rng); });
}
const double& operator()() {
++ptr_;
if (ptr_ == base_t::data() + N) ptr_ = base_t::data();
return *ptr_;
}
const double* ptr_ = base_t::data() - 1;
};

View File

@@ -0,0 +1,176 @@
// Copyright 2015-2019 Hans Dembinski
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt
// or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <benchmark/benchmark.h>
#include <boost/histogram/axis/regular.hpp>
#include <boost/histogram/storage_adaptor.hpp>
#include <memory>
#include "../test/throw_exception.hpp"
#include "../test/utility_histogram.hpp"
#include "generator.hpp"
#include <cassert>
struct assert_check {
assert_check() {
assert(false); // don't run with asserts enabled
}
} _;
using SStore = std::vector<double>;
// make benchmark compatible with older versions of the library
#if __has_include(<boost/histogram/unlimited_storage.hpp>)
#include <boost/histogram/unlimited_storage.hpp>
using DStore = boost::histogram::unlimited_storage<>;
#else
#include <boost/histogram/adaptive_storage.hpp>
using DStore = boost::histogram::adaptive_storage<>;
#endif
using namespace boost::histogram;
using reg = axis::regular<>;
template <class Distribution, class Tag, class Storage = SStore>
static void fill_1d(benchmark::State& state) {
auto h = make_s(Tag(), Storage(), reg(100, 0, 1));
auto gen = generator<Distribution>();
for (auto _ : state) benchmark::DoNotOptimize(h(gen()));
state.SetItemsProcessed(state.iterations());
}
template <class Distribution, class Tag, class Storage = SStore>
static void fill_n_1d(benchmark::State& state) {
auto h = make_s(Tag(), Storage(), reg(100, 0, 1));
auto gen = generator<Distribution>();
for (auto _ : state) h.fill(gen);
state.SetItemsProcessed(state.iterations() * gen.size());
}
template <class Distribution, class Tag, class Storage = SStore>
static void fill_2d(benchmark::State& state) {
auto h = make_s(Tag(), Storage(), reg(100, 0, 1), reg(100, 0, 1));
auto gen = generator<Distribution>();
for (auto _ : state) benchmark::DoNotOptimize(h(gen(), gen()));
state.SetItemsProcessed(state.iterations() * 2);
}
template <class Distribution, class Tag, class Storage = SStore>
static void fill_n_2d(benchmark::State& state) {
auto h = make_s(Tag(), Storage(), reg(100, 0, 1), reg(100, 0, 1));
auto gen = generator<Distribution>();
auto v = {gen, gen};
for (auto _ : state) h.fill(v);
state.SetItemsProcessed(state.iterations() * 2 * gen.size());
}
template <class Distribution, class Tag, class Storage = SStore>
static void fill_3d(benchmark::State& state) {
auto h = make_s(Tag(), Storage(), reg(100, 0, 1), reg(100, 0, 1), reg(100, 0, 1));
auto gen = generator<Distribution>();
for (auto _ : state) benchmark::DoNotOptimize(h(gen(), gen(), gen()));
state.SetItemsProcessed(state.iterations() * 3);
}
template <class Distribution, class Tag, class Storage = SStore>
static void fill_n_3d(benchmark::State& state) {
auto h = make_s(Tag(), Storage(), reg(100, 0, 1), reg(100, 0, 1), reg(100, 0, 1));
auto gen = generator<Distribution>();
auto v = {gen, gen, gen};
for (auto _ : state) h.fill(v);
state.SetItemsProcessed(state.iterations() * 3 * gen.size());
}
template <class Distribution, class Tag, class Storage = SStore>
static void fill_6d(benchmark::State& state) {
auto h = make_s(Tag(), Storage(), reg(10, 0, 1), reg(10, 0, 1), reg(10, 0, 1),
reg(10, 0, 1), reg(10, 0, 1), reg(10, 0, 1));
auto gen = generator<Distribution>();
for (auto _ : state)
benchmark::DoNotOptimize(h(gen(), gen(), gen(), gen(), gen(), gen()));
state.SetItemsProcessed(state.iterations() * 6);
}
template <class Distribution, class Tag, class Storage = SStore>
static void fill_n_6d(benchmark::State& state) {
auto h = make_s(Tag(), Storage(), reg(10, 0, 1), reg(10, 0, 1), reg(10, 0, 1),
reg(10, 0, 1), reg(10, 0, 1), reg(10, 0, 1));
auto gen = generator<Distribution>();
auto v = {gen, gen, gen, gen, gen, gen};
for (auto _ : state) h.fill(v);
state.SetItemsProcessed(state.iterations() * 6 * gen.size());
}
BENCHMARK_TEMPLATE(fill_1d, uniform, static_tag);
// BENCHMARK_TEMPLATE(fill_1d, uniform, static_tag, DStore);
BENCHMARK_TEMPLATE(fill_1d, normal, static_tag);
// BENCHMARK_TEMPLATE(fill_1d, normal, static_tag, DStore);
BENCHMARK_TEMPLATE(fill_1d, uniform, dynamic_tag);
// BENCHMARK_TEMPLATE(fill_1d, uniform, dynamic_tag, DStore);
BENCHMARK_TEMPLATE(fill_1d, normal, dynamic_tag);
// BENCHMARK_TEMPLATE(fill_1d, normal, dynamic_tag, DStore);
BENCHMARK_TEMPLATE(fill_n_1d, uniform, static_tag);
// BENCHMARK_TEMPLATE(fill_n_1d, uniform, static_tag, DStore);
BENCHMARK_TEMPLATE(fill_n_1d, normal, static_tag);
// BENCHMARK_TEMPLATE(fill_n_1d, normal, static_tag, DStore);
BENCHMARK_TEMPLATE(fill_n_1d, uniform, dynamic_tag);
// BENCHMARK_TEMPLATE(fill_n_1d, uniform, dynamic_tag, DStore);
BENCHMARK_TEMPLATE(fill_n_1d, normal, dynamic_tag);
// BENCHMARK_TEMPLATE(fill_n_1d, normal, dynamic_tag, DStore);
BENCHMARK_TEMPLATE(fill_2d, uniform, static_tag);
// BENCHMARK_TEMPLATE(fill_2d, uniform, static_tag, DStore);
BENCHMARK_TEMPLATE(fill_2d, normal, static_tag);
// BENCHMARK_TEMPLATE(fill_2d, normal, static_tag, DStore);
BENCHMARK_TEMPLATE(fill_2d, uniform, dynamic_tag);
// BENCHMARK_TEMPLATE(fill_2d, uniform, dynamic_tag, DStore);
BENCHMARK_TEMPLATE(fill_2d, normal, dynamic_tag);
// BENCHMARK_TEMPLATE(fill_2d, normal, dynamic_tag, DStore);
BENCHMARK_TEMPLATE(fill_n_2d, uniform, static_tag);
// BENCHMARK_TEMPLATE(fill_n_2d, uniform, static_tag, DStore);
BENCHMARK_TEMPLATE(fill_n_2d, normal, static_tag);
// BENCHMARK_TEMPLATE(fill_n_2d, normal, static_tag, DStore);
BENCHMARK_TEMPLATE(fill_n_2d, uniform, dynamic_tag);
// BENCHMARK_TEMPLATE(fill_n_2d, uniform, dynamic_tag, DStore);
BENCHMARK_TEMPLATE(fill_n_2d, normal, dynamic_tag);
// BENCHMARK_TEMPLATE(fill_n_2d, normal, dynamic_tag, DStore);
BENCHMARK_TEMPLATE(fill_3d, uniform, static_tag);
// BENCHMARK_TEMPLATE(fill_3d, uniform, static_tag, DStore);
BENCHMARK_TEMPLATE(fill_3d, normal, static_tag);
// BENCHMARK_TEMPLATE(fill_3d, normal, static_tag, DStore);
BENCHMARK_TEMPLATE(fill_3d, uniform, dynamic_tag);
// BENCHMARK_TEMPLATE(fill_3d, uniform, dynamic_tag, DStore);
BENCHMARK_TEMPLATE(fill_3d, normal, dynamic_tag);
// BENCHMARK_TEMPLATE(fill_3d, normal, dynamic_tag, DStore);
BENCHMARK_TEMPLATE(fill_n_3d, uniform, static_tag);
// BENCHMARK_TEMPLATE(fill_n_3d, uniform, static_tag, DStore);
BENCHMARK_TEMPLATE(fill_n_3d, normal, static_tag);
// BENCHMARK_TEMPLATE(fill_n_3d, normal, static_tag, DStore);
BENCHMARK_TEMPLATE(fill_n_3d, uniform, dynamic_tag);
// BENCHMARK_TEMPLATE(fill_n_3d, uniform, dynamic_tag, DStore);
BENCHMARK_TEMPLATE(fill_n_3d, normal, dynamic_tag);
// BENCHMARK_TEMPLATE(fill_n_3d, normal, dynamic_tag, DStore);
BENCHMARK_TEMPLATE(fill_6d, uniform, static_tag);
// BENCHMARK_TEMPLATE(fill_6d, uniform, static_tag, DStore);
BENCHMARK_TEMPLATE(fill_6d, normal, static_tag);
// BENCHMARK_TEMPLATE(fill_6d, normal, static_tag, DStore);
BENCHMARK_TEMPLATE(fill_6d, uniform, dynamic_tag);
// BENCHMARK_TEMPLATE(fill_6d, uniform, dynamic_tag, DStore);
BENCHMARK_TEMPLATE(fill_6d, normal, dynamic_tag);
// BENCHMARK_TEMPLATE(fill_6d, normal, dynamic_tag, DStore);
BENCHMARK_TEMPLATE(fill_n_6d, uniform, static_tag);
// BENCHMARK_TEMPLATE(fill_n_6d, uniform, static_tag, DStore);
BENCHMARK_TEMPLATE(fill_n_6d, normal, static_tag);
// BENCHMARK_TEMPLATE(fill_n_6d, normal, static_tag, DStore);
BENCHMARK_TEMPLATE(fill_n_6d, uniform, dynamic_tag);
// BENCHMARK_TEMPLATE(fill_n_6d, uniform, dynamic_tag, DStore);
BENCHMARK_TEMPLATE(fill_n_6d, normal, dynamic_tag);
// BENCHMARK_TEMPLATE(fill_n_6d, normal, dynamic_tag, DStore);

View File

@@ -0,0 +1,45 @@
// Copyright 2015-2019 Hans Dembinski
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt
// or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <benchmark/benchmark.h>
#include <gsl/gsl_histogram.h>
#include <gsl/gsl_histogram2d.h>
#include "../test/throw_exception.hpp"
#include "generator.hpp"
#include <cassert>
struct assert_check {
assert_check() {
assert(false); // don't run with asserts enabled
}
} _;
template <class Distribution>
static void fill_1d(benchmark::State& state) {
gsl_histogram* h = gsl_histogram_alloc(100);
gsl_histogram_set_ranges_uniform(h, 0, 1);
generator<Distribution> gen;
for (auto _ : state) benchmark::DoNotOptimize(gsl_histogram_increment(h, gen()));
gsl_histogram_free(h);
state.SetItemsProcessed(state.iterations());
}
template <class Distribution>
static void fill_2d(benchmark::State& state) {
gsl_histogram2d* h = gsl_histogram2d_alloc(100, 100);
gsl_histogram2d_set_ranges_uniform(h, 0, 1, 0, 1);
generator<Distribution> gen;
for (auto _ : state)
benchmark::DoNotOptimize(gsl_histogram2d_increment(h, gen(), gen()));
gsl_histogram2d_free(h);
state.SetItemsProcessed(state.iterations() * 2);
}
BENCHMARK_TEMPLATE(fill_1d, uniform);
BENCHMARK_TEMPLATE(fill_2d, uniform);
BENCHMARK_TEMPLATE(fill_1d, normal);
BENCHMARK_TEMPLATE(fill_2d, normal);

View File

@@ -0,0 +1,14 @@
from __future__ import print_function
import numpy as np
# pip install fast-histogram
from fast_histogram import histogram1d
import timeit
x = np.random.rand(1 << 20)
nrepeat = 10
print(timeit.timeit("np.histogram(x, bins=100, range=(0, 1))",
"from __main__ import x, np", number=nrepeat) / (nrepeat * len(x)) / 1e-9)
print(timeit.timeit("histogram1d(x, bins=100, range=(0, 1))",
"from __main__ import x, histogram1d", number=nrepeat) / (nrepeat * len(x)) / 1e-9)

View File

@@ -0,0 +1,67 @@
// Copyright 2015-2019 Hans Dembinski
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt
// or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <TH1I.h>
#include <TH2I.h>
#include <TH3I.h>
#include <THn.h>
#include <benchmark/benchmark.h>
#include "generator.hpp"
#include <cassert>
struct assert_check {
assert_check() {
assert(false); // don't run with asserts enabled
}
} _;
template <class Distribution>
static void fill_1d(benchmark::State& state) {
TH1I h("", "", 100, 0, 1);
generator<Distribution> gen;
for (auto _ : state) benchmark::DoNotOptimize(h.Fill(gen()));
state.SetItemsProcessed(state.iterations());
}
template <class Distribution>
static void fill_2d(benchmark::State& state) {
TH2I h("", "", 100, 0, 1, 100, 0, 1);
generator<Distribution> gen;
for (auto _ : state) benchmark::DoNotOptimize(h.Fill(gen(), gen()));
state.SetItemsProcessed(state.iterations() * 2);
}
template <class Distribution>
static void fill_3d(benchmark::State& state) {
TH3I h("", "", 100, 0, 1, 100, 0, 1, 100, 0, 1);
generator<Distribution> gen;
for (auto _ : state) benchmark::DoNotOptimize(h.Fill(gen(), gen(), gen()));
state.SetItemsProcessed(state.iterations() * 3);
}
template <class Distribution>
static void fill_6d(benchmark::State& state) {
int bin[] = {10, 10, 10, 10, 10, 10};
double min[] = {0, 0, 0, 0, 0, 0};
double max[] = {1, 1, 1, 1, 1, 1};
THnI h("", "", 6, bin, min, max);
generator<Distribution> gen;
for (auto _ : state) {
const double buf[6] = {gen(), gen(), gen(), gen(), gen(), gen()};
benchmark::DoNotOptimize(h.Fill(buf));
}
state.SetItemsProcessed(state.iterations() * 6);
}
BENCHMARK_TEMPLATE(fill_1d, uniform);
BENCHMARK_TEMPLATE(fill_2d, uniform);
BENCHMARK_TEMPLATE(fill_3d, uniform);
BENCHMARK_TEMPLATE(fill_6d, uniform);
BENCHMARK_TEMPLATE(fill_1d, normal);
BENCHMARK_TEMPLATE(fill_2d, normal);
BENCHMARK_TEMPLATE(fill_3d, normal);
BENCHMARK_TEMPLATE(fill_6d, normal);

View File

@@ -0,0 +1,178 @@
// Copyright 2018 Hans Dembinski
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt
// or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <benchmark/benchmark.h>
#include <boost/histogram/axis/integer.hpp>
#include <boost/histogram/axis/regular.hpp>
#include <boost/histogram/histogram.hpp>
#include <boost/histogram/indexed.hpp>
#include <boost/histogram/literals.hpp>
#include <boost/histogram/make_histogram.hpp>
#include <boost/mp11/integral.hpp>
#include <vector>
#include "../test/throw_exception.hpp"
#include <cassert>
struct assert_check {
assert_check() {
assert(false); // don't run with asserts enabled
}
} _;
using namespace boost::histogram;
using namespace boost::histogram::literals;
struct tuple {};
struct vector {};
struct vector_of_variant {};
template <unsigned I>
using Dim_t = boost::mp11::mp_int<I>;
using d1 = Dim_t<1>;
using d2 = Dim_t<2>;
using d3 = Dim_t<3>;
auto make_histogram(tuple, d1, unsigned n) {
return make_histogram_with(std::vector<unsigned>(), axis::integer<>(0, n));
}
auto make_histogram(tuple, d2, unsigned n) {
return make_histogram_with(std::vector<unsigned>(), axis::integer<>(0, n),
axis::integer<>(0, n));
}
auto make_histogram(tuple, d3, unsigned n) {
return make_histogram_with(std::vector<unsigned>(), axis::integer<>(0, n),
axis::integer<>(0, n), axis::integer<>(0, n));
}
template <int Dim>
auto make_histogram(vector, boost::mp11::mp_int<Dim>, unsigned n) {
std::vector<axis::integer<>> axes;
for (unsigned d = 0; d < Dim; ++d) axes.emplace_back(axis::integer<>(0, n));
return make_histogram_with(std::vector<unsigned>(), std::move(axes));
}
template <int Dim>
auto make_histogram(vector_of_variant, boost::mp11::mp_int<Dim>, unsigned n) {
std::vector<axis::variant<axis::integer<>>> axes;
for (unsigned d = 0; d < Dim; ++d) axes.emplace_back(axis::integer<>(0, n));
return make_histogram_with(std::vector<unsigned>(), std::move(axes));
}
template <class Tag>
static void Naive(benchmark::State& state, Tag, d1, coverage cov) {
auto h = make_histogram(Tag(), d1(), state.range(0));
const int d = cov == coverage::all;
for (auto _ : state) {
for (int i = -d; i < h.axis().size() + d; ++i) {
benchmark::DoNotOptimize(i);
benchmark::DoNotOptimize(h.at(i));
}
}
}
template <class Tag>
static void Naive(benchmark::State& state, Tag, d2, coverage cov) {
auto h = make_histogram(Tag(), d2(), state.range(0));
const int d = cov == coverage::all;
for (auto _ : state) {
for (int i = -d; i < h.axis(0_c).size() + d; ++i) {
for (int j = -d; j < h.axis(1_c).size() + d; ++j) {
benchmark::DoNotOptimize(i);
benchmark::DoNotOptimize(j);
benchmark::DoNotOptimize(h.at(i, j));
}
}
}
}
template <class Tag>
static void Naive(benchmark::State& state, Tag, d3, coverage cov) {
auto h = make_histogram(Tag(), d3(), state.range(0));
const int d = cov == coverage::all;
for (auto _ : state) {
for (int i = -d; i < h.axis(0_c).size() + d; ++i) {
for (int j = -d; j < h.axis(1_c).size() + d; ++j) {
for (int k = -d; k < h.axis(2_c).size() + d; ++k) {
benchmark::DoNotOptimize(i);
benchmark::DoNotOptimize(j);
benchmark::DoNotOptimize(k);
benchmark::DoNotOptimize(h.at(i, j, k));
}
}
}
}
}
template <class Tag>
static void Indexed(benchmark::State& state, Tag, d1, coverage cov) {
auto h = make_histogram(Tag(), d1(), state.range(0));
for (auto _ : state) {
for (auto&& x : indexed(h, cov)) {
benchmark::DoNotOptimize(*x);
benchmark::DoNotOptimize(x.index());
}
}
}
template <class Tag>
static void Indexed(benchmark::State& state, Tag, d2, coverage cov) {
auto h = make_histogram(Tag(), d2(), state.range(0));
for (auto _ : state) {
for (auto&& x : indexed(h, cov)) {
benchmark::DoNotOptimize(*x);
benchmark::DoNotOptimize(x.index(0));
benchmark::DoNotOptimize(x.index(1));
}
}
}
template <class Tag>
static void Indexed(benchmark::State& state, Tag, d3, coverage cov) {
auto h = make_histogram(Tag(), d3(), state.range(0));
for (auto _ : state) {
for (auto&& x : indexed(h, cov)) {
benchmark::DoNotOptimize(*x);
benchmark::DoNotOptimize(x.index(0));
benchmark::DoNotOptimize(x.index(1));
benchmark::DoNotOptimize(x.index(2));
}
}
}
#define BENCH(Type, Tag, Dim, Cov) \
BENCHMARK_CAPTURE(Type, (Tag, Dim, Cov), Tag{}, Dim_t<Dim>{}, coverage::Cov) \
->RangeMultiplier(4) \
->Range(4, 256)
BENCH(Naive, tuple, 1, inner);
BENCH(Indexed, tuple, 1, inner);
BENCH(Naive, vector, 1, inner);
BENCH(Indexed, vector, 1, inner);
BENCH(Naive, vector_of_variant, 1, inner);
BENCH(Indexed, vector_of_variant, 1, inner);
BENCH(Naive, tuple, 2, inner);
BENCH(Indexed, tuple, 2, inner);
BENCH(Naive, vector, 2, inner);
BENCH(Indexed, vector, 2, inner);
BENCH(Naive, vector_of_variant, 2, inner);
BENCH(Indexed, vector_of_variant, 2, inner);
BENCH(Naive, tuple, 3, inner);
BENCH(Indexed, tuple, 3, inner);
BENCH(Naive, vector, 3, inner);
BENCH(Indexed, vector, 3, inner);
BENCH(Naive, vector_of_variant, 3, inner);
BENCH(Indexed, vector_of_variant, 3, inner);

View File

@@ -0,0 +1,149 @@
// Copyright 2015-2018 Hans Dembinski
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt
// or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <benchmark/benchmark.h>
#include <boost/histogram/accumulators/thread_safe.hpp>
#include <boost/histogram/axis/regular.hpp>
#include <boost/histogram/histogram.hpp>
#include <boost/histogram/make_histogram.hpp>
#include <chrono>
#include <functional>
#include <mutex>
#include <numeric>
#include <random>
#include <thread>
#include <vector>
#include "../test/throw_exception.hpp"
#include <cassert>
struct assert_check {
assert_check() {
assert(false); // don't run with asserts enabled
}
} _;
using namespace boost::histogram;
using namespace std::chrono_literals;
using DS = dense_storage<unsigned>;
using DSTS = dense_storage<accumulators::thread_safe<unsigned>>;
static void NoThreads(benchmark::State& state) {
std::default_random_engine gen(1);
std::uniform_real_distribution<> dis(0, 1);
const unsigned nbins = state.range(0);
auto hist = make_histogram_with(DS(), axis::regular<>(nbins, 0, 1));
for (auto _ : state) {
// simulate some work
for (volatile unsigned n = 0; n < state.range(1); ++n)
;
hist(dis(gen));
}
}
std::mutex init;
static auto hist = make_histogram_with(DSTS(), axis::regular<>());
static void AtomicStorage(benchmark::State& state) {
init.lock();
if (state.thread_index == 0) {
const unsigned nbins = state.range(0);
hist = make_histogram_with(DSTS(), axis::regular<>(nbins, 0, 1));
}
init.unlock();
std::default_random_engine gen(state.thread_index);
std::uniform_real_distribution<> dis(0, 1);
for (auto _ : state) {
// simulate some work
for (volatile unsigned n = 0; n < state.range(1); ++n)
;
hist(dis(gen));
}
}
BENCHMARK(NoThreads)
->UseRealTime()
->Args({1 << 4, 0})
->Args({1 << 6, 0})
->Args({1 << 8, 0})
->Args({1 << 10, 0})
->Args({1 << 14, 0})
->Args({1 << 18, 0})
->Args({1 << 4, 5})
->Args({1 << 6, 5})
->Args({1 << 8, 5})
->Args({1 << 10, 5})
->Args({1 << 14, 5})
->Args({1 << 18, 5})
->Args({1 << 4, 10})
->Args({1 << 6, 10})
->Args({1 << 8, 10})
->Args({1 << 10, 10})
->Args({1 << 14, 10})
->Args({1 << 18, 10})
->Args({1 << 4, 50})
->Args({1 << 6, 50})
->Args({1 << 8, 50})
->Args({1 << 10, 50})
->Args({1 << 14, 50})
->Args({1 << 18, 50})
->Args({1 << 4, 100})
->Args({1 << 6, 100})
->Args({1 << 8, 100})
->Args({1 << 10, 100})
->Args({1 << 14, 100})
->Args({1 << 18, 100})
;
BENCHMARK(AtomicStorage)
->UseRealTime()
->Threads(1)
->Threads(2)
->Threads(4)
->Args({1 << 4, 0})
->Args({1 << 6, 0})
->Args({1 << 8, 0})
->Args({1 << 10, 0})
->Args({1 << 14, 0})
->Args({1 << 18, 0})
->Args({1 << 4, 5})
->Args({1 << 6, 5})
->Args({1 << 8, 5})
->Args({1 << 10, 5})
->Args({1 << 14, 5})
->Args({1 << 18, 5})
->Args({1 << 4, 10})
->Args({1 << 6, 10})
->Args({1 << 8, 10})
->Args({1 << 10, 10})
->Args({1 << 14, 10})
->Args({1 << 18, 10})
->Args({1 << 4, 50})
->Args({1 << 6, 50})
->Args({1 << 8, 50})
->Args({1 << 10, 50})
->Args({1 << 14, 50})
->Args({1 << 18, 50})
->Args({1 << 4, 100})
->Args({1 << 6, 100})
->Args({1 << 8, 100})
->Args({1 << 10, 100})
->Args({1 << 14, 100})
->Args({1 << 18, 100})
;

View File

@@ -0,0 +1,112 @@
#!/usr/bin/env python3
# Copyright Hans Dembinski 2019
# Distributed under the Boost Software License, Version 1.0.
# See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt
from matplotlib import pyplot as plt, lines
import shelve
import json
import subprocess as subp
import sys
from collections import defaultdict
from run_benchmarks import get_commits, run
import numpy as np
import threading
thread = None
current_index = 0
commits, comments = get_commits()
def get_benchmarks(results):
benchmarks = defaultdict(lambda: [])
for hash in commits:
if hash in results and results[hash] is not None:
benchs = results[hash]
for b in benchs["benchmarks"]:
name = b["name"]
time = min(b["cpu_time"], b["real_time"])
benchmarks[name].append((commits.index(hash), time))
return benchmarks
with shelve.open("benchmark_results") as results:
benchmarks = get_benchmarks(results)
fig, ax = plt.subplots(4, 1, figsize=(10, 10), sharex=True)
plt.subplots_adjust(hspace=0, top=0.98, bottom=0.05, right=0.96)
plt.sca(ax[0])
for name, xy in benchmarks.items():
if "uniform" in name: continue
if "_1d" in name:
x, y = np.transpose(xy)
plt.plot(x, y, ".-", label=name)
plt.legend(fontsize="xx-small")
plt.sca(ax[1])
for name, xy in benchmarks.items():
if "uniform" in name: continue
if "_2d" in name:
x, y = np.transpose(xy)
plt.plot(x, y, ".-", label=name)
plt.legend(fontsize="xx-small")
plt.sca(ax[2])
for name, xy in benchmarks.items():
if "uniform" in name: continue
if "_3d" in name:
x, y = np.transpose(xy)
plt.plot(x, y, ".-", label=name)
plt.legend(fontsize="xx-small")
plt.sca(ax[3])
for name, xy in benchmarks.items():
if "uniform" in name: continue
if "_6d" in name:
x, y = np.transpose(xy)
plt.plot(x, y, ".-", label=name)
plt.legend(fontsize="xx-small")
plt.figtext(0.01, 0.5, "time per loop / ns [smaller is better]", rotation=90, va="center")
def format_coord(x, y):
global current_index
current_index = max(0, min(int(x + 0.5), len(commits) - 1))
hash = commits[current_index]
comment = comments[hash]
return f"{hash} {comment}"
for axi in ax.flatten():
axi.format_coord = format_coord
def on_key_press(event):
global thread
if thread and thread.is_alive(): return
if event.key != "u": return
hash = commits[current_index]
def worker(fig, ax, hash):
with shelve.open("benchmark_results") as results:
run(results, comments, hash, True)
benchmarks = get_benchmarks(results)
for name in benchmarks:
xy = benchmarks[name]
x, y = np.transpose(xy)
for axi in ax.flatten():
for artist in axi.get_children():
if isinstance(artist, lines.Line2D) and artist.get_label() == name:
artist.set_xdata(x)
artist.set_ydata(y)
fig.canvas.draw()
thread = threading.Thread(target=worker, args=(fig, ax, hash))
thread.start()
fig.canvas.mpl_connect('key_press_event', on_key_press)
plt.show()

View File

@@ -0,0 +1,116 @@
#!/usr/bin/env python3
# Copyright Hans Dembinski 2019
# Distributed under the Boost Software License, Version 1.0.
# See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt
"""
This script runs the benchmarks on previous versions of this library to track changes
in performance.
Run this from a special build directory that uses the benchmark folder as root
cd my_build_dir
cmake ../benchmark
../run_benchmarks.py
This creates a database, benchmark_results. Plot it:
../plot_benchmarks.py
The script leaves the include folder in a modified state. To clean up, do:
git checkout HEAD -- ../include
git clean -f -- ../include
"""
import subprocess as subp
import tempfile
import os
import shelve
import json
import argparse
def get_commits():
commits = []
comments = {}
for line in subp.check_output(("git", "log", "--oneline")).decode("ascii").split("\n"):
if line:
ispace = line.index(" ")
hash = line[:ispace]
commits.append(hash)
comments[hash] = line[ispace+1:]
commits = commits[::-1]
return commits, comments
def recursion(results, commits, comments, ia, ib):
ic = int((ia + ib) / 2)
if ic == ia:
return
run(results, comments, commits[ic], False)
if all([results[commits[i]] is None for i in (ia, ib, ic)]):
return
recursion(results, commits, comments, ic, ib)
recursion(results, commits, comments, ia, ic)
def run(results, comments, hash, update):
if not update and hash in results:
return
print(hash, comments[hash])
subp.call(("rm", "-rf", "../include"))
if subp.call(("git", "checkout", hash, "--", "../include")) != 0:
print("[Benchmark] Cannot checkout include folder\n")
return
print(hash, "make")
with tempfile.TemporaryFile() as out:
if subp.call(("make", "-j4", "histogram_filling"), stdout=out, stderr=out) != 0:
print("[Benchmark] Cannot make benchmarks\n")
out.seek(0)
print(out.read().decode("utf-8") + "\n")
return
print(hash, "run")
s = subp.check_output(("./histogram_filling", "--benchmark_format=json", "--benchmark_filter=normal"))
d = json.loads(s)
if update and hash in results and results[hash] is not None:
d2 = results[hash]
for i, (b, b2) in enumerate(zip(d["benchmarks"], d2["benchmarks"])):
d["benchmarks"][i] = b if b["cpu_time"] < b2["cpu_time"] else b2
results[hash] = d
for benchmark in d["benchmarks"]:
print(benchmark["name"], min(benchmark["real_time"], benchmark["cpu_time"]))
def main():
commits, comments = get_commits()
parser = argparse.ArgumentParser(description=__doc__,
formatter_class=argparse.RawDescriptionHelpFormatter)
parser.add_argument("first", type=str, default="begin",
help="first commit in range, special value `begin` is allowed")
parser.add_argument("last", type=str, default="end",
help="last commit in range, special value `end` is allowed")
parser.add_argument("-f", action="store_true",
help="override previous results")
args = parser.parse_args()
if args.first == "begin":
args.first = commits[0]
if args.last == "end":
args.last = commits[-1]
with shelve.open("benchmark_results") as results:
a = commits.index(args.first)
b = commits.index(args.last)
if args.f:
for hash in commits[a:b+1]:
del results[hash]
run(results, comments, args.first, False)
run(results, comments, args.last, False)
recursion(results, commits, comments, a, b)
if __name__ == "__main__":
main()

View File

@@ -0,0 +1,68 @@
# Copyright (c) 2016-2019 Klemens D. Morgenstern, Hans Dembinski
#
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
# How to set up Boost Build for building the documentation:
# https://www.boost.org/doc/libs/1_72_0/doc/html/quickbook/install.html
project doc/histogram ;
import os ;
import doxygen ;
import quickbook ;
import boostbook : boostbook ;
import notfile ;
path-constant THIS_PATH : . ;
doxygen reference
:
$(THIS_PATH)/../../../boost/histogram.hpp
[ glob $(THIS_PATH)/../../../boost/histogram/*.hpp ]
[ glob $(THIS_PATH)/../../../boost/histogram/accumulators/*.hpp ]
[ glob $(THIS_PATH)/../../../boost/histogram/algorithm/*.hpp ]
[ glob $(THIS_PATH)/../../../boost/histogram/axis/*.hpp ]
:
<doxygen:param>QUIET=YES
<doxygen:param>WARNINGS=YES
<doxygen:param>WARN_IF_DOC_ERROR=YES
<doxygen:param>EXTRACT_ALL=NO
<doxygen:param>EXTRACT_PRIVATE=NO
<doxygen:param>HIDE_UNDOC_MEMBERS=YES
<doxygen:param>HIDE_UNDOC_CLASSES=YES
<doxygen:param>EXPAND_ONLY_PREDEF=YES
<doxygen:param>JAVADOC_AUTOBRIEF=YES
<doxygen:param>EXCLUDE_SYMBOLS=detail
<doxygen:param>"PREDEFINED=\"BOOST_HISTOGRAM_DOXYGEN_INVOKED\" \\
\"BOOST_ATTRIBUTE_NODISCARD\""
;
actions doxygen-postprocessing
{
python3 $(THIS_PATH)/doxygen_postprocessing.py "$(>)"
}
notfile reference-pp : @doxygen-postprocessing : reference.xml ;
path-constant images_location : html ;
boostbook histogram
:
histogram.qbk
:
<xsl:param>boost.root=../../../..
<xsl:param>boost.libraries=../../../libraries.htm
<xsl:param>boost.mathjax=1
<xsl:param>chunk.first.sections=1
<xsl:param>generate.toc="chapter nop section toc"
<xsl:param>toc.section.depth=3
<dependency>reference-pp
<format>pdf:<xsl:param>img.src.path=$(images_location)/
<format>pdf:<xsl:param>boost.url.prefix="http://www.boost.org/doc/libs/release/doc/html"
;
alias boostdoc ;
explicit boostdoc ;
alias boostrelease : histogram ;
explicit boostrelease ;

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,61 @@
[/
Copyright Hans Dembinski 2018 - 2019.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
https://www.boost.org/LICENSE_1_0.txt)
]
[section:benchmarks Benchmarks]
The library is designed to be fast. When configured correctly, it is one of the fastest libraries on the market. If you find a library that is faster than Boost.Histogram, please submit an issue on Github. We care about performance.
That being said, the time spend in filling the histogram is usually not the bottleneck of an application. Only in processing of really large data sets the performance of the histogram can be important.
All benchmarks are compiled on a laptop with a 2,9 GHz Intel Core i5 processor with Apple LLVM (clang-1001.0.46.4) and the flags `-DNDEBUG -O3 -funsafe-math-optimizations`. Adding `-fno-exceptions -fno-rtti` would increase the Boost.Histogram performance by another (10-20) %, but this is not done here out of fairness, since the ROOT histograms do not compile with these options.
[section:fill_performance Fill performance]
The fill performance of different configurations of Boost.Histogram are compared with histogram classes and functions from other libraries. Random numbers from a uniform and a normal distribution are filled into histograms with 1, 2, 3, and 6 axes. 100 bins per axis are used for 1, 2, 3 axes. 10 bins per axis for the case with 6 axes. The histogram are filled with the call operator `operator()` and the more efficient `fill`-method, which accepts large chunks of values at once. The GSL offers only 1D and 2D histograms, so there are no entries for the higher dimensional benchmarks. Raw timing results are converted to average number of CPU cycles used per input value.
There is one bar for each benchmark and the upper end has a hatched part. The full bar is the result when the histograms are filled with random normally distributed data that falls outside of the axis domain in about 10 % of the cases. This makes the branch predictors in the CPU fail every now and then, which degrades performance. The bar without the hatched part is the result when the histograms are filled with uniform random numbers which are always inside the axis range.
[$../fill_performance.svg]
[variablelist
[[ROOT 6] [[@https://root.cern.ch ROOT classes] (`TH1I` for 1D, `TH2I` for 2D, `TH3I` for 3D and `THnI` for 6D)]]
[[GSL] [[@https://www.gnu.org/software/gsl/doc/html/histogram.html GSL histograms] for 1D and 2D]]
[[boost-sta] [Histogram with `std::tuple<axis::regular<>>` and `std::vector<int>` storage]]
[[boost-dyn] [Histogram with `std::vector<axis::variant<axis::regular<>>>` and `std::vector<int>` storage]]
]
Boost.Histogram is faster than other libraries. Simultaneously, it is much more flexible, since the axis and storage types can be customized. When `operator()` is used, a histogram with compile-time configured axes (boost-sta-...) is always faster than the equivalent alternatives from other libraries. The histogram with run-time configured axes (boost-dyn-...) is comparable or slower than other libraries, but offers a run-time flexibility that the alternatives do not. If the `fill` method is used, filling either type of histogram is much faster (up to a factor 6) than filling histograms in other libraries, and the performance difference between compile-time and run-time configured axes is mostly vanishes.
[endsect]
[section:iteration_performance Iteration performance]
Boost.Histogram provides the [funcref boost::histogram::indexed] range generator for convenient iteration over the histogram cells. Using the range generator is very convenient and it is faster than by writing nested for-loops.
```
// nested for loops over 2d histogram
for (int i = 0; i < h.axis(0).size(); ++i) {
for (int j = 0; j < h.axis(1).size(); ++j) {
std::cout << i << " " << j << " " << h.at(i, j) << std::endl;
}
}
// same, with indexed range generator
for (auto&& x : boost::histogram::indexed(h)) {
std::cout << x.index(0) << " " << x.index(1) << " " << *x << std::endl;
}
```
The access time per bin is compared for these two iteration strategies for histograms that hold the axes in a `std::tuple` (tuple), in a `std::vector` (vector), and in a `std::vector<boost::histogram::axis::variant>` (vector of variants). The access time per bin is measured for axis with 4 to 128 bins per axis.
[$../iteration_performance.svg]
[endsect]
[endsect]

View File

@@ -0,0 +1,19 @@
[/
Copyright Hans Dembinski 2018 - 2019.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
https://www.boost.org/LICENSE_1_0.txt)
]
[section:concepts Concepts]
Users can extend the library with various new types whose concepts are defined here.
[include concepts/Axis.qbk]
[include concepts/DiscreteAxis.qbk]
[include concepts/IntervalAxis.qbk]
[include concepts/Transform.qbk]
[include concepts/Storage.qbk]
[include concepts/Accumulator.qbk]
[endsect]

View File

@@ -0,0 +1,96 @@
[/
Copyright Hans Dembinski 2018 - 2019.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
https://www.boost.org/LICENSE_1_0.txt)
]
[section:Accumulator Accumulator]
An [*Accumulator] is a functor which consumes the argument to update some internal state. Must be [@https://en.cppreference.com/w/cpp/named_req/DefaultConstructible DefaultConstructible], [@https://en.cppreference.com/w/cpp/named_req/CopyConstructible CopyConstructible], and [@https://en.cppreference.com/w/cpp/named_req/CopyAssignable CopyAssignable].
[heading Required features]
* `A` is a type meeting the requirements of [*Accumulator]
* `a` and `b` are values of type `A`
* `ts...` is a pack of values of arbitrary types
[table Valid expressions
[[Expression] [Returns] [Semantics, Pre/Post-conditions]]
[
[`a(ts...)` or `++a`]
[]
[
Either a call operator accepting a fixed number of arguments must be implemented, or the pre-increment operator. The call operator form `a(ts...)` may not be templated and not overloaded, except to support weights as described under optional features.
]
]
[
[`a == b`]
[`bool`]
[
Returns `true` if all state variables compare equal. Otherwise returns `false`.
]
]
[
[`a != b`]
[`bool`]
[
Must be implemented if `a == b` is implemented and must be equal to `!(a == b)`.
]
]
]
[heading Optional features]
* `A` is a type meeting the requirements of [*Accumulator]
* `a` and `b` are values of type `A`
* `w` is a value of type [classref boost::histogram::weight_type]
* `ts...` is a pack of values of arbitrary types
[table Valid expressions
[[Expression] [Return] [Semantics, Pre/Post-conditions]]
[
[`a += w` or `a(w, ts...)`]
[]
[
Does a weighted fill of the accumulator. Use this to implement weight support for an accumulator that is normally filled with `++a` or `a(ts...)`, respectively. Only the corresponding matching form may be implemented: `a += w` for `++a`, `a(w, ts...)` for `a(ts...)`. The call operator form `a(w, ts...)` may not be templated and not overloaded.
]
]
[
[`a += b`]
[`A&`]
[
Adds a second accumulator `b` of type `A`. The result must be the same as if `a` had been filled with all arguments of `b`.
]
]
[
[`a *= x`]
[`A&`]
[
Scales the accumulator state by the real value `x`. The result must be the same as if `a` had been filled with all arguments scaled by `x`.
]
]
[
[`os << a`]
[`std::basic_ostream<CharT, Traits>&`]
[
`os` is a value of type `std::basic_ostream<CharT, Traits>`. Streams a text representation of the axis. May not mutate `a`.
]
]
[
[`a.serialize(ar, n)`]
[]
[
`ar` is a value of an archive with Boost.Serialization semantics and `n` is an unsigned integral value. Saves to the archive or loads serialized state from the archive. The version number `n` is the stored version when the object is loaded or the current version when the object is saved.
]
]
]
[heading Models]
* [classref boost::histogram::accumulators::sum]
* [classref boost::histogram::accumulators::weighted_sum]
* [classref boost::histogram::accumulators::mean]
* [classref boost::histogram::accumulators::weighted_mean]
[endsect]

View File

@@ -0,0 +1,132 @@
[/
Copyright Hans Dembinski 2018 - 2019.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
https://www.boost.org/LICENSE_1_0.txt)
]
[section:Axis Axis]
An [*Axis] maps input values to indices. It holds state specific to that axis, like the number of bins and any metadata. Must be [@https://en.cppreference.com/w/cpp/named_req/CopyConstructible CopyConstructible], [@https://en.cppreference.com/w/cpp/named_req/CopyAssignable CopyAssignable], and *nothrow* [@https://en.cppreference.com/w/cpp/named_req/MoveAssignable MoveAssignable].
[heading Associated Types]
* [link histogram.concepts.DiscreteAxis [*DiscreteAxis]]
* [link histogram.concepts.IntervalAxis [*IntervalAxis]]
[heading Required features]
* `A` is a type meeting the requirements of [*Axis]
* `a` is a value of type `A`
* `I` is an alias for [headerref boost/histogram/fwd.hpp `boost::histogram::axis::index_type`]
[table Valid expressions
[[Expression] [Returns] [Semantics, Pre/Post-conditions]]
[
[`a.size()`]
[`I`]
[
Const member function which returns the number of bins of the axis. All indices from `0` to `a.size() - 1` must be valid and address a bin of the axis.
]
]
[
[`a.index(v)`]
[`I`]
[
Const member function which maps a value `v` to an index. The mapping must be injective: each value must be uniquely mapped to one index. If the value is not covered by the axis, return either `-1` or `a.size()`. The value `-1` indicates that the value is lower than the lowest value covered by the axis. The value `a.size()` indicates that the value is above the uppermost value covered by the axis. By convention, /NaN/-values are mapped to `a.size()`.
]
]
[
[`a.get_allocator()`]
[`Alloc`]
[
Const member function which returns the allocator `Alloc` used by this axis. May be omitted if `A` does not use allocators. If this member function exists, also a special constructor must exists so that `A(a.get_allocator())` is a valid expression.
]
]
]
[heading Optional features]
* `A` is a type meeting the requirements of [*Axis]
* `a` and `b` are values of type `A`
* `i` and `j` are indices of type [headerref boost/histogram/fwd.hpp `boost::histogram::axis::index_type`]
* `n` is a value of type `unsigned`
* `M` is a metadata type that is [@https://en.cppreference.com/w/cpp/named_req/CopyConstructible CopyConstructible] and [@https://en.cppreference.com/w/cpp/named_req/CopyAssignable CopyAssignable] and *nothrow* [@https://en.cppreference.com/w/cpp/named_req/MoveAssignable MoveAssignable].
* `ar` is a value of an archive with Boost.Serialization semantics
[table Valid expressions
[[Expression] [Returns] [Semantics, Pre/Post-conditions]]
[
[`a.update(v)`]
[`std::pair<I, I>`]
[
Non-const member function which maps a value to an index (first argument of the returned pair) and offset (second argument of the returned pair). If the value is not covered by the axis, this method may grow the current axis size (`old_size`) by the number of bins needed to contain the value or more (`new_size`). If the value is below the lowest value covered by the axis, return index `0` and offset `new_size - old_size`. If the value is above the uppermost value covered by the axis, return index `new_size - 1` and a negative offset `old_size - new_size`. If the value is outside, but the axis is not enlarged, then return an index equivalent to `a.index(v)` and offset `0`.
]
]
[
[`A(a, i, j, n)`]
[]
[
Special constructor used by the reduce algorithm. `a` is the original axis instance, `i` and `j` are the index range to keep in the reduced axis. If `n` is larger than 1, `n` adjacent bins are merged into one larger cell. If this constructor is not implemented, [funcref boost::histogram::algorithm::reduce] throws an exception on an attempt to reduce this axis.
]
]
[
[`a.options()`]
[`unsigned`]
[
Static constexpr member function which returns the [headerref boost/histogram/axis/option.hpp axis options] for this axis.
]
]
[
[`a.inclusive()`]
[`bool`]
[
Static constexpr member function which returns true, if the axis has a bin for every possible input value, and false otherwise. Faster code can be generated if all axes types in a histogram are inclusive. An axis with underflow and overflow bins is always inclusive. An axis may be inclusive even if underflow or overflow bins are missing. For example, a category axis is inclusive if either it has an overflow bin or if it is growing.
]
]
[
[`a.metadata()`]
[`M&`]
[
Const and non-const member functions must exist, which both returns a mutable reference to the metadata associated with the axis (usually a string).
]
]
[
[`a == b`]
[`bool`]
[
Returns `true` if all state variables compare equal, including any metadata. Otherwise returns `false`. If `a == b` is implemented, also `a != b` must be implemented. If this binary operator is not implemented, the library considers the axes equal if their types are the same.
]
]
[
[`a != b`]
[`bool`]
[
Must be implemented if `a == b` is implemented and must be equal to `!(a == b)`.
]
]
[
[`os << a`]
[`std::basic_ostream<CharT, Traits>&`]
[
`os` is a value of type `std::basic_ostream<CharT, Traits>`. Streams a text representation of the axis. May not mutate `a`.
]
]
[
[`a.serialize(ar, n)`]
[]
[
Saves to the archive or loads serialised state from the archive. The version number `n` is the stored version when the object is loaded or the current version when the object is saved.
]
]
]
[heading Models]
* [classref boost::histogram::axis::boolean]
* [classref boost::histogram::axis::category]
* [classref boost::histogram::axis::integer]
* [classref boost::histogram::axis::regular]
* [classref boost::histogram::axis::variable]
[endsect]

View File

@@ -0,0 +1,91 @@
[/
Copyright Hans Dembinski 2018 - 2019.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
https://www.boost.org/LICENSE_1_0.txt)
]
[section:DiscreteAxis DiscreteAxis]
A [*DiscreteAxis] is one of two optional refinements of the [link histogram.concepts.Axis [*Axis]] concept, the other one is the [link histogram.concepts.IntervalAxis IntervalAxis]. This concept is for axes in which each bin represents a single value instead of an interval.
Discrete axes can be further divided into ordered and unordered. An axis is ordered, when bin indices i < j < k imply that value[i] < value[j] < value[k] or value[i] > value[j] > value[k] for all i, j, k. The [classref boost::histogram::axis::integer integer axis] is ordered and the [classref boost::histogram::axis::category category axis] is unordered.
An unordered discrete axis cannot have an underflow bin. Since there is no order, one can have at most one extra bin that counts values not handled by the axis. By convention the overflow bin is used for that.
[heading Associated Types]
* [link histogram.concepts.Axis [*Axis]]
* [link histogram.concepts.IntervalAxis [*IntervalAxis]]
[heading Optional features]
* `A` is a type meeting the requirements of [*DiscreteAxis]
* `a` is a value of type `A`
* `V` is the type accepted for conversion into an index
* `v` is a value of type `V`
* `i` is a value of type [headerref boost/histogram/fwd.hpp `boost::histogram::axis::index_type`]
* `AxisIter` is an /RandomAccessIterator/ over the bins of `A`
* `ReAxisIter` is a reverse /RandomAccessIterator/ over the bins of `A`
[table Valid expressions
[[Expression] [Returns] [Semantics, Pre/Post-conditions]]
[
[`a.ordered()`]
[`bool`]
[
Static constexpr member function which returns true if the axis is ordered and false otherwise. If this is absent, the library checks whether the value type is arithmetic instead, see [funcref boost::histogram::axis::traits::ordered].
]
]
[
[`a.value(i)`]
[`V`]
[
Const member function which maps an index to a value. The mapping must be injective: each index must be uniquely mapped to one value. The effect must be exactly the inverse of `a.index(v)`. The return value may be a const reference, if the lifetime of the referred object is equal to the lifetime of the axis.
]
]
[
[`a.bin(i)`]
[`V`]
[
Must have the same effect as `a.value(i)`.
]
]
[
[`s.begin()`]
[`AxisIter`]
[
Const member function which return an iterator to the bin with index `0`.
]
]
[
[`s.end()`]
[`AxisIter`]
[
Const member function which returns an iterator to the bin with index `s.size()`.
]
]
[
[`s.rbegin()`]
[`ReAxisIter`]
[
Const member function which return a reverse iterator to the bin with index `s.size()-1`.
]
]
[
[`s.rend()`]
[`ReAxisIter`]
[
Const member function which returns an iterator to the bin with index `-1`.
]
]
]
[tip The complete iterator interface can be added to a user-defined axis which implements `a.bin(i)` by inheriting from the [classref boost::histogram::axis::iterator_mixin iterator_mixin].]
[heading Models]
* [classref boost::histogram::axis::category]
* [classref boost::histogram::axis::integer], if first template parameter is `int`
[endsect]

View File

@@ -0,0 +1,83 @@
[/
Copyright Hans Dembinski 2018 - 2019.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
https://www.boost.org/LICENSE_1_0.txt)
]
[section:IntervalAxis IntervalAxis]
A [*IntervalAxis] is one of two optional refinements of the [link histogram.concepts.Axis [*Axis]] concept, the other one is the [link histogram.concepts.DiscreteAxis DiscreteAxis]. It is for ordered values that form intervals with a well-defined lower and upper edge, and a center. Each bin represents an interval of values.
[heading Associated Types]
* [link histogram.concepts.Axis [*Axis]]
* [link histogram.concepts.DiscreteAxis [*DiscreteAxis]]
[heading Optional features]
* `A` is a type meeting the requirements of [*IntervalAxis]
* `a` is a value of type `A`
* `V` is the type accepted for conversion into an index
* `B` is the type that represents the bin interval
* `v` is a value of type `V`
* `i` is a value of type [headerref boost/histogram/fwd.hpp `boost::histogram::axis::index_type`]
* `j` is a value of type [headerref boost/histogram/fwd.hpp `boost::histogram::axis::real_index_type`]
* `AxisIter` is an /RandomAccessIterator/ over the bins of `A`
* `ReAxisIter` is a reverse /RandomAccessIterator/ over the bins of `A`
[table Valid expressions
[[Expression] [Returns] [Semantics, Pre/Post-conditions]]
[
[`a.value(i)`]
[`V`]
[
Const member function which maps an index to a value. The mapping must be injective: each index must be uniquely mapped to one value. The result of `a.value(a.index(v))` should agree to very high precision with `v` (the mapping may not be exact due to the finite precision of floating point computations). The return value may be a const reference, if the lifetime of the referred object is equal to the lifetime of the axis. `a.value(j)` is expected to return the lower edge of the bin, `a.value(j+1)` the upper edge, and `a.value(j + 0.5)` the center.
]
]
[
[`a.bin(i)`]
[`B`]
[
Const member function which returns an instance that represents the current bin. Nothing about the type is required, but it is recommended that the type has the methods `B::lower()`, `B::upper()`, and `B::center()` similar to the types used by the builtin axis models. The return value may be a const reference, if the lifetime of the referred object is equal to the lifetime of the axis.
]
]
[
[`s.begin()`]
[`AxisIter`]
[
Const member function which return an iterator to the bin with index `0`.
]
]
[
[`s.end()`]
[`AxisIter`]
[
Const member function which returns an iterator to the bin with index `s.size()`.
]
]
[
[`s.rbegin()`]
[`ReAxisIter`]
[
Const member function which return a reverse iterator to the bin with index `s.size()-1`.
]
]
[
[`s.rend()`]
[`ReAxisIter`]
[
Const member function which returns an iterator to the bin with index `-1`.
]
]
]
[tip The complete iterator interface can be added to a user-defined axis which implements `a.bin(i)` by inheriting from the [classref boost::histogram::axis::iterator_mixin iterator_mixin].]
[heading Models]
* [classref boost::histogram::axis::regular]
* [classref boost::histogram::axis::variable]
* [classref boost::histogram::axis::integer], if first template parameter is a floating point type
[endsect]

View File

@@ -0,0 +1,170 @@
[/
Copyright Hans Dembinski 2018 - 2019.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
https://www.boost.org/LICENSE_1_0.txt)
]
[section:Storage Storage]
A [*Storage] handles memory for the bin counters and provides a uniform vector-like interface for accessing cell values for reading and writing. Must be [@https://en.cppreference.com/w/cpp/named_req/DefaultConstructible DefaultConstructible], [@https://en.cppreference.com/w/cpp/named_req/CopyConstructible CopyConstructible], and [@https://en.cppreference.com/w/cpp/named_req/CopyAssignable CopyAssignable].
[heading Required features]
* `S` is a type meeting the requirements of [*Storage]
* `s` is a value of types `S`
* `i` and `n` are values of type `std::size_t`
* `Alloc` is an allocator type for `S`
[table Valid expressions
[[Expression] [Returns] [Semantics, Pre/Post-conditions]]
[
[`S::value_type`]
[]
[
Cell element type, may be either an integral type, floating-point type, or a type meeting the requirements of [link histogram.concepts.Accumulator [*Accumulator]].
]
]
[
[`S::reference`]
[]
[
`S::value_type&` or a proxy class which acts like a reference.
]
]
[
[`S::const_reference`]
[]
[
`const S::value_type&` or a proxy class which acts like a const reference. Implicitly convertible to `S::value_type`.
]
]
[
[`S::iterator`]
[]
[
Returns an STL-compliant iterator type which dereferences to `S::reference`.
]
]
[
[`S::const_iterator`]
[]
[
Returns an STL-compliant iterator type which dereferences to `S::const_reference`.
]
]
[
[`S::has_threading_support`]
[bool]
[
Static constexpr member. True, if storage supports parallel read-write access to all cells.
False, if such parallel access would either cause data corruption or require synchronization so that effectively only one cell can be accessed at a time, making cell-access single-threaded.
]
]
[
[`s.size()`]
[`std::size_t`]
[
Const member function which returns the current number of cells in the storage.
]
]
[
[`s.reset(n)`]
[]
[
Non-const member function which discards current cell values, changes storage size to `n` and initializes all cells to the default-constructed state.
]
]
[
[`s.begin()`]
[`S::iterator`]
[
Non-const member function which returns the iterator to the first storage cell.
]
]
[
[`s.begin()`]
[`S::const_iterator`]
[
Likewise, but a const member function which returns the const_iterator.
]
]
[
[`s.end()`]
[`S::iterator`]
[
Member function which returns the iterator to the cell after the last valid storage cell.
]
]
[
[`s.end()`]
[`S::const_iterator`]
[
Likewise, but a const member function which returns the const_iterator.
]
]
[
[`s[i]`]
[`S::reference`]
[
Member function which returns a reference to the cell which is addressed by `i`. The index `i` must be valid: `i < s.size()`.
]
]
[
[`s[i]`]
[`S::const_reference`]
[
Likewise, but a const member function which returns a const reference.
]
]
[
[`s == t`]
[`bool`]
[
`t` is another value of a type which meets the requirements of [*Storage]. Returns `true` if arguments have the same number of cells and all cells compare equal. Otherwise returns `false`.
]
]
[
[`s.get_allocator()`]
[`Alloc`]
[
Const member function which returns the allocator used by `S`. Must be omitted if `S` does not use allocators. If this member function exists, also a special constructor must exist so that `S(s.get_allocator())` is a valid expression.
]
]
]
[heading Optional features]
* `S` is a type meeting the requirements of [*Storage]
* `s` is a value of types `S`
* `x` is convertible to `double`
* `ar` is a value of an archive with Boost.Serialization semantics
[table Valid expressions
[[Expression] [Returns] [Semantics, Pre/Post-conditions]]
[
[`s *= x`]
[`S&`]
[
Scales all cell values by the factor `x` and returns a reference to self.
]
]
[
[`s.serialize(ar, n)`]
[]
[
`ar` is a value of an archive with Boost.Serialization semantics and `n` is an unsigned integral value. Saves to the archive or loads serialized state from the archive. The version number `n` is the stored version when the object is loaded or the current version when the object is saved.
]
]
]
[heading Models]
* [classref boost::histogram::unlimited_storage]
* [classref boost::histogram::storage_adaptor]
* [classref boost::histogram::dense_storage]
* [classref boost::histogram::weight_storage]
* [classref boost::histogram::profile_storage]
* [classref boost::histogram::weighted_profile_storage]
[endsect]

View File

@@ -0,0 +1,70 @@
[/
Copyright Hans Dembinski 2018 - 2019.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
https://www.boost.org/LICENSE_1_0.txt)
]
[section:Transform Transform]
A [*Transform] implements a monotonic mapping between two real-valued domains, external and internal. It is used to extend the [classref boost::histogram::axis::regular regular axis]. The bins in the internal domain are of equal width, while the bins in the external domain are non-equal width. Must be [@https://en.cppreference.com/w/cpp/named_req/DefaultConstructible DefaultConstructible], [@https://en.cppreference.com/w/cpp/named_req/CopyConstructible CopyConstructible], and [@https://en.cppreference.com/w/cpp/named_req/CopyAssignable CopyAssignable].
[heading Required features]
* `T` is a type meeting the requirements of [*Transform]
* `t` is a value of type `T`
* `X` is a type with the semantics of a floating-point type
* `x` is a value of type `X`
* `Y` is a floating-point type
* `y` is a value of type `Y`
[table Valid expressions
[[Expression] [Returns] [Semantics, Pre/Post-conditions]]
[
[`t.forward(x)`]
[`Y`]
[
Const or static member function which maps the external value to the corresponding internal value. The return type `Y` may differ from `X`.
]
]
[
[`t.inverse(y)`]
[`X`]
[
Const or static member function which maps the internal value to the corresponding external value. The result of `t.inverse(t.forward(x))` must be approximately equal to `x` within floating-point precision.
]
]
[
[`t == u`]
[`bool`]
[
`u` is another value of type `T`. Returns `true` if both values have the same state. Otherwise returns `false`. May be omitted if `T` is stateless. If this binary operator is not implemented, the library considers the arguments equal, if and only if their types are the same.
]
]
]
[heading Optional features]
* `T` is a type meeting the requirements of [*Transform]
* `t` is a value of type `T`
* `ar` is a value of an archive with Boost.Serialization semantics
[table Valid expressions
[[Expression] [Returns] [Semantics, Pre/Post-conditions]]
[
[`t.serialize(ar, n)`]
[]
[
`ar` is a value of an archive with Boost.Serialization semantics and `n` is an unsigned integral value. Saves to the archive or loads serialized state from the archive. The version number `n` is the stored version when the object is loaded or the current version when the object is saved.
]
]
]
[heading Models]
* [classref boost::histogram::axis::transform::id]
* [classref boost::histogram::axis::transform::log]
* [classref boost::histogram::axis::transform::sqrt]
* [classref boost::histogram::axis::transform::pow]
[endsect]

View File

@@ -0,0 +1,189 @@
# Copyright Hans Dembinski 2018 - 2019.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# https://www.boost.org/LICENSE_1_0.txt)
import sys
import xml.etree.ElementTree as ET
import re
def log(*args):
sys.stdout.write("post-processing:" + " ".join(args) + "\n")
def select(condition, *tags):
result = []
for tag in tags:
for item in root.iter(tag):
if condition(item):
result.append(item)
return result
def is_detail(x):
if x.text is not None:
if "detail" in x.text:
return True
m = re.match("(?:typename)? *([A-Za-z0-9_\:]+)", x.text)
if m is not None:
s = m.group(1)
if s.startswith("detail") or s.endswith("_impl"):
x.text = s
return True
p = x.find("purpose")
if p is not None:
return p.text.lower().lstrip().startswith("implementation detail")
return False
def is_deprecated(x):
p = x.find("purpose")
if p is not None:
return p.text.lower().lstrip().startswith("deprecated")
return False
def sort_headers_by(x):
name = x.get("name")
return name.count("/"), name
def tail_stripper(elem):
if elem.tail:
elem.tail = elem.tail.rstrip()
for item in elem:
tail_stripper(item)
def item_sorter(elem):
if elem.tag == "namespace":
if len(elem) > 1:
items = list(elem)
items.sort(key=lambda x: x.get("name"))
elem[:] = items
for sub in elem:
item_sorter(sub)
if "ipykernel" in sys.argv[0]: # used when run interactively in Atom/Hydrogen
from pathlib import Path
for input_file in Path().rglob("reference.xml"):
input_file = str(input_file)
break
else:
input_file = sys.argv[1]
output_file = input_file.replace(".xml", "_pp.xml")
tree = ET.parse(input_file)
root = tree.getroot()
parent_map = {c: p for p in tree.iter() for c in p}
unspecified = ET.Element("emphasis")
unspecified.text = "unspecified"
# - hide all unnamed template parameters, these are used for SFINAE
# - hide all template parameters that start with Detail
for item in select(
lambda x: x.get("name") == "" or x.get("name").startswith("Detail"),
"template-type-parameter",
"template-nontype-parameter",
):
parent = parent_map[item]
assert parent.tag == "template"
parent.remove(item)
parent = parent_map[parent]
name = parent.get("name")
if name is None:
log("removing unnamed template parameter from", parent.tag)
else:
log("removing unnamed template parameter from", parent.tag, name)
# replace any type with "detail" in its name with "unspecified"
for item in select(is_detail, "type"):
log("replacing", '"%s"' % item.text, 'with "unspecified"')
item.clear()
item.append(unspecified)
# hide everything that's deprecated
for item in select(is_deprecated, "typedef"):
parent = parent_map[item]
log(
"removing deprecated",
item.tag,
item.get("name"),
"from",
parent.tag,
parent.get("name"),
)
parent.remove(item)
# hide private member functions
for item in select(
lambda x: x.get("name") == "private member functions", "method-group"
):
parent = parent_map[item]
log("removing private member functions from", parent.tag, parent.get("name"))
parent.remove(item)
# hide undocumented classes, structs, functions and replace those declared
# "implementation detail" with typedef to unspecified
for item in select(lambda x: True, "class", "struct", "function"):
purpose = item.find("purpose")
if purpose is None:
parent = parent_map[item]
log(
"removing undocumented",
item.tag,
item.get("name"),
"from",
parent.tag,
parent.get("name"),
)
if item in parent_map[item]:
parent_map[item].remove(item)
elif purpose.text.strip().lower() == "implementation detail":
log("replacing", item.tag, item.get("name"), "with unspecified typedef")
name = item.get("name")
item.clear()
item.tag = "typedef"
item.set("name", name)
type = ET.Element("type")
type.append(unspecified)
item.append(type)
parent_map = {c: p for p in tree.iter() for c in p}
# hide methods and constructors explicitly declared as "implementation detail"
for item in select(is_detail, "constructor", "method"):
name = item.get("name")
log(
"removing",
(item.tag + " " + name) if name is not None else item.tag,
"declared as implementation detail",
)
parent_map[item].remove(item)
log("sorting headers")
reference = tree.getroot()
assert reference.tag == "library-reference"
reference[:] = sorted(reference, key=sort_headers_by)
log("sorting items in each namespace")
for header in reference:
namespace = header.find("namespace")
if namespace is None:
continue
item_sorter(namespace)
log("stripping trailing whitespace")
tail_stripper(reference)
tree.write(output_file)

View File

@@ -0,0 +1,872 @@
{
"context": {
"date": "2019-08-23 10:54:47",
"host_name": "hfm-1608b.dhcp.mpi-hd.mpg.de",
"executable": "benchmark/histogram_filling",
"num_cpus": 4,
"mhz_per_cpu": 2900,
"cpu_scaling_enabled": false,
"caches": [
{
"type": "Data",
"level": 1,
"size": 32768000,
"num_sharing": 2
},
{
"type": "Instruction",
"level": 1,
"size": 32768000,
"num_sharing": 2
},
{
"type": "Unified",
"level": 2,
"size": 262144000,
"num_sharing": 2
},
{
"type": "Unified",
"level": 3,
"size": 3145728000,
"num_sharing": 4
}
],
"load_avg": [1.84229,1.78955,1.83252],
"library_build_type": "release"
},
"benchmarks": [
{
"name": "fill_1d<uniform, static_tag, SStore>",
"run_name": "fill_1d<uniform, static_tag, SStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 201228066,
"real_time": 3.5407639560329622e+00,
"cpu_time": 3.5201998114915036e+00,
"time_unit": "ns",
"items_per_second": 2.8407478369141251e+08
},
{
"name": "fill_1d<uniform, static_tag, DStore>",
"run_name": "fill_1d<uniform, static_tag, DStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 97423835,
"real_time": 7.2164261043414468e+00,
"cpu_time": 7.1876764038286955e+00,
"time_unit": "ns",
"items_per_second": 1.3912702016848242e+08
},
{
"name": "fill_1d<uniform, dynamic_tag, SStore>",
"run_name": "fill_1d<uniform, dynamic_tag, SStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 87270914,
"real_time": 7.9819768127203314e+00,
"cpu_time": 7.9507474850097237e+00,
"time_unit": "ns",
"items_per_second": 1.2577433780728066e+08
},
{
"name": "fill_1d<uniform, dynamic_tag, DStore>",
"run_name": "fill_1d<uniform, dynamic_tag, DStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 48380966,
"real_time": 1.4781245955437280e+01,
"cpu_time": 1.4733108057412503e+01,
"time_unit": "ns",
"items_per_second": 6.7874340981085882e+07
},
{
"name": "fill_n_1d<uniform, static_tag, SStore>",
"run_name": "fill_n_1d<uniform, static_tag, SStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 12463,
"real_time": 5.4906254597196537e+04,
"cpu_time": 5.4800449330016905e+04,
"time_unit": "ns",
"items_per_second": 5.9795130150605083e+08
},
{
"name": "fill_n_1d<uniform, static_tag, DStore>",
"run_name": "fill_n_1d<uniform, static_tag, DStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 4104,
"real_time": 1.6921796537772345e+05,
"cpu_time": 1.6896783625731003e+05,
"time_unit": "ns",
"items_per_second": 1.9393039957083762e+08
},
{
"name": "fill_n_1d<uniform, dynamic_tag, SStore>",
"run_name": "fill_n_1d<uniform, dynamic_tag, SStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 7679,
"real_time": 9.0078655432660860e+04,
"cpu_time": 8.9957155879671875e+04,
"time_unit": "ns",
"items_per_second": 3.6426229441747802e+08
},
{
"name": "fill_n_1d<uniform, dynamic_tag, DStore>",
"run_name": "fill_n_1d<uniform, dynamic_tag, DStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 4024,
"real_time": 1.7238823510891577e+05,
"cpu_time": 1.7216525844930418e+05,
"time_unit": "ns",
"items_per_second": 1.9032875909542966e+08
},
{
"name": "fill_2d<uniform, static_tag, SStore>",
"run_name": "fill_2d<uniform, static_tag, SStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 111417066,
"real_time": 6.0894595707589163e+00,
"cpu_time": 6.0795533782948414e+00,
"time_unit": "ns",
"items_per_second": 3.2897153385319054e+08
},
{
"name": "fill_2d<uniform, static_tag, DStore>",
"run_name": "fill_2d<uniform, static_tag, DStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 71162800,
"real_time": 9.7874032938677278e+00,
"cpu_time": 9.7716363043612766e+00,
"time_unit": "ns",
"items_per_second": 2.0467401136361986e+08
},
{
"name": "fill_2d<uniform, dynamic_tag, SStore>",
"run_name": "fill_2d<uniform, dynamic_tag, SStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 39566129,
"real_time": 1.7739621810640706e+01,
"cpu_time": 1.7701832797441469e+01,
"time_unit": "ns",
"items_per_second": 1.1298265116870099e+08
},
{
"name": "fill_2d<uniform, dynamic_tag, DStore>",
"run_name": "fill_2d<uniform, dynamic_tag, DStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 32431881,
"real_time": 2.1625506951606155e+01,
"cpu_time": 2.1585303670792367e+01,
"time_unit": "ns",
"items_per_second": 9.2655634152891338e+07
},
{
"name": "fill_n_2d<uniform, static_tag, SStore>",
"run_name": "fill_n_2d<uniform, static_tag, SStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 6156,
"real_time": 1.1291128312146183e+05,
"cpu_time": 1.1274187784275506e+05,
"time_unit": "ns",
"items_per_second": 5.8129242881163728e+08
},
{
"name": "fill_n_2d<uniform, static_tag, DStore>",
"run_name": "fill_n_2d<uniform, static_tag, DStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 3178,
"real_time": 2.1979443862555985e+05,
"cpu_time": 2.1938514789175568e+05,
"time_unit": "ns",
"items_per_second": 2.9872578262378716e+08
},
{
"name": "fill_n_2d<uniform, dynamic_tag, SStore>",
"run_name": "fill_n_2d<uniform, dynamic_tag, SStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 6095,
"real_time": 1.1306189648483110e+05,
"cpu_time": 1.1287186218211612e+05,
"time_unit": "ns",
"items_per_second": 5.8062300677080345e+08
},
{
"name": "fill_n_2d<uniform, dynamic_tag, DStore>",
"run_name": "fill_n_2d<uniform, dynamic_tag, DStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 3076,
"real_time": 2.2972354482827886e+05,
"cpu_time": 2.2899739921976565e+05,
"time_unit": "ns",
"items_per_second": 2.8618665636942893e+08
},
{
"name": "fill_3d<uniform, static_tag, SStore>",
"run_name": "fill_3d<uniform, static_tag, SStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 36665532,
"real_time": 1.8846830833536284e+01,
"cpu_time": 1.8803654614911956e+01,
"time_unit": "ns",
"items_per_second": 1.5954345372951570e+08
},
{
"name": "fill_3d<uniform, static_tag, DStore>",
"run_name": "fill_3d<uniform, static_tag, DStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 35749488,
"real_time": 1.8701713659229132e+01,
"cpu_time": 1.8662588957917379e+01,
"time_unit": "ns",
"items_per_second": 1.6074940120927253e+08
},
{
"name": "fill_3d<uniform, dynamic_tag, SStore>",
"run_name": "fill_3d<uniform, dynamic_tag, SStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 11895052,
"real_time": 4.5185718814936024e+01,
"cpu_time": 4.5102198796608732e+01,
"time_unit": "ns",
"items_per_second": 6.6515604117854491e+07
},
{
"name": "fill_3d<uniform, dynamic_tag, DStore>",
"run_name": "fill_3d<uniform, dynamic_tag, DStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 18505056,
"real_time": 3.8429066956423668e+01,
"cpu_time": 3.8362812844230255e+01,
"time_unit": "ns",
"items_per_second": 7.8200730800979272e+07
},
{
"name": "fill_n_3d<uniform, static_tag, SStore>",
"run_name": "fill_n_3d<uniform, static_tag, SStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 4489,
"real_time": 1.5267818622825525e+05,
"cpu_time": 1.5241902428157700e+05,
"time_unit": "ns",
"items_per_second": 6.4495885906207097e+08
},
{
"name": "fill_n_3d<uniform, static_tag, DStore>",
"run_name": "fill_n_3d<uniform, static_tag, DStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 2582,
"real_time": 2.6931942721553246e+05,
"cpu_time": 2.6888187451588048e+05,
"time_unit": "ns",
"items_per_second": 3.6560292573456472e+08
},
{
"name": "fill_n_3d<uniform, dynamic_tag, SStore>",
"run_name": "fill_n_3d<uniform, dynamic_tag, SStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 4531,
"real_time": 1.5418692230906966e+05,
"cpu_time": 1.5378900904877440e+05,
"time_unit": "ns",
"items_per_second": 6.3921343019267881e+08
},
{
"name": "fill_n_3d<uniform, dynamic_tag, DStore>",
"run_name": "fill_n_3d<uniform, dynamic_tag, DStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 2600,
"real_time": 2.6670942154641333e+05,
"cpu_time": 2.6633500000000047e+05,
"time_unit": "ns",
"items_per_second": 3.6909906696453655e+08
},
{
"name": "fill_6d<uniform, static_tag, SStore>",
"run_name": "fill_6d<uniform, static_tag, SStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 20029013,
"real_time": 3.5262177466417157e+01,
"cpu_time": 3.5197191194593458e+01,
"time_unit": "ns",
"items_per_second": 1.7046814806408882e+08
},
{
"name": "fill_6d<uniform, static_tag, DStore>",
"run_name": "fill_6d<uniform, static_tag, DStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 20066334,
"real_time": 3.5720304666073353e+01,
"cpu_time": 3.5658132671368826e+01,
"time_unit": "ns",
"items_per_second": 1.6826455987746134e+08
},
{
"name": "fill_6d<uniform, dynamic_tag, SStore>",
"run_name": "fill_6d<uniform, dynamic_tag, SStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 9842658,
"real_time": 7.4292744098144979e+01,
"cpu_time": 7.4136681372043981e+01,
"time_unit": "ns",
"items_per_second": 8.0931596734009266e+07
},
{
"name": "fill_6d<uniform, dynamic_tag, DStore>",
"run_name": "fill_6d<uniform, dynamic_tag, DStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 10827365,
"real_time": 6.2009205096255521e+01,
"cpu_time": 6.1859187346136224e+01,
"time_unit": "ns",
"items_per_second": 9.6994484690312773e+07
},
{
"name": "fill_n_6d<uniform, static_tag, SStore>",
"run_name": "fill_n_6d<uniform, static_tag, SStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 2527,
"real_time": 2.7697384761013224e+05,
"cpu_time": 2.7652512861100049e+05,
"time_unit": "ns",
"items_per_second": 7.1099505852351201e+08
},
{
"name": "fill_n_6d<uniform, static_tag, DStore>",
"run_name": "fill_n_6d<uniform, static_tag, DStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 1776,
"real_time": 3.8995902981663641e+05,
"cpu_time": 3.8919313063062984e+05,
"time_unit": "ns",
"items_per_second": 5.0516821733576298e+08
},
{
"name": "fill_n_6d<uniform, dynamic_tag, SStore>",
"run_name": "fill_n_6d<uniform, dynamic_tag, SStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 2540,
"real_time": 2.8008974375437916e+05,
"cpu_time": 2.7949960629921220e+05,
"time_unit": "ns",
"items_per_second": 7.0342854003710341e+08
},
{
"name": "fill_n_6d<uniform, dynamic_tag, DStore>",
"run_name": "fill_n_6d<uniform, dynamic_tag, DStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 1770,
"real_time": 3.9291520679295907e+05,
"cpu_time": 3.9218192090395401e+05,
"time_unit": "ns",
"items_per_second": 5.0131836660606700e+08
},
{
"name": "fill_1d<normal, static_tag, SStore>",
"run_name": "fill_1d<normal, static_tag, SStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 159693753,
"real_time": 4.4279285120019969e+00,
"cpu_time": 4.4209368665786348e+00,
"time_unit": "ns",
"items_per_second": 2.2619639912973931e+08
},
{
"name": "fill_1d<normal, static_tag, DStore>",
"run_name": "fill_1d<normal, static_tag, DStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 83531223,
"real_time": 8.3291107932313420e+00,
"cpu_time": 8.3144957664513157e+00,
"time_unit": "ns",
"items_per_second": 1.2027187553994113e+08
},
{
"name": "fill_1d<normal, dynamic_tag, SStore>",
"run_name": "fill_1d<normal, dynamic_tag, SStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 76574704,
"real_time": 9.1338750318840454e+00,
"cpu_time": 9.1207273879896320e+00,
"time_unit": "ns",
"items_per_second": 1.0964037816948913e+08
},
{
"name": "fill_1d<normal, dynamic_tag, DStore>",
"run_name": "fill_1d<normal, dynamic_tag, DStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 43797630,
"real_time": 1.6031159742584055e+01,
"cpu_time": 1.5999678521417648e+01,
"time_unit": "ns",
"items_per_second": 6.2501255800944380e+07
},
{
"name": "fill_n_1d<normal, static_tag, SStore>",
"run_name": "fill_n_1d<normal, static_tag, SStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 12102,
"real_time": 5.5059980173350377e+04,
"cpu_time": 5.4982482234341696e+04,
"time_unit": "ns",
"items_per_second": 5.9597163802716279e+08
},
{
"name": "fill_n_1d<normal, static_tag, DStore>",
"run_name": "fill_n_1d<normal, static_tag, DStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 4072,
"real_time": 1.6903787373779214e+05,
"cpu_time": 1.6876277013752612e+05,
"time_unit": "ns",
"items_per_second": 1.9416604724665931e+08
},
{
"name": "fill_n_1d<normal, dynamic_tag, SStore>",
"run_name": "fill_n_1d<normal, dynamic_tag, SStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 7647,
"real_time": 9.0206407726189034e+04,
"cpu_time": 9.0051131162548030e+04,
"time_unit": "ns",
"items_per_second": 3.6388215869106263e+08
},
{
"name": "fill_n_1d<normal, dynamic_tag, DStore>",
"run_name": "fill_n_1d<normal, dynamic_tag, DStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 4009,
"real_time": 1.7886117211526530e+05,
"cpu_time": 1.7802269892741489e+05,
"time_unit": "ns",
"items_per_second": 1.8406641511125767e+08
},
{
"name": "fill_2d<normal, static_tag, SStore>",
"run_name": "fill_2d<normal, static_tag, SStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 86020448,
"real_time": 7.6574110599999035e+00,
"cpu_time": 7.6460192348683353e+00,
"time_unit": "ns",
"items_per_second": 2.6157402153519955e+08
},
{
"name": "fill_2d<normal, static_tag, DStore>",
"run_name": "fill_2d<normal, static_tag, DStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 58018102,
"real_time": 1.1868452663326201e+01,
"cpu_time": 1.1852507688031469e+01,
"time_unit": "ns",
"items_per_second": 1.6874066253672022e+08
},
{
"name": "fill_2d<normal, dynamic_tag, SStore>",
"run_name": "fill_2d<normal, dynamic_tag, SStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 34430858,
"real_time": 2.0377735167336013e+01,
"cpu_time": 2.0332255443648865e+01,
"time_unit": "ns",
"items_per_second": 9.8365870207711518e+07
},
{
"name": "fill_2d<normal, dynamic_tag, DStore>",
"run_name": "fill_2d<normal, dynamic_tag, DStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 29109297,
"real_time": 2.4065971088802822e+01,
"cpu_time": 2.4027718704439771e+01,
"time_unit": "ns",
"items_per_second": 8.3237198861931324e+07
},
{
"name": "fill_n_2d<normal, static_tag, SStore>",
"run_name": "fill_n_2d<normal, static_tag, SStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 6039,
"real_time": 1.1309939591603616e+05,
"cpu_time": 1.1292515317105399e+05,
"time_unit": "ns",
"items_per_second": 5.8034900250016928e+08
},
{
"name": "fill_n_2d<normal, static_tag, DStore>",
"run_name": "fill_n_2d<normal, static_tag, DStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 3181,
"real_time": 2.1851520399226030e+05,
"cpu_time": 2.1811820182332455e+05,
"time_unit": "ns",
"items_per_second": 3.0046094022489727e+08
},
{
"name": "fill_n_2d<normal, dynamic_tag, SStore>",
"run_name": "fill_n_2d<normal, dynamic_tag, SStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 6054,
"real_time": 1.1722663081942423e+05,
"cpu_time": 1.1528675256029102e+05,
"time_unit": "ns",
"items_per_second": 5.6846080355786693e+08
},
{
"name": "fill_n_2d<normal, dynamic_tag, DStore>",
"run_name": "fill_n_2d<normal, dynamic_tag, DStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 3157,
"real_time": 2.2157955717674192e+05,
"cpu_time": 2.2109280962939636e+05,
"time_unit": "ns",
"items_per_second": 2.9641850456310076e+08
},
{
"name": "fill_3d<normal, static_tag, SStore>",
"run_name": "fill_3d<normal, static_tag, SStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 33523299,
"real_time": 1.7520512347237030e+01,
"cpu_time": 1.7487509209639512e+01,
"time_unit": "ns",
"items_per_second": 1.7155101758838999e+08
},
{
"name": "fill_3d<normal, static_tag, DStore>",
"run_name": "fill_3d<normal, static_tag, DStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 33750880,
"real_time": 2.9109775740855927e+01,
"cpu_time": 2.8235204533926133e+01,
"time_unit": "ns",
"items_per_second": 1.0625033710647772e+08
},
{
"name": "fill_3d<normal, dynamic_tag, SStore>",
"run_name": "fill_3d<normal, dynamic_tag, SStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 8611039,
"real_time": 8.0950689227726642e+01,
"cpu_time": 7.7148297667679842e+01,
"time_unit": "ns",
"items_per_second": 3.8886146430899233e+07
},
{
"name": "fill_3d<normal, dynamic_tag, DStore>",
"run_name": "fill_3d<normal, dynamic_tag, DStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 9550317,
"real_time": 7.3984094966416237e+01,
"cpu_time": 7.0974398022599473e+01,
"time_unit": "ns",
"items_per_second": 4.2268762871997148e+07
},
{
"name": "fill_n_3d<normal, static_tag, SStore>",
"run_name": "fill_n_3d<normal, static_tag, SStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 4589,
"real_time": 1.7813133845204400e+05,
"cpu_time": 1.7279211157115019e+05,
"time_unit": "ns",
"items_per_second": 5.6891486021062720e+08
},
{
"name": "fill_n_3d<normal, static_tag, DStore>",
"run_name": "fill_n_3d<normal, static_tag, DStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 2016,
"real_time": 3.9942442411316617e+05,
"cpu_time": 3.6970634920634958e+05,
"time_unit": "ns",
"items_per_second": 2.6589751626129681e+08
},
{
"name": "fill_n_3d<normal, dynamic_tag, SStore>",
"run_name": "fill_n_3d<normal, dynamic_tag, SStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 3525,
"real_time": 1.8993013307240838e+05,
"cpu_time": 1.8131914893617042e+05,
"time_unit": "ns",
"items_per_second": 5.4216005632480574e+08
},
{
"name": "fill_n_3d<normal, dynamic_tag, DStore>",
"run_name": "fill_n_3d<normal, dynamic_tag, DStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 1931,
"real_time": 3.5650791033160989e+05,
"cpu_time": 3.3617866390471230e+05,
"time_unit": "ns",
"items_per_second": 2.9241593995942479e+08
},
{
"name": "fill_6d<normal, static_tag, SStore>",
"run_name": "fill_6d<normal, static_tag, SStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 16760084,
"real_time": 4.1412771501838229e+01,
"cpu_time": 4.1253850517694232e+01,
"time_unit": "ns",
"items_per_second": 1.4544096913878462e+08
},
{
"name": "fill_6d<normal, static_tag, DStore>",
"run_name": "fill_6d<normal, static_tag, DStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 16163743,
"real_time": 8.2617684463603979e+01,
"cpu_time": 7.8523582068831573e+01,
"time_unit": "ns",
"items_per_second": 7.6410166753989488e+07
},
{
"name": "fill_6d<normal, dynamic_tag, SStore>",
"run_name": "fill_6d<normal, dynamic_tag, SStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 4694269,
"real_time": 1.2857380325218378e+02,
"cpu_time": 1.2407810459945807e+02,
"time_unit": "ns",
"items_per_second": 4.8356638097985633e+07
},
{
"name": "fill_6d<normal, dynamic_tag, DStore>",
"run_name": "fill_6d<normal, dynamic_tag, DStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 9802823,
"real_time": 9.5223963434273657e+01,
"cpu_time": 9.3830726108183441e+01,
"time_unit": "ns",
"items_per_second": 6.3944938389181979e+07
},
{
"name": "fill_n_6d<normal, static_tag, SStore>",
"run_name": "fill_n_6d<normal, static_tag, SStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 2425,
"real_time": 2.8317312709987164e+05,
"cpu_time": 2.8184247422680614e+05,
"time_unit": "ns",
"items_per_second": 6.9758115961536837e+08
},
{
"name": "fill_n_6d<normal, static_tag, DStore>",
"run_name": "fill_n_6d<normal, static_tag, DStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 1765,
"real_time": 3.9564881858972582e+05,
"cpu_time": 3.9372294617563381e+05,
"time_unit": "ns",
"items_per_second": 4.9935621459130341e+08
},
{
"name": "fill_n_6d<normal, dynamic_tag, SStore>",
"run_name": "fill_n_6d<normal, dynamic_tag, SStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 2434,
"real_time": 2.8696620049400465e+05,
"cpu_time": 2.8440838126540440e+05,
"time_unit": "ns",
"items_per_second": 6.9128764463705885e+08
},
{
"name": "fill_n_6d<normal, dynamic_tag, DStore>",
"run_name": "fill_n_6d<normal, dynamic_tag, DStore>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 1760,
"real_time": 3.9788846651473170e+05,
"cpu_time": 3.9605852272727678e+05,
"time_unit": "ns",
"items_per_second": 4.9641148647969621e+08
}
]
}

View File

@@ -0,0 +1,88 @@
{
"context": {
"date": "2019-06-12 15:07:42",
"host_name": "hfm-1608b.dhcp.mpi-hd.mpg.de",
"executable": "./histogram_filling_gsl",
"num_cpus": 4,
"mhz_per_cpu": 2900,
"cpu_scaling_enabled": false,
"caches": [
{
"type": "Data",
"level": 1,
"size": 32768000,
"num_sharing": 2
},
{
"type": "Instruction",
"level": 1,
"size": 32768000,
"num_sharing": 2
},
{
"type": "Unified",
"level": 2,
"size": 262144000,
"num_sharing": 2
},
{
"type": "Unified",
"level": 3,
"size": 3145728000,
"num_sharing": 4
}
],
"load_avg": [1.89209,1.73828,1.89551],
"library_build_type": "release"
},
"benchmarks": [
{
"name": "fill_1d<uniform>",
"run_name": "fill_1d<uniform>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 92225399,
"real_time": 7.3727007131844076e+00,
"cpu_time": 7.3568670600167314e+00,
"time_unit": "ns"
},
{
"name": "fill_2d<uniform>",
"run_name": "fill_2d<uniform>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 41455441,
"real_time": 1.6783869479827938e+01,
"cpu_time": 1.6761635704225167e+01,
"time_unit": "ns"
},
{
"name": "fill_1d<normal>",
"run_name": "fill_1d<normal>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 88302449,
"real_time": 7.8366695917512184e+00,
"cpu_time": 7.8247206937601472e+00,
"time_unit": "ns"
},
{
"name": "fill_2d<normal>",
"run_name": "fill_2d<normal>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 36811687,
"real_time": 1.8602898475683215e+01,
"cpu_time": 1.8578963794840472e+01,
"time_unit": "ns"
}
]
}

View File

@@ -0,0 +1,127 @@
#!/usr/bin/env python3
# Copyright Hans Dembinski 2018 - 2019.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# https://www.boost.org/LICENSE_1_0.txt)
import os
import numpy as np
import glob
import re
import json
import sys
from collections import defaultdict, OrderedDict
from matplotlib.patches import Rectangle
from matplotlib.lines import Line2D
from matplotlib.text import Text
from matplotlib.font_manager import FontProperties
import matplotlib.pyplot as plt
import matplotlib as mpl
mpl.rcParams.update(mpl.rcParamsDefault)
cpu_frequency = 0
data = defaultdict(lambda: [])
hostname = None
for fn in sys.argv[1:]:
d = json.load(open(fn))
cpu_frequency = d["context"]["mhz_per_cpu"]
# make sure we don't compare benchmarks from different computers
if hostname is None:
hostname = d["context"]["host_name"]
else:
assert hostname == d["context"]["host_name"]
for bench in d["benchmarks"]:
name = bench["name"]
time = min(bench["cpu_time"], bench["real_time"])
m = re.match("fill_(n_)?([0-9])d<([^>]+)>", name)
if m.group(1):
time /= 1 << 15
tags = m.group(3).split(", ")
dim = int(m.group(2))
label = re.search(
"fill_([a-z]+)", os.path.splitext(os.path.split(fn)[1])[0]
).group(1)
dist = tags[0]
if len(tags) > 1 and tags[1] in ("dynamic_tag", "static_tag"):
if len(tags) == 3 and "DStore" in tags[2]:
continue
label += "-" + {"dynamic_tag": "dyn", "static_tag": "sta"}[tags[1]]
label += "-fill" if m.group(1) else "-call"
data[dim].append((label, dist, time / dim))
time_per_cycle_in_ns = 1.0 / (cpu_frequency * 1e6) / 1e-9
plt.figure(figsize=(7, 6))
i = 0
for dim in sorted(data):
v = data[dim]
labels = OrderedDict()
for label, dist, time in v:
if label in labels:
labels[label][dist] = time / time_per_cycle_in_ns
else:
labels[label] = {dist: time / time_per_cycle_in_ns}
j = 0
for label, d in labels.items():
t1 = d["uniform"]
t2 = d["normal"]
i -= 1
z = float(j) / len(labels)
col = (1.0 - z) * np.array((1.0, 0.0, 0.0)) + z * np.array((1.0, 1.0, 0.0))
if label == "root":
col = "k"
label = "ROOT 6"
if "numpy" in label:
col = "0.6"
if "gsl" in label:
col = "0.3"
label = "GSL"
tmin = min(t1, t2)
tmax = max(t1, t2)
r1 = Rectangle((0, i), tmax, 1, facecolor=col)
r2 = Rectangle(
(tmin, i), tmax - tmin, 1, facecolor="none", edgecolor="w", hatch="//////"
)
plt.gca().add_artist(r1)
plt.gca().add_artist(r2)
font = FontProperties(size=9)
tx = Text(
-0.5,
i + 0.5,
"%s" % label,
fontproperties=font,
va="center",
ha="right",
clip_on=False,
)
plt.gca().add_artist(tx)
j += 1
i -= 1
font = FontProperties()
font.set_weight("bold")
tx = Text(
-0.5,
i + 0.6,
"%iD" % dim,
fontproperties=font,
va="center",
ha="right",
clip_on=False,
)
plt.gca().add_artist(tx)
plt.ylim(0, i)
plt.xlim(0, 80)
from matplotlib.ticker import MultipleLocator
plt.gca().xaxis.set_major_locator(MultipleLocator(5))
plt.tick_params("y", left=False, labelleft=False)
plt.xlabel("average CPU cycles per random input value (smaller is better)")
plt.tight_layout()
plt.savefig("fill_performance.svg")
plt.show()

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 68 KiB

View File

@@ -0,0 +1,136 @@
{
"context": {
"date": "2019-06-12 15:07:51",
"host_name": "hfm-1608b.dhcp.mpi-hd.mpg.de",
"executable": "./histogram_filling_root",
"num_cpus": 4,
"mhz_per_cpu": 2900,
"cpu_scaling_enabled": false,
"caches": [
{
"type": "Data",
"level": 1,
"size": 32768000,
"num_sharing": 2
},
{
"type": "Instruction",
"level": 1,
"size": 32768000,
"num_sharing": 2
},
{
"type": "Unified",
"level": 2,
"size": 262144000,
"num_sharing": 2
},
{
"type": "Unified",
"level": 3,
"size": 3145728000,
"num_sharing": 4
}
],
"load_avg": [1.90039,1.74219,1.896],
"library_build_type": "release"
},
"benchmarks": [
{
"name": "fill_1d<uniform>",
"run_name": "fill_1d<uniform>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 67261773,
"real_time": 9.4458418900399934e+00,
"cpu_time": 9.4251752774937998e+00,
"time_unit": "ns"
},
{
"name": "fill_2d<uniform>",
"run_name": "fill_2d<uniform>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 45319470,
"real_time": 1.5382299770944382e+01,
"cpu_time": 1.5349252760458143e+01,
"time_unit": "ns"
},
{
"name": "fill_3d<uniform>",
"run_name": "fill_3d<uniform>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 17250220,
"real_time": 4.4192850235360673e+01,
"cpu_time": 4.4075205997372791e+01,
"time_unit": "ns"
},
{
"name": "fill_6d<uniform>",
"run_name": "fill_6d<uniform>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 9471106,
"real_time": 6.5593678499542435e+01,
"cpu_time": 6.5478836368212981e+01,
"time_unit": "ns"
},
{
"name": "fill_1d<normal>",
"run_name": "fill_1d<normal>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 65220632,
"real_time": 1.0719608451340857e+01,
"cpu_time": 1.0705784022454727e+01,
"time_unit": "ns"
},
{
"name": "fill_2d<normal>",
"run_name": "fill_2d<normal>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 41358692,
"real_time": 1.7807308218952659e+01,
"cpu_time": 1.7752785798931928e+01,
"time_unit": "ns"
},
{
"name": "fill_3d<normal>",
"run_name": "fill_3d<normal>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 18161251,
"real_time": 3.6989106697171536e+01,
"cpu_time": 3.6909516860925535e+01,
"time_unit": "ns"
},
{
"name": "fill_6d<normal>",
"run_name": "fill_6d<normal>",
"run_type": "iteration",
"repetitions": 0,
"repetition_index": 0,
"threads": 1,
"iterations": 7976026,
"real_time": 8.4004558279849917e+01,
"cpu_time": 8.3852284333075062e+01,
"time_unit": "ns"
}
]
}

View File

@@ -0,0 +1,76 @@
[/
Copyright Hans Dembinski 2018 - 2019.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
https://www.boost.org/LICENSE_1_0.txt)
]
[section:getting_started Getting started]
Here are some commented examples to copy-paste from, this should allow you to kick off a project with Boost.Histogram. If you prefer a traditional structured exposition, go to the [link histogram.guide user guide].
Boost.Histogram uses /axis/ objects to convert input values into indices. The library comes with several builtin axis types, which can be configured via template parameters. This already gives you a lot of flexibility should you need it, otherwise just use the defaults. Beyond that, you can easily write your own axis type.
[section 1d-histogram with axis types known at compile-time]
When the axis types for the histogram are known at compile-time, the library generates the fastest and most efficient code for you. Here is such an example.
[import ../examples/getting_started_listing_01.cpp]
[getting_started_listing_01]
We passed the [classref boost::histogram::axis::regular regular] axis type directly to the [headerref boost/histogram/make_histogram.hpp make_histogram] function. The library then generates a specialized histogram type with just one regular axis from a generic template.
* Pro: Many user errors are already caught at compile-time, not at run-time.
* Con: You get template errors if you make a mistake, which may be hard to read. We try to give you useful error messages, but still.
[endsect]
[section 3d-histogram (axis configuration defined at run-time)]
Sometimes, you don't know the number or types of axes at compile-time, because it depends on run-time information. Perhaps you want to write a command-line tool that generates histograms from input data, or you use this library as a back-end for a product with a GUI. This is possible as well, here is the example.
[import ../examples/getting_started_listing_02.cpp]
[getting_started_listing_02]
The axis configuration is passed to `make_histogram` as a `std::vector<axis::variant<...>>`, which can hold arbitrary sequences of axis types from a predefined set.
Run-time configurable histograms are a slower than their compile-time brethren, but still pretty fast.
[note
If you know already at compile-time that you will only use one axis type, `axis::regular<>` for example, but not how many per histogram, then you can also pass a `std::vector<axis::regular<>>` to `make_histogram`. You get almost the same speed as in the very first case, where both the axis configuration was fully known at compile-time.
]
[note
If you care about maximum performance: In this example, `axis::category<std::string>` is used with two string labels "red" and "blue". It is faster to use an enum, `enum { red, blue };` and a `axis::category<>` axis.
]
[endsect]
[section 1d-profile]
The library was designed to be very flexible and modular. The modularity is used, for example, to also provide profiles. Profiles are generalized histograms. A histogram counts how often an input falls into a particular cell. A profile accepts pairs of input values and a sample value. The profile computes the mean of the samples that end up in each cell. Have a look at the example, which should clear up any confusion.
[import ../examples/getting_started_listing_03.cpp]
[getting_started_listing_03]
[endsect]
[section Standard library algorithms]
The library was designed to work well with the C++ standard library. Here is an example on how to get the most common color from an image, using a 3d histogram and `std::max_element`.
[import ../examples/getting_started_listing_04.cpp]
[getting_started_listing_04]
[endsect]
[section Making classes that hold histograms]
The histograms get their great flexibility and performance from being templated, but this can make the types a bit cumbersome to write. Often it is possible to use `auto` to let the compiler deduce the type, but when you want to store histograms in a class, you need to write the type explicitly. The next example shows how this works.
[import ../examples/getting_started_listing_05.cpp]
[getting_started_listing_05]
[endsect]
[endsect]

View File

@@ -0,0 +1,477 @@
[/
Copyright Hans Dembinski 2018 - 2019.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
https://www.boost.org/LICENSE_1_0.txt)
]
[section:guide User guide]
Boost.Histogram is designed to make simple things simple, yet complex things possible. Correspondingly, this guides covers the basic usage first, and the advanced usage in later sections. For an alternative quick start guide, have a look at the [link histogram.getting_started Getting started] section.
[section Making histograms]
A histogram consists of a collection of [link histogram.concepts.Axis axis objects] and a [link histogram.concepts.Storage storage]. The storage holds a collection of accumulators, one for each cell. The axis objects maps input values to indices, which are combined into a global index that is used to look up the cell in the storage.
To start off you do not have to worry about the storage, the library provides a good default. Learning more about the many interesting axis types to choose from, however, will pay off very quickly (which are discussed further below). For now, let us stick to the most common axis, the [classref boost::histogram::axis::regular regular] axis. It represents equidistant intervals on the real line.
Histograms are created with the convenient factory function [headerref boost/histogram/make_histogram.hpp make_histogram]. The following example shows how to make a histogram with a single axis.
[import ../examples/guide_make_static_histogram.cpp]
[guide_make_static_histogram]
An axis object defines how input values are mapped to bins, it is a mapping functor of input values to indices. The axis object holds information such as how many bins there are, where the bin edges are, metadata about the axis and so on. The rank of a histogram is given by the number of axes. A histogram with one axis is one-dimensional. If you provide two, it is two-dimensional, and so on.
In the example above, the compiler knows the number of axes and their type at compile-time, the information can be deduced from the arguments to [headerref boost/histogram/make_histogram.hpp make_histogram]. This gives the best performance, but sometimes you only know the axis configuration at run-time, because it depends on information that's only available at run-time. For that case you can also create axes at run-time and pass them to an overload of the [headerref boost/histogram/make_histogram.hpp make_histogram] function. Here is an example.
[import ../examples/guide_make_dynamic_histogram.cpp]
[guide_make_dynamic_histogram]
[note
When the axis types are known at compile-time, the histogram internally holds them in a `std::tuple`, which is very efficient and avoids a heap memory allocation. If the number of axes is only known at run-time, they are stored in a `std::vector`. The interface hides this difference very well, but there are a corner cases where the difference becomes apparent. The [link histogram.overview.structure.host overview] has more details on this point.
]
The factory function named [headerref boost/histogram/make_histogram.hpp make_histogram] uses the default storage type, which provides safe counting, is fast, and memory efficient. If you want to create a histogram with another storage type, use [headerref boost/histogram/make_histogram.hpp make_histogram_with]. To learn more about other storage types and how to create your own, have a look at the section [link histogram.guide.expert Advanced Usage].
[endsect] [/ how to make histograms]
[section Axis guide]
The library provides a number of useful axis types. The builtin axis types can be configured to fit many needs. If you still need something more exotic, no problem, it is easy to write your own axis types, see the [link histogram.guide.expert Advanced usage section] for details. In the following, we give some advice when to use which of the builtin axis types.
[section Overview]
[variablelist
[
[
[classref boost::histogram::axis::regular regular]
]
[
Axis over intervals on the real line which have equal width. Value-to-index conversion is O(1) and very fast. The axis does not allocate memory dynamically. The axis is very flexible thanks to transforms (see below). Due to finite precision of floating point calculations, bin edges may not be exactly at expected values, though. If you need bin edges at exactly defined floating point values, use the [classref boost::histogram::axis::variable variable] axis. If you need bins at exact consecutive integral values, use the [classref boost::histogram::axis::integer integer] axis.
]
]
[
[
[classref boost::histogram::axis::variable variable]
]
[
Axis over intervals on the real line of variable width. Value-to-index conversion is O(log(N)). The axis allocates memory dynamically to store the bin edges. Use this if the regular axis with transforms cannot represent the binning you want. If you need bin edges at exactly defined floating point values, use this axis.
]
]
[
[
[classref boost::histogram::axis::integer integer]
]
[
Axis over an integer sequence [i, i+1, i+2, ...]. It can be configured to handle real input values, too, and then acts like a fast regular axis with a fixed bin width of 1. Value-to-index conversion is O(1) and faster than for the [classref boost::histogram::axis::regular regular] axis. Does not allocate memory dynamically. Use this when your input consists of an integer range or pre-digitized values with low dynamic range, like pixel values for individual colours in an image.
]
]
[
[
[classref boost::histogram::axis::boolean boolean]
]
[
Axis over the two values [false, true]. It is a common specialization of the [classref boost::histogram::axis::regular regular] axis. Value-to-index conversion is a pass-through operation, so this is the fastest possible axis. The axis has no state other than the metadata (which can be stateless). Does not allocate memory dynamically. Use this when your input consists of binary categories, like signal and background.
]
]
[
[
[classref boost::histogram::axis::category category]
]
[
Axis over a set of unique values of an arbitrary equal-comparable type. Value-to-index conversion is O(N), but still faster than the O(logN) complexity of the [classref boost::histogram::axis::variable variable] axis for N < 10, the typical use case. The axis allocates memory from the heap to store the values.
]
]
]
Here is an example which shows the basic use case for each axis type.
[import ../examples/guide_axis_basic_demo.cpp]
[guide_axis_basic_demo]
[note All builtin axes over a continuous value range use semi-open intervals in their constructors as a convention. As a mnemonic, think of iterator ranges from `begin` to `end`, where `end` is also never included.]
As mentioned in the previous example, you can assign an optional label to any axis to keep track of what the axis is about. Assume you have census data and you want to investigate how yearly income correlates with age, you could do:
[import ../examples/guide_axis_with_labels.cpp]
[guide_axis_with_labels]
Without the metadata it would be difficult to see which axis was covering which quantity. Metadata is the only axis property that can be modified after construction by the user. Axis objects with different metadata do not compare equal.
By default, strings are used to store the metadata, but any type compatible with the [link histogram.concepts.Axis [*Metadata] concept] can be used.
[endsect]
[section Axis configuration]
All builtin axis types have template arguments for customisation. All arguments have reasonable defaults so you can use empty brackets. If your compiler supports C++17, you can drop the brackets altogether. Suitable arguments are then deduced from the constructor call. The template arguments are in order:
[variablelist
[
[Value]
[
The value type is the argument type of the `index()` method. An argument passed to the axis must be implicitly convertible to this type.
]
]
[
[Transform (only [classref boost::histogram::axis::regular regular] axis)]
[
A class that implements a monotonic transform between the data space and the space in which the bins are equi-distant. Users can define their own transforms and use them with the axis.
]
]
[
[Metadata]
[
The axis uses an instance this type to store metadata. It is a `std::string` by default, but it can by any copyable type. If you want to save a small amount of stack memory per axis, you pass the empty `boost::histogram::axis::null_type` here.
]
]
[
[Options]
[
[headerref boost/histogram/axis/option.hpp Compile-time options] for the axis. This is used to enable/disable under- and overflow bins, to make an axis circular, or to enable dynamic growth of the axis beyond the initial range.
]
]
[
[Allocator (only [classref boost::histogram::axis::variable variable] and [classref boost::histogram::axis::category category] axes)]
[
Allocator that is used to request memory dynamically to store values. If you don't know what an allocator is you can safely ignore this argument.
]
]
]
You can use the `boost::histogram::use_default` tag type for any of these options, except for the Value and Allocator, to use the library default.
[section Transforms]
Transforms are a way to customize a [classref boost::histogram::axis::regular regular] axis. Transforms allow you to chose the faster stack-allocated regular axis over the generic [classref boost::histogram::axis::variable variable axis] in some cases. The default is the identity transform which does nothing. A common need is a regular binning in the logarithm of the input value. This can be achieved with a [classref boost::histogram::axis::transform::log log] transform. The follow example shows the builtin transforms.
[import ../examples/guide_axis_with_transform.cpp]
[guide_axis_with_transform]
Due to the finite precision of floating point calculations, the bin edges of a transformed regular axis may not be exactly at the expected values. If you need exact correspondence, use a [classref boost::histogram::axis::variable variable] axis.
Users may write their own transforms and use them with the builtin [classref boost::histogram::axis::regular regular] axis, by implementing a type that matches the [link histogram.concepts.Transform [*Transform] concept].
[endsect]
[section Options]
[headerref boost/histogram/axis/option.hpp Options] can be used to configure each axis type. The option flags are implemented as tag types with the suffix `_t`. Each tag type has a corresponding value without the suffix. The values have set semantics: You can compute the union with `operator|` and the intersection with `operator&`. When you pass a single option flag to an axis as a template parameter, use the tag type. When you need to pass the union of several options to an axis as a template parameter, surround the union of option values with a `decltype`. Both ways of passing options are shown in the following examples.
[*Under- and overflow bins]
Under- and overflow bins are added automatically for most axis types. If you create an axis with 10 bins, the histogram will actually have 12 bins along that axis. The extra bins are very useful, as explained in the [link histogram.rationale.uoflow rationale]. If the input cannot exceed the axis range or if you are really tight on memory, you can disable the extra bins. A demonstration:
[import ../examples/guide_axis_with_uoflow_off.cpp]
[guide_axis_with_uoflow_off]
The [classref boost::histogram::axis::category category] axis by default comes only with an overflow bin, which counts all input values that are not part of the initial set.
[*Circular axes]
Each builtin axis except the [classref boost::histogram::axis::category category] axis can be made circular. This means that the axis is periodic at its ends. This is useful if you want make a histogram over a polar angle. Example:
[import ../examples/guide_axis_circular.cpp]
[guide_axis_circular]
A circular axis cannot have an underflow bin, passing both options together generates a compile-time error. Since the highest bin wraps around to the lowest bin, there is no possibility for overflow either. However, an overflow bin is still added by default if the value is a floating point type, to catch NaNs and infinities.
[*Growing axes]
Each builtin axis has an option to make it grow beyond its initial range when a value outside of that range is passed to it, while the default behaviour is to count this value in the under- or overflow bins (or to discard it). Example:
[import ../examples/guide_axis_growing.cpp]
[guide_axis_growing]
This feature can be very convenient, but keep two caveats in mind.
* Growing axes come with a run-time cost, since the histogram has to reallocate memory
for all cells when an axis changes its size. Whether this performance hit is noticeable depends on your application. This is a minor issue, the next is more severe.
* If you have unexpected outliers in your data which are far away from the normal range,
the axis could grow to a huge size and the corresponding huge memory request could bring the computer to its knees. This is one of the reason why growing axes are not the default.
A growing axis can have under- and overflow bins, but these only count the special floating point values: positive and negative infinity, and NaN.
[endsect] [/ options]
[endsect] [/ axis configuration]
[endsect] [/ choose the right axis]
[section Filling histograms and accessing cells]
A histogram has been created and now you want to insert values. This is done with the flexible [memberref boost::histogram::histogram::operator() call operator] or the [memberref boost::histogram::histogram::fill fill method], which you typically call in a loop. The [memberref boost::histogram::histogram::operator() call operator] accepts `N` arguments or a `std::tuple` with `N` elements, where `N` is equal to the number of axes of the histogram. It finds the corresponding bin for the input and increments the bin counter by one. The [memberref boost::histogram::histogram::fill fill method] accepts a single iterable over other iterables (which must have have elements contiguous in memory) or values, see the method documentation for details.
After the histogram has been filled, use the [memberref boost::histogram::histogram::at at method] (in analogy to `std::vector::at`) to access the cell values. It accepts integer indices, one for each axis of the histogram.
[import ../examples/guide_fill_histogram.cpp]
[guide_fill_histogram]
For a histogram `hist`, the calls `hist(weight(w), ...)` and `hist(..., weight(w))` increment the bin counter by the value `w` instead, where `w` may be an integer or floating point number. The helper function [funcref boost::histogram::weight() weight()] marks this argument as a weight, so that it can be distinguished from the other inputs. It can be the first or last argument. You can freely mix calls with and without a weight. Calls without `weight` act like the weight is `1`. Why weighted increments are sometimes useful is explained [link histogram.rationale.weights in the rationale].
[note The default storage loses its no-overflow-guarantee when you pass floating point weights, but maintains it for integer weights.]
When the weights come from a stochastic process, it is useful to keep track of the variance of the sum of weights per cell. A specialized histogram can be generated with the [funcref boost::histogram::make_weighted_histogram make_weighted_histogram] factory function which does that.
[import ../examples/guide_fill_weighted_histogram.cpp]
[guide_fill_weighted_histogram]
To iterate over all cells, the [funcref boost::histogram::indexed indexed] range generator is very convenient and also efficient. For almost all configurations, the range generator iterates /faster/ than a naive for-loop. Under- and overflow are skipped by default.
[import ../examples/guide_indexed_access.cpp]
[guide_indexed_access]
[endsect] [/ fill a histogram]
[section Using profiles]
Histograms from this library can do more than counting, they can hold arbitrary accumulators which accept samples. We call a histogram with accumulators that compute the mean of samples in each cell a /profile/. Profiles can be generated with the factory function [funcref boost::histogram::make_profile make_profile].
[import ../examples/guide_fill_profile.cpp]
[guide_fill_profile]
Just like [funcref boost::histogram::weight weight()], [funcref boost::histogram::sample sample()] is a marker function. It must be the first or last argument.
Weights and samples may be combined, if the accumulators can handle weights. When both [funcref boost::histogram::weight weight()] and [funcref boost::histogram::sample sample()] appear in the [memberref boost::histogram::histogram::operator() call operator] or the [memberref boost::histogram::histogram::fill fill method], they can be in any order with respect to other, but they must be the first or last arguments. To make a profile which can compute weighted means with proper uncertainty estimates, use the [funcref boost::histogram::make_weighted_profile make_weighted_profile] factory function.
[import ../examples/guide_fill_weighted_profile.cpp]
[guide_fill_weighted_profile]
[endsect]
[section Using operators]
The following operators are supported for pairs of histograms `+, -, *, /, ==, !=`. Histograms can also be multiplied and divided by a scalar. Only a subset of the arithmetic operators is available when the underlying accumulator only supports that subset.
The arithmetic operators can only be used when the histograms have the same axis configuration. This checked at run-time. An exception is thrown if the configurations do not match. Two histograms have the same axis configuration, if all axes compare equal, which includes a comparison of their metadata. Two histograms compare equal, when their axis configurations and all their cell values compare equal.
[note If the metadata type has `operator==` defined, it is used in the axis configuration comparison. Metadata types without `operator==` are considered equal, if they are the same type.]
[import ../examples/guide_histogram_operators.cpp]
[guide_histogram_operators]
[note A histogram with default storage converts its cell values to double when they are to be multiplied with or divided by a real number, or when a real number is added or subtracted. At this point the no-overflow-guarantee is lost.]
[note When the storage tracks weight variances, such as [classref boost::histogram::weight_storage], adding two copies of a histogram produces a different result than scaling the histogram by a factor of two, as shown in the last example. The is a consequence of the mathematical properties of variances. They can be added like normal numbers, but scaling by `s` means that variances are scaled by `s^2`.]
[endsect]
[section Using algorithms]
The library was designed to work with algorithms from the C++ standard library. In addition, a support library of algorithms is included with common operations on histograms.
[section Algorithms from the C++ standard library]
The histogram class has standard random-access iterators which can be used with various algorithms from the standard library. Some things need to be kept in mind:
* The histogram iterators also walk over the under- and overflow bins, if they are present. To skip the extra bins one should use the fast iterators from the [funcref boost::histogram::indexed] range generator instead.
* The iteration order for histograms with several axes is an implementation-detail, but for histograms with one axis it is guaranteed to be the obvious order: bins are accessed in order from the lowest to the highest index.
[import ../examples/guide_stdlib_algorithms.cpp]
[guide_stdlib_algorithms]
[endsect]
[section Summation]
It is easy to iterate over all histogram cells to compute the sum of cell values by hand or to use an algorithm from the standard library to do so, but it is not safe. The result may not be accurate or overflow, if the sum is represented by an integer type. The library provides [funcref boost::histogram::algorithm::sum] as a safer, albeit slower, alternative. It uses the [@https://en.wikipedia.org/wiki/Kahan_summation_algorithm Neumaier algorithm] in double precision for integers and floating point cells, and does the naive sum otherwise.
[endsect]
[section Projection]
It is sometimes convenient to generate a high-dimensional histogram first and then extract smaller or lower-dimensional versions from it. Lower-dimensional histograms are obtained by summing the bin contents of the removed axes. This is called a /projection/. If the histogram has under- and overflow bins along all axes, this operation creates a histogram which is identical to one that would have been obtained by filling the original data.
Projection is useful if you found out that there is no interesting structure along an axis, so it is not worth keeping that axis around, or if you want to visualize 1d or 2d summaries of a high-dimensional histogram.
The library provides the [funcref boost::histogram::algorithm::project] function for this purpose. It accepts the original histogram and the indices (one or more) of the axes that are kept and returns the lower-dimensional histogram. If the histogram is static, meaning the axis configuration is known at compile-time, compile-time numbers should be used as indices to obtain another static histogram. Using normal numbers or iterators over indices produces a histogram with a dynamic axis configuration.
[import ../examples/guide_histogram_projection.cpp]
[guide_histogram_projection]
[endsect]
[section Reduction]
A projection removes an axis completely. A less drastic way to obtain a smaller histogram is the [funcref boost::histogram::algorithm::reduce reduce] function, which allows one to /slice/, /shrink/ or /rebin/ individual axes.
Shrinking means that the value range of an axis is reduced and the number of bins along that axis. Slicing does the same, but is based on axis indices while shrinking is based on the axis values. To /rebin/ means that adjacent bins are merged into larger bins, the histogram is made coarser. For N adjacent bins, a new bin is formed which covers the common interval of the merged bins and has their added content. These two operations can be combined and applied to several axes at once. Doing it in one step is much more efficient than doing it in several steps.
The [funcref boost::histogram::algorithm::reduce reduce] function does not change the total count if all modified axes in the histogram have underflow and overflow bins. Counts in removed bins are added to the corresponding under- and overflow bins. As in case of the [funcref boost::histogram::algorithm::project project] function, such a histogram is guaranteed to be identical to one obtained from filling the original data.
[import ../examples/guide_histogram_reduction.cpp]
[guide_histogram_reduction]
[endsect]
[endsect] [/ Algorithms]
[section Streaming]
Simple streaming operators are shipped with the library. They are internally used by the unit tests and give simple text representations of axis and histogram configurations and show the histogram content. One-dimensional histograms are rendered as ASCII drawings. The text representations may be useful for debugging or more, but users may want to use their own implementations. Therefore, the headers with the builtin implementations are not included by any other header of the library. The following example shows the effect of output streaming.
[import ../examples/guide_histogram_streaming.cpp]
[guide_histogram_streaming]
[endsect]
[section Serialization]
The library supports serialization via [@boost:/libs/serialization/index.html Boost.Serialization]. The serialization code is not included by the super header `#include <boost/histogram.hpp>`, so that the library can be used without Boost.Serialization or with another compatible serialization library.
[import ../examples/guide_histogram_serialization.cpp]
[guide_histogram_serialization]
[endsect]
[section Using histograms in APIs]
Letting the compiler deduce the histogram type is recommended, because the templated type is tedious to write down explicitly. Functions or methods which accept or return histograms should be templated to work with all kinds of histograms. It is also possible to write templated versions which accept only histograms with dynamic axes or only histograms with static axes. The following example demonstrates all this.
[import ../examples/guide_histogram_in_api.cpp]
[guide_histogram_in_api]
If the histogram type has to be written down explicitly, the types are constructed as follows. In all cases, the `default_storage` type argument may be replaced by any other storage type or omitted entirely.
* Histogram with fixed axis types:
```
boost::histogram::histogram<
std::tuple<axis_type_1, axis_type_2, ..., axis_type_N>
, boost::histogram::default_storage
>
```
* Histogram with a variable number of the same axis type:
```
boost::histogram::histogram<
std::vector<
axis_type_1
>
, boost::histogram::default_storage
>
```
* Histogram with variable axis types:
```
boost::histogram::histogram<
std::vector<
boost::histogram::axis::variant<
axis_type_1, axis_type_2, ..., axis_type_N
>
>
, boost::histogram::default_storage
>
```
[endsect] [/Using histograms in APIs]
[section:expert Advanced usage]
The library is customisable and extensible by users. Users can create new axis types and use them with the histogram, or implement a custom storage policy, or use a builtin storage policy with a custom counter type. The library was designed to make this very easy. This section shows how to do this.
[section User-defined axes]
It is easy to make custom axis classes that work with the library. The custom axis class must meet the requirements of the [link histogram.concepts.Axis [*Axis] concept].
Users can create a custom axis by derive from a builtin axis type and customize its behavior. The following examples demonstrates a modification of the [classref boost::histogram::axis::integer integer axis].
[import ../examples/guide_custom_modified_axis.cpp]
[guide_custom_modified_axis]
How to make an axis completely from scratch is shown in the next example.
[import ../examples/guide_custom_minimal_axis.cpp]
[guide_custom_minimal_axis]
Such minimal axis types lack many features provided by the builtin axis types, for example, one cannot iterate over them, but this functionality can be added as needed.
[endsect]
[section Axis with several arguments]
Multi-dimensional histograms usually have an orthogonal system of axes. Orthogonal means that each axis takes care of only one value and computes its local index independently of all the other axes and values. A checker-board is such an orthogonal grid in 2D.
There are other interesting grids which are not orthogonal, notably the honeycomb grid. In such a grid, each cell is hexagonal and even though the cells form a perfectly regular pattern, it is not possible to sort values into these cells using two orthogonal axes.
The library supports non-orthogonal grids by allowing axis types to accept a `std::tuple` of values. The axis can compute an index from the values passed to it in an arbitrary way. The following example demonstrates this.
[import ../examples/guide_custom_2d_axis.cpp]
[guide_custom_2d_axis]
[endsect]
[section User-defined storage class]
Histograms which use a different storage class can easily created with the factory function [headerref boost/histogram/make_histogram.hpp make_histogram_with]. For convenience, this factory function accepts many standard containers as storage backends: vectors, arrays, and maps. These are automatically wrapped with a [classref boost::histogram::storage_adaptor] to provide the storage interface needed by the library. Users may also place custom accumulators in the vector, as described in the next section.
[warning The no-overflow-guarantee is only valid if the [classref boost::histogram::unlimited_storage unlimited_storage] (the default) is used. If you change the storage policy, you need to know what you are doing.]
A `std::vector` may provide higher performance than the [classref boost::histogram::unlimited_storage unlimited_storage] with a carefully chosen counter type. Usually, this would be an integral or floating point type. A `std::vector`-based storage may be faster for low-dimensional histograms (or not, you need to measure).
Users who work exclusively with weighted histograms should chose a `std::vector<double>`, it will be faster. If they also want to track the variance of the sum of weights, a vector-based storage of [classref boost::histogram::accumulators::weighted_sum weighted_sum] accumulators should be used. The factory function [funcref boost::histogram::make_weighted_histogram make_weighted_histogram] is a convenient way to generate a histogram with this storage.
An interesting alternative to a `std::vector` is to use a `std::array`. The latter provides a storage with a fixed maximum capacity (the size of the array). `std::array` allocates the memory on the stack. In combination with a static axis configuration this allows one to create histograms completely on the stack without any dynamic memory allocation. Small stack-based histograms can be created and destroyed very fast.
Finally, a `std::map` or `std::unordered_map` or any other map type that implements the STL interface can be used to generate a histogram with a sparse storage, where empty cells do not consume any memory. This sounds attractive, but the memory consumption per cell in such a data structure is much larger than for a vector or array, so the number of empty cells must be substantial to gain. Moreover, cell lookup in a sparse data structure may be less performant. Whether a sparse storage performs better than a dense storage depends on the use case. The library makes it easy to switch from dense to sparse storage and back, so users are invited to test both options.
The following example shows how histograms are constructed which use an alternative storage classes.
[import ../examples/guide_custom_storage.cpp]
[guide_custom_storage]
[endsect]
[section Parallelisation options]
There are two ways to generate a single histogram using several threads.
1. Each thread has its own copy of the histogram. Each copy is independently filled. The copies are then added in the main thread. Use this as the default when you can afford having `N` copies of the histogram in memory for `N` threads, because it allows each thread to work on its thread-local memory and utilise the CPU cache without the need to synchronise memory access. The highest performance gains are obtained in this way.
2. There is only one histogram which is filled concurrently by several threads. This requires using a thread-safe storage that can handle concurrent writes. The library provides the [classref boost::histogram::accumulators::thread_safe] accumulator, which combined with the [classref boost::histogram::dense_storage] provides a thread-safe storage.
[note Filling a histogram with growing axes in a multi-threaded environment is safe, but has poor performance since the histogram must be locked on each fill. The locks are required because an axis could grow each time, which changes the number of cells and cell addressing for all other threads. Even without growing axes, there is only a performance gain if the histogram is either very large or when significant time is spend in preparing the value to fill. For small histograms, threads frequently access the same cell, whose state has to be synchronised between the threads. This is slow even with atomic counters and made worse by the effect of false sharing.]
The next example demonstrates option 2 (option 1 is straight-forward to implement).
[import ../examples/guide_parallel_filling.cpp]
[guide_parallel_filling]
[endsect]
[section User-defined accumulators]
A storage can hold custom accumulators which can accept an arbitrary number of arguments. The arguments are passed to the accumulator via the [funcref boost::histogram::sample sample] call, for example, `sample(1, 2, 3)` for an accumulator which accepts three arguments. Custom accumulators can be combined with any container supported by [classref boost::histogram::storage_adaptor]. For convenience, the alias template `boost::histogram::dense_storage` is provided to make a standard storage with a custom accumulator type.
The library provides several accumulators:
* [classref boost::histogram::accumulators::sum sum] accepts no samples, but accepts a weight. It is an alternative to a plain arithmetic type as a counter. It provides an advantage when histograms are filled with weights that differ dramatically in magnitude. The sum of weights is computed incrementally with the Neumaier algorithm. The algorithm is more accurate, but consumes more CPU and memory (memory is doubled compared to a normal sum of floating point numbers).
* [classref boost::histogram::accumulators::weighted_sum weighted_sum] accepts no samples, but accepts a weight. It computes the sum of weights and the sum of weights squared, the variance estimate of the sum of weights. This type is used by the [funcref boost::histogram::make_weighted_histogram make_weighted_histogram].
* [classref boost::histogram::accumulators::mean mean] accepts a sample and computes the mean of the samples. [funcref boost::histogram::make_profile make_profile] uses this accumulator.
* [classref boost::histogram::accumulators::weighted_mean weighted_mean] accepts a sample and a weight. It computes the weighted mean of the samples. [funcref boost::histogram::make_weighted_profile make_weighted_profile] uses this accumulator.
Users can easily write their own accumulators and plug them into the histogram, if they adhere to the [link histogram.concepts.Accumulator [*Accumulator] concept]. All accumulators from [@boost:/libs/accumulators/index.html Boost.Accumulators] that accept a single argument and no weights work out of the box. Other accumulators from Boost.Accumulators can be made to work by using them inside a wrapper class that implements the concept.
The first example shows how to make and use a histogram that uses one of the the builtin accumulators.
[import ../examples/guide_custom_accumulators_builtin.cpp]
[guide_custom_accumulators_builtin]
The simplest way to make a custom accumulator is to inherit from one of the builtin accumulators. The following example shows how to add arbitrary metadata to each histogram cell by inheriting a custom accumulator from a builtin accumulator.
[import ../examples/guide_custom_accumulators_with_metadata.cpp]
[guide_custom_accumulators_with_metadata]
The next example shows how to making a custom accumulators completely from scratch. The library was designed to make this as easy as possible.
[import ../examples/guide_custom_accumulators_simple.cpp]
[guide_custom_accumulators_simple]
The next example shows a more complex custom accumulator that accepts two samples at once and an optional weight. It independently computes the mean for each sample. This is more efficient than filling two separate profiles, because the cell lookup has to be done only once.
[import ../examples/guide_custom_accumulators_advanced.cpp]
[guide_custom_accumulators_advanced]
And finally, just for fun, we use a histogram as the accumulator for another histogram.
[import ../examples/guide_custom_accumulators_ouroboros.cpp]
[guide_custom_accumulators_ouroboros]
Note that the axis size of the nested histogram differs from bin to bin. Creating a 2D histogram in this way is not as efficient as the normal way, but it allows one to create a histograms with such a non-rectangular layout of cells.
[endsect]
[endsect]
[endsect]

View File

@@ -0,0 +1,110 @@
[/
Copyright Hans Dembinski 2016 - 2019.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
https://www.boost.org/LICENSE_1_0.txt)
]
[library Boost.Histogram
[quickbook 1.6]
[copyright 2016 - 2019 Hans Dembinski]
[purpose Histogram library]
[authors [Dembinski, Hans]]
[id histogram]
[dirname histogram]
[license
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
]
]
[$../logo/color.svg]
Boost.Histogram provides an easy-to-use, fast, and extensible multi-dimensional histograms and profiles.
[variablelist
[
[
[link histogram.overview Overview]
]
[
An overview of the features included in the library, the motivation and rationale.
]
]
[
[
[link histogram.getting_started Getting started]
]
[
See the library in action in a few heavily commented examples. Copy/paste from these examples to kick-start your project.
]
]
[
[
[link histogram.guide User guide]
]
[
An in-depth user guide that introduces all aspects of the library, starting simple and ending with the advanced features.
]
]
[
[
[link histogram.reference Reference]
]
[
Detailed class and function reference.
]
]
[
[
[link histogram.concepts Concepts]
]
[
Read this if you want to make custom axis types, storage types, and more that work with the library.
]
]
[
[
[link histogram.benchmarks Benchmarks]
]
[
The performance of this library is compared with other popular libraries.
]
]
[
[
[link histogram.rationale Rationale]
]
[
Thoughts behind the design for contributors and future maintainers of the library.
]
]
[
[
[link histogram.history Revision history]
]
[
Log of code changes.
]
]
]
[include overview.qbk]
[include getting_started.qbk]
[include guide.qbk]
[include benchmarks.qbk]
[include concepts.qbk]
[xinclude reference_pp.xml]
[include rationale.qbk]
[include history.qbk]
[*Acknowledgments]
Klemens Morgenstern helped to make this library Boost-compliant, converting the documentation and adding Jamfiles, and provided code improvements.
Mateusz Loskot kindly agreed to fill the role of the Review Manager for this library and contributed various patches.
Steven Watanabe provided a very detailed review of the documentation and code of the library. Great reviews were submitted by Bjorn Reese, Jim Pivarski, Klemens Morgenstern, and Alex Hagen-Zanker. Comments and suggestions were provided by Andrea Bocci, degksi, Glen Fernandes, Gavin Lambert, Seth, and Mateusz Loskot. Peter Dimov, Vinnie Falco, and Glen Fernandes were invaluable source of information and feedback on the Cpplang Slack.
The members of the [@http://www.scikit-hep.org Scikit-HEP project] provided valuable feedback and input on the design of this library, special thanks go to Henry Schreiner and Jim Pivarski.

View File

@@ -0,0 +1,232 @@
[/
Copyright Hans Dembinski 2018 - 2019.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
https://www.boost.org/LICENSE_1_0.txt)
]
[section:history Revision history]
[heading Boost 1.76]
* Fixes
* `algorithm::reduce` with `crop` now does not remove the counts in flow bins anymore if the selected range actually overlaps with the flow bins, making the treatment of flow bins consistent with inner bins
* `accumulators::mean` and `accumulators::weighted_mean` now compute the correct variance when `operator+=` was called, for example, when histograms with accumulators are added; this was wrong before leading to too small variances
* detection of weight support in user-defined accumulators was broken at compile-time if accumulator used `operator+=` instead of `operator()`; tests only accidentally passed for builtin `weighted_sum`
[heading Boost 1.75]
* Fixes
* `axis::variable{{0, 1, inf}}.value(1)` now returns 1 instead of NaN
* `axis::variable` ctor now throws `std::invalid_argument` if one values is NaN
* Implemented a workaround for a gcc bug (will be fixed upstream in gcc-10.x) that occurred when `<boost/type_traits.hpp>` was included before `<boost/histogram/axis/traits.hpp>`
* Fixed several new warnings from the latest compiler versions
* Fixed warnings that appear when compiling against the C++20 standard
* Documentation
* Documented undefined behaviour when value and variance are requested for `accumulator::mean` and `accumulator::weighted_mean` but the accumulator does not have enough entries to compute them
* Added explanation to rationale why axis metadata is checked for equality
[heading Boost 1.74]
* New features
* New axis `boolean`, a special kind of integer axis with only two values and no state (except metadata)
* Histograms with growing category axes are now addable even if the categories differ; the category axis of the output histogram is the union of the category axes of the input histograms
* Added axis::traits::continuous to match axis::traits::is_continuous
* Fixes
* `metadata()` method of builtin axis types now return a mutable reference even if the axis is const, as described in the documentation
* Documentation
* Sorted headers in reference and sorted items in namespaces
* Removed some internal typenames from templates
* Added reference for `sample_type`
* Other
* Simplified internal metaprogramming
* Replaced Boost Assert with plain cassert
[heading Boost 1.73]
* New features
* accumulators
* New `count` accumulator, a thin wrapper around a primitive arithmetic type; serves as a base class for users who want to add arbitrary metadata to each bin
* `sum` gained a `value()` method for consistency with other accumulators
* algorithm
* `reduce`
* Now supports positional commands
* `category` axis now supports `slice` command
* Added `crop` command, like `shrink`, but discards content of removed bins
* Renamed `reduce_option` to `reduce_command` (old name available but deprecated)
* `sum` gained a new argument, allowing users to select whether to sum over all bins or only the inner bins (excluding underflow and overflow)
* axis::traits
* Added traits `is_ordered` and `ordered` to distinguish between different kinds of DiscreteAxis types; used internally to handle `category` axis and `integer` axis differently
* Renamed `static_options` to `get_options` and `static_is_inclusive` to `is_inclusive` (old names available but deprecated)
* Fixes
* Fixed failing ODR test in bundled Boost due to wrong paths
* Fixed a bug in histogram::operator*= that could occur in user-defined accumulators
* Fixed a bug in `indexed` which could cause arithmetic past the end position
* Fixed a bug where the variance in `accumulators::weighted_sum` was not correctly computed if a normal histogram was added to the histogram that used `accumulators::weighted_sum`
* Fixed a bug where compiling with `-ffast-math` would break `accumulators::sum`
* Fixed `algorithm::reduce` to work with axes without *flow bins, which did not compile before
* Other
* Added an example and documentation on how to use Boost.Histogram as a backend
* Improved the docs on how to use custom accumulators and Boost.Accumulators
* Many small documentation improvements
* Improved docs for `algorithm::reduce`
* Improved experimental cmake build support
* Use `index_type` consistently everywhere instead of raw `int`
* Benchmark update in the docs
[heading Boost 1.72]
* New features
* Better deduction guides for axis types and histogram type on C++17 compilers
* performance improvements in the indexing code
* new histogram::fill method for accelerated filling from chunks of values
* ASCII bar charts for 1D histograms when boost/histogram/ostream.hpp is included (contributed by Przemyslaw Bartosik)
* Passing invalid axis options causes user-friendly compile-time errors
* Wrong usage of weight() and sample() causes user-friendly compile-time errors
* algorithm::empty returns true if all histogram values are equal to the default value (contributed by Henry Schreiner)
* algorithm::reduce with shrink is now well defined when values are not bin edges
* axis::traits::rank returns the number of values that this axis accepts
* axis::traits::is_continuous returns whether an axis is continuous or discrete
* axis::traits::is_inclusive returns whether an axis has a bin for any possible input
* limited weight support for mean accumulator
* accumulators::weighted_mean::sum_of_weights_squared method added
* Fixes
* Support of -std=c++2a and -stdlib=libc++ on clang, compatibility with gcc-9
* Fixed: weight could be passed instead of a sample during filling without triggering an error
* Fixed: segfault when too many indices were passed to algorithm::project
* Fixed: indexed range generator did not work with storage based on std::array
* Fixed: weighted_mean() + weighted_mean() != weighted_mean() (discovered and reported by Henry Schreiner)
* Fixed: axis::option::test(...) returned true if any bits in the test mask were set (now returns true if all bits in the test mask are set)
* Protecting calls to min, max with against macro expansion
* Replaced all crlf with lf in concepts.qbk
* Missing throw of std::invalid_argument when user passes too many axes to histogram
* Corrected documentation of serialization support in concepts section
* Resolved warnings for various compiler versions
* Other
* Added Boost.Histogram logo
* Added missing copyright notices
* axis::category::value returns copy for scalar types and const reference otherwise
* std::ostringstream not used anymore to generate exception messages to reduces code bloat
* Documentation improvements
* Restructured overview section in documentation
* Updated user guide to demonstrate new features
* Updated accumulator examples
* Concepts explain how accumulators can optionally accept weights
* Updated benchmark code
* New test checks consistency of b2 and cmake build systems
* New test checks One-Definition-Rule (fails if non-templated function is not declared inline)
* Serialization code decoupled from Boost.Serialization
* Removed dependency on Boost.CallableTraits
[heading Boost 1.71]
* New features
* Thread-safe accumulators boost::histogram::accumulators::thread_safe based on std::atomics
* Support for thread-safe storages
* Support for compiling without exceptions/RTTI (increases performance by 10-20 %) [with contributions from Glen Fernandez]
* Performance improvements for 1D and 2D histograms
* boost::histogram::indexed now returns forward iterator range instead of input iterator range
* boost::histogram::indexed_range::accessor is now non-copyable and acts like reference to cell value, making most algorithms from the stdlib work
* boost::histogram::algorithm::reduce
* New slice option
* Fuse shrink, slice, and rebin options passed for the same axis
* Support histograms with some axis types with reduction support
* boost::histogram::algorithm::project accepts runtime indices for static histograms
* Fixes
* boost::histogram::algorithm::reduce also works on histograms that have some axis types without reduction support
* boost::histogram::axis::traits::update now works correctly for boost::histogram::axis::variant
* Other
* 100 % test coverage
* Drastically reduced internal Boost dependencies
* Improved documentation and examples
* Internally replaced boost::variant with boost::variant2
* boost::histogram::axis::traits::is_reducible detects reducible axis types
* Cleanup and refactoring of internals
* Guarantee no-throw moves for all builtin axis types
* Improved internal benchmarks
* Compile cleanly at higher warning levels
[heading Boost 1.70]
First Boost release, version 4.0 in former internal counting.
* Removed Python bindings, will be developed in separate repository
* All axes can be made optionally circular, except category axis
* All axes now support generic attached metadata
* All axes have now independently configurable underflow/overflow extra bins
* Removed circular axis (which is just a circular regular axis)
* Added indexed adaptor generator for convenient and fast iteration over histograms
* Support for axes that can grow in range
* Support for axes which accept multiple values (example: hexagonal binning)
* Support for profiles and more generally, arbitrary accumulators in each cell
* Support for serializing to xml archives
* Added compatibility with Boost.Range, Boost.Units, and Boost.Accumulators
* Added deduction guides for axis types and histogram
* Performance improvements
* Renamed `adaptive_storage` to `unlimited_storage`
* Replaced `boost::multiprecision::cpp_int` with custom type to decouple libraries
* Internal simplification of `axis::variant`
* Make all storages behave more like containers, simplifying the design
* Histograms supports add, sub, mul, div
* replaced `operator[]` in axis with explicit method `bin`
* replaced `operator()` in axis with explicit method `index`
* replaced internal use of `boost::containers` with stdlib containers
* Much improved docs, reference documentation, user guide, more examples
[heading 3.2 (not in Boost)]
* Allocator support everywhere
* Internal refactoring
[heading 3.1 (not in Boost)]
* Renamed `bincount` method to `size`
* Support for axes with only overflow and no underflow bin
* category axis now by default has bin for "other" input that does not fall
into the predefined categories, making it consistent with other axes
* NaN is now consistently put into overflow bin for all axes
* Eliminated warnings about safe internal conversions on MSVC
* Established a cpp house style with corresponding .clang-format file
* Better detection of Python library on all systems
* Improved code coverage by testing more input errors
* Raise ValueError instead of generic RuntimeError in Python on input errors
[heading 3.0 (not in Boost)]
* Support for efficient adding of multiple histograms and scaling
* Re-design of category axis as a general mapping between unique values and bins
* Re-design of the bin description an axis returns upon element access
* Interface cleanup and simplification, more consistency between Python and C++ interface
* Iterators for histogram and axes for STL compatibility
* Regular axis in C++: Allowing transforms with state
* Regular axis in Python: Support for all C++ transforms
* Polymorphic axis::any type
* Internal refactoring from boost::mpl and boost::fusion to std::tuple and boost::mp11
* Windows support
[heading 2.0 (not in Boost)]
* Added static_histogram (v1.0 only had dynamic_histogram).
* Merged wfill(...) and fill(...) interface.
* Support custom allocators in storage classes.
* Replaced static_storage with array_storage.
* Replaced dynamic_storage with unlimited_storage, which adds the capability to grow the bin counter into a cpp_int, thus avoiding integer overflow completely.
* Serialization uses binary_archive instead of text_archive. The latter is portable, but the performance is terrible.
* Python interface changed: histograms are now iterable, returning axis classes
* Support reduction (removing a subset of axes and returning the equivalent histogram; in other words, those axes are integrated over)
[heading 1.0 (not in Boost)]
* First stable version.
[endsect]

View File

@@ -0,0 +1,50 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Macro BOOST_HISTOGRAM_DETAIL_AXES_LIMIT</title>
<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="histogram/reference.html#header.boost.histogram.fwd_hpp" title="Header &lt;boost/histogram/fwd.hpp&gt;">
<link rel="prev" href="boost/histogram/axis/null_type.html" title="Struct null_type">
<link rel="next" href="boost/histogram/histogram.html" title="Class template histogram">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
<td align="center"><a href="../../../../index.html">Home</a></td>
<td align="center"><a href="../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="boost/histogram/axis/null_type.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="histogram/reference.html#header.boost.histogram.fwd_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="boost/histogram/histogram.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="BOOST_HI_idm46275018510016"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Macro BOOST_HISTOGRAM_DETAIL_AXES_LIMIT</span></h2>
<p>BOOST_HISTOGRAM_DETAIL_AXES_LIMIT</p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="histogram/reference.html#header.boost.histogram.fwd_hpp" title="Header &lt;boost/histogram/fwd.hpp&gt;">boost/histogram/fwd.hpp</a>&gt;
</span>BOOST_HISTOGRAM_DETAIL_AXES_LIMIT</pre></div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
Dembinski<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="boost/histogram/axis/null_type.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="histogram/reference.html#header.boost.histogram.fwd_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="boost/histogram/histogram.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,126 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Class template count</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../../histogram/reference.html#header.boost.histogram.accumulators.count_hpp" title="Header &lt;boost/histogram/accumulators/count.hpp&gt;">
<link rel="prev" href="../weight_type.html" title="Struct template weight_type">
<link rel="next" href="mean.html" title="Class template mean">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../weight_type.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.accumulators.count_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="mean.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.histogram.accumulators.count"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class template count</span></h2>
<p>boost::histogram::accumulators::count — Uses a C++ builtin arithmetic type to accumulate a count. </p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../histogram/reference.html#header.boost.histogram.accumulators.count_hpp" title="Header &lt;boost/histogram/accumulators/count.hpp&gt;">boost/histogram/accumulators/count.hpp</a>&gt;
</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> ValueType<span class="special">&gt;</span>
<span class="keyword">class</span> <a class="link" href="count.html" title="Class template count">count</a> <span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
<span class="comment">// types</span>
<span class="keyword">typedef</span> <span class="identifier">ValueType</span> <a name="boost.histogram.accumulators.count.value_type"></a><span class="identifier">value_type</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="keyword">const</span> <span class="identifier">value_type</span> <span class="special">&amp;</span> <a name="boost.histogram.accumulators.count.const_reference"></a><span class="identifier">const_reference</span><span class="special">;</span>
<span class="comment">// <a class="link" href="count.html#boost.histogram.accumulators.countconstruct-copy-destruct">construct/copy/destruct</a></span>
<a class="link" href="count.html#idm46275003966992-bb"><span class="identifier">count</span></a><span class="special">(</span><span class="special">)</span> <span class="special">=</span> <span class="keyword">default</span><span class="special">;</span>
<a class="link" href="count.html#idm46275003966592-bb"><span class="identifier">count</span></a><span class="special">(</span><span class="identifier">const_reference</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span> <a class="link" href="count.html#idm46275003965168-bb"><span class="identifier">count</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="count.html" title="Class template count">count</a><span class="special">&lt;</span> <span class="identifier">T</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="comment">// <a class="link" href="count.html#idm46275004003264-bb">public member functions</a></span>
<a class="link" href="count.html" title="Class template count">count</a> <span class="special">&amp;</span> <a class="link" href="count.html#idm46275004002704-bb"><span class="keyword">operator</span><span class="special">++</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
<a class="link" href="count.html" title="Class template count">count</a> <span class="special">&amp;</span> <a class="link" href="count.html#idm46275004001152-bb"><span class="keyword">operator</span><span class="special">+=</span></a><span class="special">(</span><span class="identifier">const_reference</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
<a class="link" href="count.html" title="Class template count">count</a> <span class="special">&amp;</span> <a class="link" href="count.html#idm46275003998912-bb"><span class="keyword">operator</span><span class="special">+=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="count.html" title="Class template count">count</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
<a class="link" href="count.html" title="Class template count">count</a> <span class="special">&amp;</span> <a class="link" href="count.html#idm46275003996240-bb"><span class="keyword">operator</span> <span class="special">*=</span></a><span class="special">(</span><span class="identifier">const_reference</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="keyword">bool</span> <a class="link" href="count.html#idm46275003994016-bb"><span class="keyword">operator</span><span class="special">==</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="count.html" title="Class template count">count</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="keyword">bool</span> <a class="link" href="count.html#idm46275003991920-bb"><span class="keyword">operator</span><span class="special">!=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="count.html" title="Class template count">count</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="identifier">const_reference</span> <a class="link" href="count.html#idm46275003989824-bb"><span class="identifier">value</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="keyword">explicit</span> <a class="link" href="count.html#idm46275003988576-bb"><span class="keyword">operator</span> <span class="identifier">value_type</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Archive<span class="special">&gt;</span> <span class="keyword">void</span> <a class="link" href="count.html#idm46275003987344-bb"><span class="identifier">serialize</span></a><span class="special">(</span><span class="identifier">Archive</span> <span class="special">&amp;</span><span class="special">,</span> <span class="keyword">unsigned</span><span class="special">)</span><span class="special">;</span>
<a class="link" href="count.html" title="Class template count">count</a> <span class="special">&amp;</span> <a class="link" href="count.html#idm46275003984592-bb"><span class="keyword">operator</span> <span class="special">*=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="count.html" title="Class template count">count</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
<a class="link" href="count.html" title="Class template count">count</a> <a class="link" href="count.html#idm46275003982208-bb"><span class="keyword">operator</span> <span class="special">*</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="count.html" title="Class template count">count</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<a class="link" href="count.html" title="Class template count">count</a> <span class="special">&amp;</span> <a class="link" href="count.html#idm46275003979984-bb"><span class="keyword">operator</span><span class="special">/=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="count.html" title="Class template count">count</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
<a class="link" href="count.html" title="Class template count">count</a> <a class="link" href="count.html#idm46275003977600-bb"><span class="keyword">operator</span><span class="special">/</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="count.html" title="Class template count">count</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="keyword">bool</span> <a class="link" href="count.html#idm46275003975376-bb"><span class="keyword">operator</span><span class="special">&lt;</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="count.html" title="Class template count">count</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="keyword">bool</span> <a class="link" href="count.html#idm46275003973280-bb"><span class="keyword">operator</span><span class="special">&gt;</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="count.html" title="Class template count">count</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="keyword">bool</span> <a class="link" href="count.html#idm46275003971184-bb"><span class="keyword">operator</span><span class="special">&lt;=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="count.html" title="Class template count">count</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="keyword">bool</span> <a class="link" href="count.html#idm46275003969088-bb"><span class="keyword">operator</span><span class="special">&gt;=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="count.html" title="Class template count">count</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm45878792716096"></a><h2>Description</h2>
<p>This wrapper class may be used as a base class by users who want to add custom metadata to each bin of a histogram. Otherwise, arithmetic types should be used directly as accumulators in storages for simplicity. In other words, prefer <code class="computeroutput">dense_storage&lt;double&gt;</code> over<code class="computeroutput">dense_storage&lt;count&lt;double&gt;&gt;</code>, both are functionally equivalent.</p>
<p>When weighted data is accumulated and high precision is required, use <code class="computeroutput"><a class="link" href="sum.html" title="Class template sum">accumulators::sum</a></code> instead. If a local variance estimate for the weight distribution should be computed as well (generally needed for a detailed statistical analysis), use<code class="computeroutput"><a class="link" href="weighted_sum.html" title="Class template weighted_sum">accumulators::weighted_sum</a></code>.</p>
<div class="refsect2">
<a name="idm45878792710640"></a><h3>
<a name="boost.histogram.accumulators.countconstruct-copy-destruct"></a><code class="computeroutput">count</code>
public
construct/copy/destruct</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem"><pre class="literallayout"><a name="idm46275003966992-bb"></a><span class="identifier">count</span><span class="special">(</span><span class="special">)</span> <span class="special">=</span> <span class="keyword">default</span><span class="special">;</span></pre></li>
<li class="listitem">
<pre class="literallayout"><a name="idm46275003966592-bb"></a><span class="identifier">count</span><span class="special">(</span><span class="identifier">const_reference</span> value<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Initialize count to value and allow implicit conversion. </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span> <a name="idm46275003965168-bb"></a><span class="identifier">count</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="count.html" title="Class template count">count</a><span class="special">&lt;</span> <span class="identifier">T</span> <span class="special">&gt;</span> <span class="special">&amp;</span> c<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Allow implicit conversion from other count. </li>
</ol></div>
</div>
<div class="refsect2">
<a name="idm45878792687040"></a><h3>
<a name="idm46275004003264-bb"></a><code class="computeroutput">count</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><a class="link" href="count.html" title="Class template count">count</a> <span class="special">&amp;</span> <a name="idm46275004002704-bb"></a><span class="keyword">operator</span><span class="special">++</span><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Increment count by one. </li>
<li class="listitem">
<pre class="literallayout"><a class="link" href="count.html" title="Class template count">count</a> <span class="special">&amp;</span> <a name="idm46275004001152-bb"></a><span class="keyword">operator</span><span class="special">+=</span><span class="special">(</span><span class="identifier">const_reference</span> value<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Increment count by value. </li>
<li class="listitem">
<pre class="literallayout"><a class="link" href="count.html" title="Class template count">count</a> <span class="special">&amp;</span> <a name="idm46275003998912-bb"></a><span class="keyword">operator</span><span class="special">+=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="count.html" title="Class template count">count</a> <span class="special">&amp;</span> s<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Add another count. </li>
<li class="listitem">
<pre class="literallayout"><a class="link" href="count.html" title="Class template count">count</a> <span class="special">&amp;</span> <a name="idm46275003996240-bb"></a><span class="keyword">operator</span> <span class="special">*=</span><span class="special">(</span><span class="identifier">const_reference</span> value<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Scale by value. </li>
<li class="listitem"><pre class="literallayout"><span class="keyword">bool</span> <a name="idm46275003994016-bb"></a><span class="keyword">operator</span><span class="special">==</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="count.html" title="Class template count">count</a> <span class="special">&amp;</span> rhs<span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="keyword">bool</span> <a name="idm46275003991920-bb"></a><span class="keyword">operator</span><span class="special">!=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="count.html" title="Class template count">count</a> <span class="special">&amp;</span> rhs<span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">const_reference</span> <a name="idm46275003989824-bb"></a><span class="identifier">value</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Return count. </li>
<li class="listitem"><pre class="literallayout"><span class="keyword">explicit</span> <a name="idm46275003988576-bb"></a><span class="keyword">operator</span> <span class="identifier">value_type</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Archive<span class="special">&gt;</span> <span class="keyword">void</span> <a name="idm46275003987344-bb"></a><span class="identifier">serialize</span><span class="special">(</span><span class="identifier">Archive</span> <span class="special">&amp;</span> ar<span class="special">,</span> <span class="keyword">unsigned</span><span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><a class="link" href="count.html" title="Class template count">count</a> <span class="special">&amp;</span> <a name="idm46275003984592-bb"></a><span class="keyword">operator</span> <span class="special">*=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="count.html" title="Class template count">count</a> <span class="special">&amp;</span> rhs<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><a class="link" href="count.html" title="Class template count">count</a> <a name="idm46275003982208-bb"></a><span class="keyword">operator</span> <span class="special">*</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="count.html" title="Class template count">count</a> <span class="special">&amp;</span> rhs<span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><a class="link" href="count.html" title="Class template count">count</a> <span class="special">&amp;</span> <a name="idm46275003979984-bb"></a><span class="keyword">operator</span><span class="special">/=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="count.html" title="Class template count">count</a> <span class="special">&amp;</span> rhs<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><a class="link" href="count.html" title="Class template count">count</a> <a name="idm46275003977600-bb"></a><span class="keyword">operator</span><span class="special">/</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="count.html" title="Class template count">count</a> <span class="special">&amp;</span> rhs<span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="keyword">bool</span> <a name="idm46275003975376-bb"></a><span class="keyword">operator</span><span class="special">&lt;</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="count.html" title="Class template count">count</a> <span class="special">&amp;</span> rhs<span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="keyword">bool</span> <a name="idm46275003973280-bb"></a><span class="keyword">operator</span><span class="special">&gt;</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="count.html" title="Class template count">count</a> <span class="special">&amp;</span> rhs<span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="keyword">bool</span> <a name="idm46275003971184-bb"></a><span class="keyword">operator</span><span class="special">&lt;=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="count.html" title="Class template count">count</a> <span class="special">&amp;</span> rhs<span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="keyword">bool</span> <a name="idm46275003969088-bb"></a><span class="keyword">operator</span><span class="special">&gt;=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="count.html" title="Class template count">count</a> <span class="special">&amp;</span> rhs<span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li>
</ol></div>
</div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
Dembinski<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../weight_type.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.accumulators.count_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="mean.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,116 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Class template mean</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../../histogram/reference.html#header.boost.histogram.accumulators.mean_hpp" title="Header &lt;boost/histogram/accumulators/mean.hpp&gt;">
<link rel="prev" href="count.html" title="Class template count">
<link rel="next" href="sum.html" title="Class template sum">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="count.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.accumulators.mean_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="sum.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.histogram.accumulators.mean"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class template mean</span></h2>
<p>boost::histogram::accumulators::mean — Calculates mean and variance of sample. </p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../histogram/reference.html#header.boost.histogram.accumulators.mean_hpp" title="Header &lt;boost/histogram/accumulators/mean.hpp&gt;">boost/histogram/accumulators/mean.hpp</a>&gt;
</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> ValueType<span class="special">&gt;</span>
<span class="keyword">class</span> <a class="link" href="mean.html" title="Class template mean">mean</a> <span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
<span class="comment">// types</span>
<span class="keyword">typedef</span> <span class="identifier">ValueType</span> <a name="boost.histogram.accumulators.mean.value_type"></a><span class="identifier">value_type</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="keyword">const</span> <span class="identifier">value_type</span> <span class="special">&amp;</span> <a name="boost.histogram.accumulators.mean.const_reference"></a><span class="identifier">const_reference</span><span class="special">;</span>
<span class="comment">// <a class="link" href="mean.html#boost.histogram.accumulators.meanconstruct-copy-destruct">construct/copy/destruct</a></span>
<a class="link" href="mean.html#idm46275003933584-bb"><span class="identifier">mean</span></a><span class="special">(</span><span class="special">)</span> <span class="special">=</span> <span class="keyword">default</span><span class="special">;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span> <a class="link" href="mean.html#idm46275003933184-bb"><span class="identifier">mean</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="mean.html" title="Class template mean">mean</a><span class="special">&lt;</span> <span class="identifier">T</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
<a class="link" href="mean.html#idm46275003930640-bb"><span class="identifier">mean</span></a><span class="special">(</span><span class="identifier">const_reference</span><span class="special">,</span> <span class="identifier">const_reference</span><span class="special">,</span> <span class="identifier">const_reference</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="comment">// <a class="link" href="mean.html#idm46275003957072-bb">public member functions</a></span>
<span class="keyword">void</span> <a class="link" href="mean.html#idm46275003956512-bb"><span class="keyword">operator</span><span class="special">(</span><span class="special">)</span></a><span class="special">(</span><span class="identifier">const_reference</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="keyword">void</span> <a class="link" href="mean.html#idm46275003954576-bb"><span class="keyword">operator</span><span class="special">(</span><span class="special">)</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="../weight_type.html" title="Struct template weight_type">weight_type</a><span class="special">&lt;</span> <span class="identifier">value_type</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">const_reference</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
<a class="link" href="mean.html" title="Class template mean">mean</a> <span class="special">&amp;</span> <a class="link" href="mean.html#idm46275003951488-bb"><span class="keyword">operator</span><span class="special">+=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="mean.html" title="Class template mean">mean</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
<a class="link" href="mean.html" title="Class template mean">mean</a> <span class="special">&amp;</span> <a class="link" href="mean.html#idm46275003948800-bb"><span class="keyword">operator</span> <span class="special">*=</span></a><span class="special">(</span><span class="identifier">const_reference</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="keyword">bool</span> <a class="link" href="mean.html#idm46275003946128-bb"><span class="keyword">operator</span><span class="special">==</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="mean.html" title="Class template mean">mean</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="keyword">bool</span> <a class="link" href="mean.html#idm46275003944032-bb"><span class="keyword">operator</span><span class="special">!=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="mean.html" title="Class template mean">mean</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="identifier">const_reference</span> <a class="link" href="mean.html#idm46275003941936-bb"><span class="identifier">count</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="identifier">const_reference</span> <a class="link" href="mean.html#idm46275003940656-bb"><span class="identifier">value</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="identifier">value_type</span> <a class="link" href="mean.html#idm46275003938496-bb"><span class="identifier">variance</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Archive<span class="special">&gt;</span> <span class="keyword">void</span> <a class="link" href="mean.html#idm46275003936336-bb"><span class="identifier">serialize</span></a><span class="special">(</span><span class="identifier">Archive</span> <span class="special">&amp;</span><span class="special">,</span> <span class="keyword">unsigned</span><span class="special">)</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm45878792419856"></a><h2>Description</h2>
<p>Uses Welfords's incremental algorithm to improve the numerical stability of mean and variance computation. </p>
<div class="refsect2">
<a name="idm45878792419056"></a><h3>
<a name="boost.histogram.accumulators.meanconstruct-copy-destruct"></a><code class="computeroutput">mean</code>
public
construct/copy/destruct</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem"><pre class="literallayout"><a name="idm46275003933584-bb"></a><span class="identifier">mean</span><span class="special">(</span><span class="special">)</span> <span class="special">=</span> <span class="keyword">default</span><span class="special">;</span></pre></li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span> <a name="idm46275003933184-bb"></a><span class="identifier">mean</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="mean.html" title="Class template mean">mean</a><span class="special">&lt;</span> <span class="identifier">T</span> <span class="special">&gt;</span> <span class="special">&amp;</span> o<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Allow implicit conversion from mean&lt;T&gt;. </li>
<li class="listitem">
<pre class="literallayout"><a name="idm46275003930640-bb"></a><span class="identifier">mean</span><span class="special">(</span><span class="identifier">const_reference</span> n<span class="special">,</span> <span class="identifier">const_reference</span> mean<span class="special">,</span> <span class="identifier">const_reference</span> variance<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Initialize to external count, mean, and variance. </li>
</ol></div>
</div>
<div class="refsect2">
<a name="idm45878792392592"></a><h3>
<a name="idm46275003957072-bb"></a><code class="computeroutput">mean</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="idm46275003956512-bb"></a><span class="keyword">operator</span><span class="special">(</span><span class="special">)</span><span class="special">(</span><span class="identifier">const_reference</span> x<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Insert sample x. </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="idm46275003954576-bb"></a><span class="keyword">operator</span><span class="special">(</span><span class="special">)</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="../weight_type.html" title="Struct template weight_type">weight_type</a><span class="special">&lt;</span> <span class="identifier">value_type</span> <span class="special">&gt;</span> <span class="special">&amp;</span> w<span class="special">,</span> <span class="identifier">const_reference</span> x<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Insert sample x with weight w. </li>
<li class="listitem">
<pre class="literallayout"><a class="link" href="mean.html" title="Class template mean">mean</a> <span class="special">&amp;</span> <a name="idm46275003951488-bb"></a><span class="keyword">operator</span><span class="special">+=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="mean.html" title="Class template mean">mean</a> <span class="special">&amp;</span> rhs<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Add another mean accumulator. </li>
<li class="listitem">
<pre class="literallayout"><a class="link" href="mean.html" title="Class template mean">mean</a> <span class="special">&amp;</span> <a name="idm46275003948800-bb"></a><span class="keyword">operator</span> <span class="special">*=</span><span class="special">(</span><span class="identifier">const_reference</span> s<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Scale by value. <p>This acts as if all samples were scaled by the value. </p>
</li>
<li class="listitem"><pre class="literallayout"><span class="keyword">bool</span> <a name="idm46275003946128-bb"></a><span class="keyword">operator</span><span class="special">==</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="mean.html" title="Class template mean">mean</a> <span class="special">&amp;</span> rhs<span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="keyword">bool</span> <a name="idm46275003944032-bb"></a><span class="keyword">operator</span><span class="special">!=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="mean.html" title="Class template mean">mean</a> <span class="special">&amp;</span> rhs<span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">const_reference</span> <a name="idm46275003941936-bb"></a><span class="identifier">count</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Return how many samples were accumulated. </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">const_reference</span> <a name="idm46275003940656-bb"></a><span class="identifier">value</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Return mean value of accumulated samples. <p>The result is undefined, if <code class="computeroutput">count() &lt; 1</code>.</p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">value_type</span> <a name="idm46275003938496-bb"></a><span class="identifier">variance</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Return variance of accumulated samples. <p>The result is undefined, if <code class="computeroutput">count() &lt; 2</code>.</p>
</li>
<li class="listitem"><pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Archive<span class="special">&gt;</span> <span class="keyword">void</span> <a name="idm46275003936336-bb"></a><span class="identifier">serialize</span><span class="special">(</span><span class="identifier">Archive</span> <span class="special">&amp;</span> ar<span class="special">,</span> <span class="keyword">unsigned</span> version<span class="special">)</span><span class="special">;</span></pre></li>
</ol></div>
</div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
Dembinski<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="count.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.accumulators.mean_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="sum.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,135 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Class template sum</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../../histogram/reference.html#header.boost.histogram.accumulators.sum_hpp" title="Header &lt;boost/histogram/accumulators/sum.hpp&gt;">
<link rel="prev" href="mean.html" title="Class template mean">
<link rel="next" href="thread_safe.html" title="Class template thread_safe">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="mean.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.accumulators.sum_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="thread_safe.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.histogram.accumulators.sum"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class template sum</span></h2>
<p>boost::histogram::accumulators::sum — Uses Neumaier algorithm to compute accurate sums of floats. </p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../histogram/reference.html#header.boost.histogram.accumulators.sum_hpp" title="Header &lt;boost/histogram/accumulators/sum.hpp&gt;">boost/histogram/accumulators/sum.hpp</a>&gt;
</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> ValueType<span class="special">&gt;</span>
<span class="keyword">class</span> <a class="link" href="sum.html" title="Class template sum">sum</a> <span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
<span class="comment">// types</span>
<span class="keyword">typedef</span> <span class="identifier">ValueType</span> <a name="boost.histogram.accumulators.sum.value_type"></a><span class="identifier">value_type</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="keyword">const</span> <span class="identifier">value_type</span> <span class="special">&amp;</span> <a name="boost.histogram.accumulators.sum.const_reference"></a><span class="identifier">const_reference</span><span class="special">;</span>
<span class="comment">// <a class="link" href="sum.html#boost.histogram.accumulators.sumconstruct-copy-destruct">construct/copy/destruct</a></span>
<a class="link" href="sum.html#idm46275003879216-bb"><span class="identifier">sum</span></a><span class="special">(</span><span class="special">)</span> <span class="special">=</span> <span class="keyword">default</span><span class="special">;</span>
<a class="link" href="sum.html#idm46275003878816-bb"><span class="identifier">sum</span></a><span class="special">(</span><span class="identifier">const_reference</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span> <a class="link" href="sum.html#idm46275003877408-bb"><span class="identifier">sum</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="sum.html" title="Class template sum">sum</a><span class="special">&lt;</span> <span class="identifier">T</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
<a class="link" href="sum.html#idm46275003874880-bb"><span class="identifier">sum</span></a><span class="special">(</span><span class="identifier">const_reference</span><span class="special">,</span> <span class="identifier">const_reference</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="comment">// <a class="link" href="sum.html#idm46275003918016-bb">public member functions</a></span>
<a class="link" href="sum.html" title="Class template sum">sum</a> <span class="special">&amp;</span> <a class="link" href="sum.html#idm46275003917456-bb"><span class="keyword">operator</span><span class="special">++</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
<a class="link" href="sum.html" title="Class template sum">sum</a> <span class="special">&amp;</span> <a class="link" href="sum.html#idm46275003915920-bb"><span class="keyword">operator</span><span class="special">+=</span></a><span class="special">(</span><span class="identifier">const_reference</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
<a class="link" href="sum.html" title="Class template sum">sum</a> <span class="special">&amp;</span> <a class="link" href="sum.html#idm46275003913680-bb"><span class="keyword">operator</span><span class="special">+=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="sum.html" title="Class template sum">sum</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
<a class="link" href="sum.html" title="Class template sum">sum</a> <span class="special">&amp;</span> <a class="link" href="sum.html#idm46275003911008-bb"><span class="keyword">operator</span> <span class="special">*=</span></a><span class="special">(</span><span class="identifier">const_reference</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="keyword">bool</span> <a class="link" href="sum.html#idm46275003908784-bb"><span class="keyword">operator</span><span class="special">==</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="sum.html" title="Class template sum">sum</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="keyword">bool</span> <a class="link" href="sum.html#idm46275003906688-bb"><span class="keyword">operator</span><span class="special">!=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="sum.html" title="Class template sum">sum</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="identifier">value_type</span> <a class="link" href="sum.html#idm46275003904592-bb"><span class="identifier">value</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="identifier">const_reference</span> <a class="link" href="sum.html#idm46275003903328-bb"><span class="identifier">large</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="identifier">const_reference</span> <a class="link" href="sum.html#idm46275003902064-bb"><span class="identifier">small</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="keyword">explicit</span> <a class="link" href="sum.html#idm46275003900800-bb"><span class="keyword">operator</span> <span class="identifier">value_type</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Archive<span class="special">&gt;</span> <span class="keyword">void</span> <a class="link" href="sum.html#idm46275003899568-bb"><span class="identifier">serialize</span></a><span class="special">(</span><span class="identifier">Archive</span> <span class="special">&amp;</span><span class="special">,</span> <span class="keyword">unsigned</span><span class="special">)</span><span class="special">;</span>
<a class="link" href="sum.html" title="Class template sum">sum</a> <span class="special">&amp;</span> <a class="link" href="sum.html#idm46275003896816-bb"><span class="keyword">operator</span> <span class="special">*=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="sum.html" title="Class template sum">sum</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
<a class="link" href="sum.html" title="Class template sum">sum</a> <a class="link" href="sum.html#idm46275003894432-bb"><span class="keyword">operator</span> <span class="special">*</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="sum.html" title="Class template sum">sum</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<a class="link" href="sum.html" title="Class template sum">sum</a> <span class="special">&amp;</span> <a class="link" href="sum.html#idm46275003892208-bb"><span class="keyword">operator</span><span class="special">/=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="sum.html" title="Class template sum">sum</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
<a class="link" href="sum.html" title="Class template sum">sum</a> <a class="link" href="sum.html#idm46275003889824-bb"><span class="keyword">operator</span><span class="special">/</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="sum.html" title="Class template sum">sum</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="keyword">bool</span> <a class="link" href="sum.html#idm46275003887600-bb"><span class="keyword">operator</span><span class="special">&lt;</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="sum.html" title="Class template sum">sum</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="keyword">bool</span> <a class="link" href="sum.html#idm46275003885504-bb"><span class="keyword">operator</span><span class="special">&gt;</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="sum.html" title="Class template sum">sum</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="keyword">bool</span> <a class="link" href="sum.html#idm46275003883408-bb"><span class="keyword">operator</span><span class="special">&lt;=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="sum.html" title="Class template sum">sum</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="keyword">bool</span> <a class="link" href="sum.html#idm46275003881312-bb"><span class="keyword">operator</span><span class="special">&gt;=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="sum.html" title="Class template sum">sum</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm45878792112096"></a><h2>Description</h2>
<p>The algorithm is an improved Kahan algorithm (<a href="https://en.wikipedia.org/wiki/Kahan_summation_algorithm" target="_top">https://en.wikipedia.org/wiki/Kahan_summation_algorithm</a>). The algorithm uses memory for two numbers and is three to five times slower compared to using a single number to accumulate a sum, but the relative error of the sum is at the level of the machine precision, independent of the number of samples.</p>
<p>A. Neumaier, Zeitschrift fuer Angewandte Mathematik und Mechanik 54 (1974) 39-51. </p>
<div class="refsect2">
<a name="idm45878792110000"></a><h3>
<a name="boost.histogram.accumulators.sumconstruct-copy-destruct"></a><code class="computeroutput">sum</code>
public
construct/copy/destruct</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem"><pre class="literallayout"><a name="idm46275003879216-bb"></a><span class="identifier">sum</span><span class="special">(</span><span class="special">)</span> <span class="special">=</span> <span class="keyword">default</span><span class="special">;</span></pre></li>
<li class="listitem">
<pre class="literallayout"><a name="idm46275003878816-bb"></a><span class="identifier">sum</span><span class="special">(</span><span class="identifier">const_reference</span> value<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Initialize sum to value and allow implicit conversion. </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span> <a name="idm46275003877408-bb"></a><span class="identifier">sum</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="sum.html" title="Class template sum">sum</a><span class="special">&lt;</span> <span class="identifier">T</span> <span class="special">&gt;</span> <span class="special">&amp;</span> s<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Allow implicit conversion from sum&lt;T&gt; </li>
<li class="listitem">
<pre class="literallayout"><a name="idm46275003874880-bb"></a><span class="identifier">sum</span><span class="special">(</span><span class="identifier">const_reference</span> large<span class="special">,</span> <span class="identifier">const_reference</span> small<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Initialize sum explicitly with large and small parts. </li>
</ol></div>
</div>
<div class="refsect2">
<a name="idm45878792079984"></a><h3>
<a name="idm46275003918016-bb"></a><code class="computeroutput">sum</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><a class="link" href="sum.html" title="Class template sum">sum</a> <span class="special">&amp;</span> <a name="idm46275003917456-bb"></a><span class="keyword">operator</span><span class="special">++</span><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Increment sum by one. </li>
<li class="listitem">
<pre class="literallayout"><a class="link" href="sum.html" title="Class template sum">sum</a> <span class="special">&amp;</span> <a name="idm46275003915920-bb"></a><span class="keyword">operator</span><span class="special">+=</span><span class="special">(</span><span class="identifier">const_reference</span> value<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Increment sum by value. </li>
<li class="listitem">
<pre class="literallayout"><a class="link" href="sum.html" title="Class template sum">sum</a> <span class="special">&amp;</span> <a name="idm46275003913680-bb"></a><span class="keyword">operator</span><span class="special">+=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="sum.html" title="Class template sum">sum</a> <span class="special">&amp;</span> s<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Add another sum. </li>
<li class="listitem">
<pre class="literallayout"><a class="link" href="sum.html" title="Class template sum">sum</a> <span class="special">&amp;</span> <a name="idm46275003911008-bb"></a><span class="keyword">operator</span> <span class="special">*=</span><span class="special">(</span><span class="identifier">const_reference</span> value<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Scale by value. </li>
<li class="listitem"><pre class="literallayout"><span class="keyword">bool</span> <a name="idm46275003908784-bb"></a><span class="keyword">operator</span><span class="special">==</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="sum.html" title="Class template sum">sum</a> <span class="special">&amp;</span> rhs<span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="keyword">bool</span> <a name="idm46275003906688-bb"></a><span class="keyword">operator</span><span class="special">!=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="sum.html" title="Class template sum">sum</a> <span class="special">&amp;</span> rhs<span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">value_type</span> <a name="idm46275003904592-bb"></a><span class="identifier">value</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Return value of the sum. </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">const_reference</span> <a name="idm46275003903328-bb"></a><span class="identifier">large</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Return large part of the sum. </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">const_reference</span> <a name="idm46275003902064-bb"></a><span class="identifier">small</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Return small part of the sum. </li>
<li class="listitem"><pre class="literallayout"><span class="keyword">explicit</span> <a name="idm46275003900800-bb"></a><span class="keyword">operator</span> <span class="identifier">value_type</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Archive<span class="special">&gt;</span> <span class="keyword">void</span> <a name="idm46275003899568-bb"></a><span class="identifier">serialize</span><span class="special">(</span><span class="identifier">Archive</span> <span class="special">&amp;</span> ar<span class="special">,</span> <span class="keyword">unsigned</span><span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><a class="link" href="sum.html" title="Class template sum">sum</a> <span class="special">&amp;</span> <a name="idm46275003896816-bb"></a><span class="keyword">operator</span> <span class="special">*=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="sum.html" title="Class template sum">sum</a> <span class="special">&amp;</span> rhs<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><a class="link" href="sum.html" title="Class template sum">sum</a> <a name="idm46275003894432-bb"></a><span class="keyword">operator</span> <span class="special">*</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="sum.html" title="Class template sum">sum</a> <span class="special">&amp;</span> rhs<span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><a class="link" href="sum.html" title="Class template sum">sum</a> <span class="special">&amp;</span> <a name="idm46275003892208-bb"></a><span class="keyword">operator</span><span class="special">/=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="sum.html" title="Class template sum">sum</a> <span class="special">&amp;</span> rhs<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><a class="link" href="sum.html" title="Class template sum">sum</a> <a name="idm46275003889824-bb"></a><span class="keyword">operator</span><span class="special">/</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="sum.html" title="Class template sum">sum</a> <span class="special">&amp;</span> rhs<span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="keyword">bool</span> <a name="idm46275003887600-bb"></a><span class="keyword">operator</span><span class="special">&lt;</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="sum.html" title="Class template sum">sum</a> <span class="special">&amp;</span> rhs<span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="keyword">bool</span> <a name="idm46275003885504-bb"></a><span class="keyword">operator</span><span class="special">&gt;</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="sum.html" title="Class template sum">sum</a> <span class="special">&amp;</span> rhs<span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="keyword">bool</span> <a name="idm46275003883408-bb"></a><span class="keyword">operator</span><span class="special">&lt;=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="sum.html" title="Class template sum">sum</a> <span class="special">&amp;</span> rhs<span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="keyword">bool</span> <a name="idm46275003881312-bb"></a><span class="keyword">operator</span><span class="special">&gt;=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="sum.html" title="Class template sum">sum</a> <span class="special">&amp;</span> rhs<span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li>
</ol></div>
</div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
Dembinski<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="mean.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.accumulators.sum_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="thread_safe.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,106 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Class template thread_safe</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../../histogram/reference.html#header.boost.histogram.accumulators.thread_safe_hpp" title="Header &lt;boost/histogram/accumulators/thread_safe.hpp&gt;">
<link rel="prev" href="sum.html" title="Class template sum">
<link rel="next" href="weighted_mean.html" title="Class template weighted_mean">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="sum.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.accumulators.thread_safe_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="weighted_mean.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.histogram.accumulators.thread_safe"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class template thread_safe</span></h2>
<p>boost::histogram::accumulators::thread_safe — Thread-safe adaptor for builtin integral and floating point numbers. </p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../histogram/reference.html#header.boost.histogram.accumulators.thread_safe_hpp" title="Header &lt;boost/histogram/accumulators/thread_safe.hpp&gt;">boost/histogram/accumulators/thread_safe.hpp</a>&gt;
</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span>
<span class="keyword">class</span> <a class="link" href="thread_safe.html" title="Class template thread_safe">thread_safe</a> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">atomic</span><span class="special">&lt;</span> <span class="identifier">T</span> <span class="special">&gt;</span> <span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
<span class="comment">// types</span>
<span class="keyword">typedef</span> <span class="identifier">T</span> <a name="boost.histogram.accumulators.thread_safe.value_type"></a><span class="identifier">value_type</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">atomic</span><span class="special">&lt;</span> <span class="identifier">T</span> <span class="special">&gt;</span> <a name="boost.histogram.accumulators.thread_safe.super_t"></a><span class="identifier">super_t</span><span class="special">;</span>
<span class="comment">// <a class="link" href="thread_safe.html#boost.histogram.accumulators.thread_safeconstruct-copy-destruct">construct/copy/destruct</a></span>
<a class="link" href="thread_safe.html#idm46275003857264-bb"><span class="identifier">thread_safe</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
<a class="link" href="thread_safe.html#idm46275003856864-bb"><span class="identifier">thread_safe</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="thread_safe.html" title="Class template thread_safe">thread_safe</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
<a class="link" href="thread_safe.html#idm46275003853216-bb"><span class="identifier">thread_safe</span></a><span class="special">(</span><span class="identifier">value_type</span><span class="special">)</span><span class="special">;</span>
<a class="link" href="thread_safe.html" title="Class template thread_safe">thread_safe</a> <span class="special">&amp;</span> <a class="link" href="thread_safe.html#idm46275003855328-bb"><span class="keyword">operator</span><span class="special">=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="thread_safe.html" title="Class template thread_safe">thread_safe</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
<a class="link" href="thread_safe.html" title="Class template thread_safe">thread_safe</a> <span class="special">&amp;</span> <a class="link" href="thread_safe.html#idm46275003852400-bb"><span class="keyword">operator</span><span class="special">=</span></a><span class="special">(</span><span class="identifier">value_type</span><span class="special">)</span><span class="special">;</span>
<span class="comment">// <a class="link" href="thread_safe.html#idm46275003865328-bb">public member functions</a></span>
<a class="link" href="thread_safe.html" title="Class template thread_safe">thread_safe</a> <span class="special">&amp;</span> <a class="link" href="thread_safe.html#idm46275003864768-bb"><span class="keyword">operator</span><span class="special">+=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="thread_safe.html" title="Class template thread_safe">thread_safe</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
<a class="link" href="thread_safe.html" title="Class template thread_safe">thread_safe</a> <span class="special">&amp;</span> <a class="link" href="thread_safe.html#idm46275003862656-bb"><span class="keyword">operator</span><span class="special">+=</span></a><span class="special">(</span><span class="identifier">value_type</span><span class="special">)</span><span class="special">;</span>
<a class="link" href="thread_safe.html" title="Class template thread_safe">thread_safe</a> <span class="special">&amp;</span> <a class="link" href="thread_safe.html#idm46275003860992-bb"><span class="keyword">operator</span><span class="special">++</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Archive<span class="special">&gt;</span> <span class="keyword">void</span> <a class="link" href="thread_safe.html#idm46275003860016-bb"><span class="identifier">serialize</span></a><span class="special">(</span><span class="identifier">Archive</span> <span class="special">&amp;</span><span class="special">,</span> <span class="keyword">unsigned</span><span class="special">)</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm45878791832624"></a><h2>Description</h2>
<p>This adaptor uses std::atomic to make concurrent increments and additions safe for the stored value.</p>
<p>On common computing platforms, the adapted integer has the same size and alignment as underlying type. The atomicity is implemented with a special CPU instruction. On exotic platforms the size of the adapted number may be larger and/or the type may have different alignment, which means it cannot be tightly packed into arrays.</p>
<p>
</p>
<div class="refsect2">
<a name="idm45878791830992"></a><h3>Template Parameters</h3>
<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
<pre class="literallayout"><span class="keyword">typename</span> T</pre>
<p>type to adapt, must be supported by std::atomic. </p>
</li></ol></div>
</div>
<div class="refsect2">
<a name="idm45878791827840"></a><h3>
<a name="boost.histogram.accumulators.thread_safeconstruct-copy-destruct"></a><code class="computeroutput">thread_safe</code>
public
construct/copy/destruct</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem"><pre class="literallayout"><a name="idm46275003857264-bb"></a><span class="identifier">thread_safe</span><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><a name="idm46275003856864-bb"></a><span class="identifier">thread_safe</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="thread_safe.html" title="Class template thread_safe">thread_safe</a> <span class="special">&amp;</span> o<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><a name="idm46275003853216-bb"></a><span class="identifier">thread_safe</span><span class="special">(</span><span class="identifier">value_type</span> arg<span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><a class="link" href="thread_safe.html" title="Class template thread_safe">thread_safe</a> <span class="special">&amp;</span> <a name="idm46275003855328-bb"></a><span class="keyword">operator</span><span class="special">=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="thread_safe.html" title="Class template thread_safe">thread_safe</a> <span class="special">&amp;</span> o<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><a class="link" href="thread_safe.html" title="Class template thread_safe">thread_safe</a> <span class="special">&amp;</span> <a name="idm46275003852400-bb"></a><span class="keyword">operator</span><span class="special">=</span><span class="special">(</span><span class="identifier">value_type</span> arg<span class="special">)</span><span class="special">;</span></pre></li>
</ol></div>
</div>
<div class="refsect2">
<a name="idm45878791795184"></a><h3>
<a name="idm46275003865328-bb"></a><code class="computeroutput">thread_safe</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem"><pre class="literallayout"><a class="link" href="thread_safe.html" title="Class template thread_safe">thread_safe</a> <span class="special">&amp;</span> <a name="idm46275003864768-bb"></a><span class="keyword">operator</span><span class="special">+=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="thread_safe.html" title="Class template thread_safe">thread_safe</a> <span class="special">&amp;</span> arg<span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><a class="link" href="thread_safe.html" title="Class template thread_safe">thread_safe</a> <span class="special">&amp;</span> <a name="idm46275003862656-bb"></a><span class="keyword">operator</span><span class="special">+=</span><span class="special">(</span><span class="identifier">value_type</span> arg<span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><a class="link" href="thread_safe.html" title="Class template thread_safe">thread_safe</a> <span class="special">&amp;</span> <a name="idm46275003860992-bb"></a><span class="keyword">operator</span><span class="special">++</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Archive<span class="special">&gt;</span> <span class="keyword">void</span> <a name="idm46275003860016-bb"></a><span class="identifier">serialize</span><span class="special">(</span><span class="identifier">Archive</span> <span class="special">&amp;</span> ar<span class="special">,</span> <span class="keyword">unsigned</span><span class="special">)</span><span class="special">;</span></pre></li>
</ol></div>
</div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
Dembinski<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="sum.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.accumulators.thread_safe_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="weighted_mean.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,121 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Class template weighted_mean</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../../histogram/reference.html#header.boost.histogram.accumulators.weighted_mean_hpp" title="Header &lt;boost/histogram/accumulators/weighted_mean.hpp&gt;">
<link rel="prev" href="thread_safe.html" title="Class template thread_safe">
<link rel="next" href="weighted_sum.html" title="Class template weighted_sum">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="thread_safe.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.accumulators.weighted_mean_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="weighted_sum.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.histogram.accumulators.weighted_mean"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class template weighted_mean</span></h2>
<p>boost::histogram::accumulators::weighted_mean — Calculates mean and variance of weighted sample. </p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../histogram/reference.html#header.boost.histogram.accumulators.weighted_mean_hpp" title="Header &lt;boost/histogram/accumulators/weighted_mean.hpp&gt;">boost/histogram/accumulators/weighted_mean.hpp</a>&gt;
</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> ValueType<span class="special">&gt;</span>
<span class="keyword">class</span> <a class="link" href="weighted_mean.html" title="Class template weighted_mean">weighted_mean</a> <span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
<span class="comment">// types</span>
<span class="keyword">typedef</span> <span class="identifier">ValueType</span> <a name="boost.histogram.accumulators.weighted_mean.value_type"></a><span class="identifier">value_type</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="keyword">const</span> <span class="identifier">value_type</span> <span class="special">&amp;</span> <a name="boost.histogram.accumulators.weighted_mean.const_reference"></a><span class="identifier">const_reference</span><span class="special">;</span>
<span class="comment">// <a class="link" href="weighted_mean.html#boost.histogram.accumulators.weighted_meanconstruct-copy-destruct">construct/copy/destruct</a></span>
<a class="link" href="weighted_mean.html#idm46275003820304-bb"><span class="identifier">weighted_mean</span></a><span class="special">(</span><span class="special">)</span> <span class="special">=</span> <span class="keyword">default</span><span class="special">;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span> <a class="link" href="weighted_mean.html#idm46275003819904-bb"><span class="identifier">weighted_mean</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="weighted_mean.html" title="Class template weighted_mean">weighted_mean</a><span class="special">&lt;</span> <span class="identifier">T</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
<a class="link" href="weighted_mean.html#idm46275003817632-bb"><span class="identifier">weighted_mean</span></a><span class="special">(</span><span class="identifier">const_reference</span><span class="special">,</span> <span class="identifier">const_reference</span><span class="special">,</span> <span class="identifier">const_reference</span><span class="special">,</span>
<span class="identifier">const_reference</span><span class="special">)</span><span class="special">;</span>
<span class="comment">// <a class="link" href="weighted_mean.html#idm46275003845456-bb">public member functions</a></span>
<span class="keyword">void</span> <a class="link" href="weighted_mean.html#idm46275003844896-bb"><span class="keyword">operator</span><span class="special">(</span><span class="special">)</span></a><span class="special">(</span><span class="identifier">const_reference</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">void</span> <a class="link" href="weighted_mean.html#idm46275003843232-bb"><span class="keyword">operator</span><span class="special">(</span><span class="special">)</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="../weight_type.html" title="Struct template weight_type">weight_type</a><span class="special">&lt;</span> <span class="identifier">value_type</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">const_reference</span><span class="special">)</span><span class="special">;</span>
<a class="link" href="weighted_mean.html" title="Class template weighted_mean">weighted_mean</a> <span class="special">&amp;</span> <a class="link" href="weighted_mean.html#idm46275003840416-bb"><span class="keyword">operator</span><span class="special">+=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="weighted_mean.html" title="Class template weighted_mean">weighted_mean</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
<a class="link" href="weighted_mean.html" title="Class template weighted_mean">weighted_mean</a> <span class="special">&amp;</span> <a class="link" href="weighted_mean.html#idm46275003837264-bb"><span class="keyword">operator</span> <span class="special">*=</span></a><span class="special">(</span><span class="identifier">const_reference</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="keyword">bool</span> <a class="link" href="weighted_mean.html#idm46275003834592-bb"><span class="keyword">operator</span><span class="special">==</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="weighted_mean.html" title="Class template weighted_mean">weighted_mean</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="keyword">bool</span> <a class="link" href="weighted_mean.html#idm46275003832496-bb"><span class="keyword">operator</span><span class="special">!=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="weighted_mean.html" title="Class template weighted_mean">weighted_mean</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="identifier">const_reference</span> <a class="link" href="weighted_mean.html#idm46275003830400-bb"><span class="identifier">sum_of_weights</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="identifier">const_reference</span> <a class="link" href="weighted_mean.html#idm46275003829152-bb"><span class="identifier">sum_of_weights_squared</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="identifier">const_reference</span> <a class="link" href="weighted_mean.html#idm46275003827856-bb"><span class="identifier">value</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="identifier">value_type</span> <a class="link" href="weighted_mean.html#idm46275003825696-bb"><span class="identifier">variance</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Archive<span class="special">&gt;</span> <span class="keyword">void</span> <a class="link" href="weighted_mean.html#idm46275003823056-bb"><span class="identifier">serialize</span></a><span class="special">(</span><span class="identifier">Archive</span> <span class="special">&amp;</span><span class="special">,</span> <span class="keyword">unsigned</span><span class="special">)</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm45878791633024"></a><h2>Description</h2>
<p>Uses West's incremental algorithm to improve numerical stability of mean and variance computation. </p>
<div class="refsect2">
<a name="idm45878791632240"></a><h3>
<a name="boost.histogram.accumulators.weighted_meanconstruct-copy-destruct"></a><code class="computeroutput">weighted_mean</code>
public
construct/copy/destruct</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem"><pre class="literallayout"><a name="idm46275003820304-bb"></a><span class="identifier">weighted_mean</span><span class="special">(</span><span class="special">)</span> <span class="special">=</span> <span class="keyword">default</span><span class="special">;</span></pre></li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span> <a name="idm46275003819904-bb"></a><span class="identifier">weighted_mean</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="weighted_mean.html" title="Class template weighted_mean">weighted_mean</a><span class="special">&lt;</span> <span class="identifier">T</span> <span class="special">&gt;</span> <span class="special">&amp;</span> o<span class="special">)</span><span class="special">;</span></pre>Allow implicit conversion from other weighted_means. </li>
<li class="listitem">
<pre class="literallayout"><a name="idm46275003817632-bb"></a><span class="identifier">weighted_mean</span><span class="special">(</span><span class="identifier">const_reference</span> wsum<span class="special">,</span> <span class="identifier">const_reference</span> wsum2<span class="special">,</span>
<span class="identifier">const_reference</span> mean<span class="special">,</span> <span class="identifier">const_reference</span> variance<span class="special">)</span><span class="special">;</span></pre>Initialize to external sum of weights, sum of weights squared, mean, and variance. </li>
</ol></div>
</div>
<div class="refsect2">
<a name="idm45878791605680"></a><h3>
<a name="idm46275003845456-bb"></a><code class="computeroutput">weighted_mean</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="idm46275003844896-bb"></a><span class="keyword">operator</span><span class="special">(</span><span class="special">)</span><span class="special">(</span><span class="identifier">const_reference</span> x<span class="special">)</span><span class="special">;</span></pre>Insert sample x. </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="idm46275003843232-bb"></a><span class="keyword">operator</span><span class="special">(</span><span class="special">)</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="../weight_type.html" title="Struct template weight_type">weight_type</a><span class="special">&lt;</span> <span class="identifier">value_type</span> <span class="special">&gt;</span> <span class="special">&amp;</span> w<span class="special">,</span> <span class="identifier">const_reference</span> x<span class="special">)</span><span class="special">;</span></pre>Insert sample x with weight w. </li>
<li class="listitem">
<pre class="literallayout"><a class="link" href="weighted_mean.html" title="Class template weighted_mean">weighted_mean</a> <span class="special">&amp;</span> <a name="idm46275003840416-bb"></a><span class="keyword">operator</span><span class="special">+=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="weighted_mean.html" title="Class template weighted_mean">weighted_mean</a> <span class="special">&amp;</span> rhs<span class="special">)</span><span class="special">;</span></pre>Add another <code class="computeroutput"><a class="link" href="weighted_mean.html" title="Class template weighted_mean">weighted_mean</a></code>.</li>
<li class="listitem">
<pre class="literallayout"><a class="link" href="weighted_mean.html" title="Class template weighted_mean">weighted_mean</a> <span class="special">&amp;</span> <a name="idm46275003837264-bb"></a><span class="keyword">operator</span> <span class="special">*=</span><span class="special">(</span><span class="identifier">const_reference</span> s<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Scale by value. <p>This acts as if all samples were scaled by the value. </p>
</li>
<li class="listitem"><pre class="literallayout"><span class="keyword">bool</span> <a name="idm46275003834592-bb"></a><span class="keyword">operator</span><span class="special">==</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="weighted_mean.html" title="Class template weighted_mean">weighted_mean</a> <span class="special">&amp;</span> rhs<span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="keyword">bool</span> <a name="idm46275003832496-bb"></a><span class="keyword">operator</span><span class="special">!=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="weighted_mean.html" title="Class template weighted_mean">weighted_mean</a> <span class="special">&amp;</span> rhs<span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">const_reference</span> <a name="idm46275003830400-bb"></a><span class="identifier">sum_of_weights</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Return sum of weights. </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">const_reference</span> <a name="idm46275003829152-bb"></a><span class="identifier">sum_of_weights_squared</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Return sum of weights squared (variance of weight distribution). </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">const_reference</span> <a name="idm46275003827856-bb"></a><span class="identifier">value</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Return mean value of accumulated weighted samples. <p>The result is undefined, if <code class="computeroutput">sum_of_weights() == 0</code>.</p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">value_type</span> <a name="idm46275003825696-bb"></a><span class="identifier">variance</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Return variance of accumulated weighted samples. <p>The result is undefined, if <code class="computeroutput">sum_of_weights() == 0</code> or<code class="computeroutput">sum_of_weights() == sum_of_weights_squared()</code>.</p>
</li>
<li class="listitem"><pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Archive<span class="special">&gt;</span> <span class="keyword">void</span> <a name="idm46275003823056-bb"></a><span class="identifier">serialize</span><span class="special">(</span><span class="identifier">Archive</span> <span class="special">&amp;</span> ar<span class="special">,</span> <span class="keyword">unsigned</span><span class="special">)</span><span class="special">;</span></pre></li>
</ol></div>
</div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
Dembinski<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="thread_safe.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.accumulators.weighted_mean_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="weighted_sum.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,114 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Class template weighted_sum</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../../histogram/reference.html#header.boost.histogram.accumulators.weighted_sum_hpp" title="Header &lt;boost/histogram/accumulators/weighted_sum.hpp&gt;">
<link rel="prev" href="weighted_mean.html" title="Class template weighted_mean">
<link rel="next" href="../algorithm/empty.html" title="Function template empty">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="weighted_mean.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.accumulators.weighted_sum_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="../algorithm/empty.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.histogram.accumulators.weighted_sum"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class template weighted_sum</span></h2>
<p>boost::histogram::accumulators::weighted_sum — Holds sum of weights and its variance estimate. </p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../histogram/reference.html#header.boost.histogram.accumulators.weighted_sum_hpp" title="Header &lt;boost/histogram/accumulators/weighted_sum.hpp&gt;">boost/histogram/accumulators/weighted_sum.hpp</a>&gt;
</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> ValueType<span class="special">&gt;</span>
<span class="keyword">class</span> <a class="link" href="weighted_sum.html" title="Class template weighted_sum">weighted_sum</a> <span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
<span class="comment">// types</span>
<span class="keyword">typedef</span> <span class="identifier">ValueType</span> <a name="boost.histogram.accumulators.weighted_sum.value_type"></a><span class="identifier">value_type</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="keyword">const</span> <span class="identifier">value_type</span> <span class="special">&amp;</span> <a name="boost.histogram.accumulators.weighted_sum.const_reference"></a><span class="identifier">const_reference</span><span class="special">;</span>
<span class="comment">// <a class="link" href="weighted_sum.html#boost.histogram.accumulators.weighted_sumconstruct-copy-destruct">construct/copy/destruct</a></span>
<a class="link" href="weighted_sum.html#idm46275003790048-bb"><span class="identifier">weighted_sum</span></a><span class="special">(</span><span class="special">)</span> <span class="special">=</span> <span class="keyword">default</span><span class="special">;</span>
<a class="link" href="weighted_sum.html#idm46275003789648-bb"><span class="identifier">weighted_sum</span></a><span class="special">(</span><span class="identifier">const_reference</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span> <a class="link" href="weighted_sum.html#idm46275003788240-bb"><span class="identifier">weighted_sum</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="weighted_sum.html" title="Class template weighted_sum">weighted_sum</a><span class="special">&lt;</span> <span class="identifier">T</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
<a class="link" href="weighted_sum.html#idm46275003785712-bb"><span class="identifier">weighted_sum</span></a><span class="special">(</span><span class="identifier">const_reference</span><span class="special">,</span> <span class="identifier">const_reference</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="comment">// <a class="link" href="weighted_sum.html#idm46275003809344-bb">public member functions</a></span>
<a class="link" href="weighted_sum.html" title="Class template weighted_sum">weighted_sum</a> <span class="special">&amp;</span> <a class="link" href="weighted_sum.html#idm46275003808784-bb"><span class="keyword">operator</span><span class="special">++</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
<a class="link" href="weighted_sum.html" title="Class template weighted_sum">weighted_sum</a> <span class="special">&amp;</span> <a class="link" href="weighted_sum.html#idm46275003807520-bb"><span class="keyword">operator</span><span class="special">+=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="../weight_type.html" title="Struct template weight_type">weight_type</a><span class="special">&lt;</span> <span class="identifier">value_type</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
<a class="link" href="weighted_sum.html" title="Class template weighted_sum">weighted_sum</a> <span class="special">&amp;</span> <a class="link" href="weighted_sum.html#idm46275003805120-bb"><span class="keyword">operator</span><span class="special">+=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="weighted_sum.html" title="Class template weighted_sum">weighted_sum</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
<a class="link" href="weighted_sum.html" title="Class template weighted_sum">weighted_sum</a> <span class="special">&amp;</span> <a class="link" href="weighted_sum.html#idm46275003802704-bb"><span class="keyword">operator</span> <span class="special">*=</span></a><span class="special">(</span><span class="identifier">const_reference</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">bool</span> <a class="link" href="weighted_sum.html#idm46275003800752-bb"><span class="keyword">operator</span><span class="special">==</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="weighted_sum.html" title="Class template weighted_sum">weighted_sum</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="keyword">bool</span> <a class="link" href="weighted_sum.html#idm46275003798656-bb"><span class="keyword">operator</span><span class="special">!=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="weighted_sum.html" title="Class template weighted_sum">weighted_sum</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="identifier">const_reference</span> <a class="link" href="weighted_sum.html#idm46275003796560-bb"><span class="identifier">value</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="identifier">const_reference</span> <a class="link" href="weighted_sum.html#idm46275003795296-bb"><span class="identifier">variance</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="keyword">explicit</span> <a class="link" href="weighted_sum.html#idm46275003794032-bb"><span class="keyword">operator</span> <span class="identifier">const_reference</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Archive<span class="special">&gt;</span> <span class="keyword">void</span> <a class="link" href="weighted_sum.html#idm46275003792800-bb"><span class="identifier">serialize</span></a><span class="special">(</span><span class="identifier">Archive</span> <span class="special">&amp;</span><span class="special">,</span> <span class="keyword">unsigned</span><span class="special">)</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm45878791389440"></a><h2>Description</h2>
<div class="refsect2">
<a name="idm45878791389024"></a><h3>
<a name="boost.histogram.accumulators.weighted_sumconstruct-copy-destruct"></a><code class="computeroutput">weighted_sum</code>
public
construct/copy/destruct</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem"><pre class="literallayout"><a name="idm46275003790048-bb"></a><span class="identifier">weighted_sum</span><span class="special">(</span><span class="special">)</span> <span class="special">=</span> <span class="keyword">default</span><span class="special">;</span></pre></li>
<li class="listitem">
<pre class="literallayout"><a name="idm46275003789648-bb"></a><span class="identifier">weighted_sum</span><span class="special">(</span><span class="identifier">const_reference</span> value<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Initialize sum to value and allow implicit conversion. </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span> <a name="idm46275003788240-bb"></a><span class="identifier">weighted_sum</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="weighted_sum.html" title="Class template weighted_sum">weighted_sum</a><span class="special">&lt;</span> <span class="identifier">T</span> <span class="special">&gt;</span> <span class="special">&amp;</span> s<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Allow implicit conversion from sum&lt;T&gt; </li>
<li class="listitem">
<pre class="literallayout"><a name="idm46275003785712-bb"></a><span class="identifier">weighted_sum</span><span class="special">(</span><span class="identifier">const_reference</span> value<span class="special">,</span> <span class="identifier">const_reference</span> variance<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Initialize sum to value and variance. </li>
</ol></div>
</div>
<div class="refsect2">
<a name="idm45878791358640"></a><h3>
<a name="idm46275003809344-bb"></a><code class="computeroutput">weighted_sum</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><a class="link" href="weighted_sum.html" title="Class template weighted_sum">weighted_sum</a> <span class="special">&amp;</span> <a name="idm46275003808784-bb"></a><span class="keyword">operator</span><span class="special">++</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>Increment by one. </li>
<li class="listitem">
<pre class="literallayout"><a class="link" href="weighted_sum.html" title="Class template weighted_sum">weighted_sum</a> <span class="special">&amp;</span> <a name="idm46275003807520-bb"></a><span class="keyword">operator</span><span class="special">+=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="../weight_type.html" title="Struct template weight_type">weight_type</a><span class="special">&lt;</span> <span class="identifier">value_type</span> <span class="special">&gt;</span> <span class="special">&amp;</span> w<span class="special">)</span><span class="special">;</span></pre>Increment by weight. </li>
<li class="listitem">
<pre class="literallayout"><a class="link" href="weighted_sum.html" title="Class template weighted_sum">weighted_sum</a> <span class="special">&amp;</span> <a name="idm46275003805120-bb"></a><span class="keyword">operator</span><span class="special">+=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="weighted_sum.html" title="Class template weighted_sum">weighted_sum</a> <span class="special">&amp;</span> rhs<span class="special">)</span><span class="special">;</span></pre>Added another weighted sum. </li>
<li class="listitem">
<pre class="literallayout"><a class="link" href="weighted_sum.html" title="Class template weighted_sum">weighted_sum</a> <span class="special">&amp;</span> <a name="idm46275003802704-bb"></a><span class="keyword">operator</span> <span class="special">*=</span><span class="special">(</span><span class="identifier">const_reference</span> x<span class="special">)</span><span class="special">;</span></pre>Scale by value. </li>
<li class="listitem"><pre class="literallayout"><span class="keyword">bool</span> <a name="idm46275003800752-bb"></a><span class="keyword">operator</span><span class="special">==</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="weighted_sum.html" title="Class template weighted_sum">weighted_sum</a> <span class="special">&amp;</span> rhs<span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="keyword">bool</span> <a name="idm46275003798656-bb"></a><span class="keyword">operator</span><span class="special">!=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="weighted_sum.html" title="Class template weighted_sum">weighted_sum</a> <span class="special">&amp;</span> rhs<span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">const_reference</span> <a name="idm46275003796560-bb"></a><span class="identifier">value</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Return value of the sum. </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">const_reference</span> <a name="idm46275003795296-bb"></a><span class="identifier">variance</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Return estimated variance of the sum. </li>
<li class="listitem"><pre class="literallayout"><span class="keyword">explicit</span> <a name="idm46275003794032-bb"></a><span class="keyword">operator</span> <span class="identifier">const_reference</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Archive<span class="special">&gt;</span> <span class="keyword">void</span> <a name="idm46275003792800-bb"></a><span class="identifier">serialize</span><span class="special">(</span><span class="identifier">Archive</span> <span class="special">&amp;</span> ar<span class="special">,</span> <span class="keyword">unsigned</span><span class="special">)</span><span class="special">;</span></pre></li>
</ol></div>
</div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
Dembinski<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="weighted_mean.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.accumulators.weighted_sum_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="../algorithm/empty.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,87 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Function crop_and_rebin</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_hpp" title="Header &lt;boost/histogram/algorithm/reduce.hpp&gt;">
<link rel="prev" href="crop_and_idm46275003747808.html" title="Function crop_and_rebin">
<link rel="next" href="rebin_idm46275003731952.html" title="Function rebin">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="crop_and_idm46275003747808.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_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="rebin_idm46275003731952.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.histogram.algorithm.crop_and_idm46275003739328"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Function crop_and_rebin</span></h2>
<p>boost::histogram::algorithm::crop_and_rebin — Crop and rebin command to be used in <code class="computeroutput">reduce</code>.</p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_hpp" title="Header &lt;boost/histogram/algorithm/reduce.hpp&gt;">boost/histogram/algorithm/reduce.hpp</a>&gt;
</span>
<span class="identifier">reduce_command</span> <span class="identifier">crop_and_rebin</span><span class="special">(</span><span class="keyword">double</span> lower<span class="special">,</span> <span class="keyword">double</span> upper<span class="special">,</span> <span class="keyword">unsigned</span> merge<span class="special">)</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm45878790909056"></a><h2>Description</h2>
<p>Command is applied to corresponding axis in order of reduce arguments.</p>
<p>To <code class="computeroutput">crop</code> and<code class="computeroutput">rebin</code> in one command (see the respective commands for more details). Equivalent to passing both commands for the same axis to<code class="computeroutput">reduce</code>.</p>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">lower</code></span></p></td>
<td><p>lowest bound that should be kept. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">merge</code></span></p></td>
<td><p>how many adjacent bins to merge into one. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">upper</code></span></p></td>
<td><p>highest bound that should be kept. If upper is inside bin interval, the whole interval is removed. </p></td>
</tr>
</tbody>
</table></div></td>
</tr></tbody>
</table></div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
Dembinski<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="crop_and_idm46275003747808.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_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="rebin_idm46275003731952.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,92 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Function crop_and_rebin</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_hpp" title="Header &lt;boost/histogram/algorithm/reduce.hpp&gt;">
<link rel="prev" href="crop_idm46275003753872.html" title="Function crop">
<link rel="next" href="crop_and_idm46275003739328.html" title="Function crop_and_rebin">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="crop_idm46275003753872.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_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="crop_and_idm46275003739328.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.histogram.algorithm.crop_and_idm46275003747808"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Function crop_and_rebin</span></h2>
<p>boost::histogram::algorithm::crop_and_rebin — Crop and rebin command to be used in <code class="computeroutput">reduce</code>.</p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_hpp" title="Header &lt;boost/histogram/algorithm/reduce.hpp&gt;">boost/histogram/algorithm/reduce.hpp</a>&gt;
</span>
<span class="identifier">reduce_command</span>
<span class="identifier">crop_and_rebin</span><span class="special">(</span><span class="keyword">unsigned</span> iaxis<span class="special">,</span> <span class="keyword">double</span> lower<span class="special">,</span> <span class="keyword">double</span> upper<span class="special">,</span> <span class="keyword">unsigned</span> merge<span class="special">)</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm45878790930704"></a><h2>Description</h2>
<p>Command is applied to axis with given index.</p>
<p>To <code class="computeroutput">crop</code> and<code class="computeroutput">rebin</code> in one command (see the respective commands for more details). Equivalent to passing both commands for the same axis to<code class="computeroutput">reduce</code>.</p>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">iaxis</code></span></p></td>
<td><p>which axis to operate on. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">lower</code></span></p></td>
<td><p>lowest bound that should be kept. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">merge</code></span></p></td>
<td><p>how many adjacent bins to merge into one. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">upper</code></span></p></td>
<td><p>highest bound that should be kept. If upper is inside bin interval, the whole interval is removed. </p></td>
</tr>
</tbody>
</table></div></td>
</tr></tbody>
</table></div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
Dembinski<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="crop_idm46275003753872.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_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="crop_and_idm46275003739328.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,84 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Function crop</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_hpp" title="Header &lt;boost/histogram/algorithm/reduce.hpp&gt;">
<link rel="prev" href="crop_idm46275003760352.html" title="Function crop">
<link rel="next" href="crop_and_idm46275003747808.html" title="Function crop_and_rebin">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="crop_idm46275003760352.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_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="crop_and_idm46275003747808.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.histogram.algorithm.crop_idm46275003753872"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Function crop</span></h2>
<p>boost::histogram::algorithm::crop — Crop command to be used in <code class="computeroutput">reduce</code>.</p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_hpp" title="Header &lt;boost/histogram/algorithm/reduce.hpp&gt;">boost/histogram/algorithm/reduce.hpp</a>&gt;
</span>
<span class="identifier">reduce_command</span> <span class="identifier">crop</span><span class="special">(</span><span class="keyword">double</span> lower<span class="special">,</span> <span class="keyword">double</span> upper<span class="special">)</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm45878790950528"></a><h2>Description</h2>
<p>Command is applied to corresponding axis in order of reduce arguments.</p>
<p>Works like <code class="computeroutput">shrink</code> (see shrink documentation for details), but counts in removed bins are discarded, whether underflow and overflow bins are present or not. If the cropped range goes beyond the axis range, then the content of the underflow or overflow bin which overlaps with the range is kept.</p>
<p>If the counts in an existing underflow or overflow bin are discared by the crop, the corresponding memory cells are not physically removed. Only their contents are set to zero. This technical limitation may be lifted in the future, then crop may completely remove the cropped memory cells.</p>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">lower</code></span></p></td>
<td><p>bin which contains lower is first to be kept. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">upper</code></span></p></td>
<td><p>bin which contains upper is last to be kept, except if upper is equal to the lower edge. </p></td>
</tr>
</tbody>
</table></div></td>
</tr></tbody>
</table></div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
Dembinski<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="crop_idm46275003760352.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_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="crop_and_idm46275003747808.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,87 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Function crop</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_hpp" title="Header &lt;boost/histogram/algorithm/reduce.hpp&gt;">
<link rel="prev" href="project_idm46275003767440.html" title="Function template project">
<link rel="next" href="crop_idm46275003753872.html" title="Function crop">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="project_idm46275003767440.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_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="crop_idm46275003753872.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.histogram.algorithm.crop_idm46275003760352"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Function crop</span></h2>
<p>boost::histogram::algorithm::crop — Crop command to be used in <code class="computeroutput">reduce</code>.</p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_hpp" title="Header &lt;boost/histogram/algorithm/reduce.hpp&gt;">boost/histogram/algorithm/reduce.hpp</a>&gt;
</span>
<span class="identifier">reduce_command</span> <span class="identifier">crop</span><span class="special">(</span><span class="keyword">unsigned</span> iaxis<span class="special">,</span> <span class="keyword">double</span> lower<span class="special">,</span> <span class="keyword">double</span> upper<span class="special">)</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm45878790968128"></a><h2>Description</h2>
<p>Command is applied to axis with given index.</p>
<p>Works like <code class="computeroutput">shrink</code> (see shrink documentation for details), but counts in removed bins are always discarded, whether underflow and overflow bins are present or not.</p>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">iaxis</code></span></p></td>
<td><p>which axis to operate on. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">lower</code></span></p></td>
<td><p>bin which contains lower is first to be kept. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">upper</code></span></p></td>
<td><p>bin which contains upper is last to be kept, except if upper is equal to the lower edge. </p></td>
</tr>
</tbody>
</table></div></td>
</tr></tbody>
</table></div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
Dembinski<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="project_idm46275003767440.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_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="crop_idm46275003753872.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,58 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Function template empty</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../../histogram/reference.html#header.boost.histogram.algorithm.empty_hpp" title="Header &lt;boost/histogram/algorithm/empty.hpp&gt;">
<link rel="prev" href="../accumulators/weighted_sum.html" title="Class template weighted_sum">
<link rel="next" href="project_idm46275003774064.html" title="Function template project">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../accumulators/weighted_sum.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.algorithm.empty_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="project_idm46275003774064.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.histogram.algorithm.empty"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Function template empty</span></h2>
<p>boost::histogram::algorithm::empty — Check to see if all histogram cells are empty. </p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../histogram/reference.html#header.boost.histogram.algorithm.empty_hpp" title="Header &lt;boost/histogram/algorithm/empty.hpp&gt;">boost/histogram/algorithm/empty.hpp</a>&gt;
</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> A<span class="special">,</span> <span class="keyword">typename</span> S<span class="special">&gt;</span>
<span class="keyword">auto</span> <span class="identifier">empty</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="../histogram.html" title="Class template histogram">histogram</a><span class="special">&lt;</span> <span class="identifier">A</span><span class="special">,</span> <span class="identifier">S</span> <span class="special">&gt;</span> <span class="special">&amp;</span> h<span class="special">,</span> <span class="identifier">coverage</span> cov<span class="special">)</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm45878791239776"></a><h2>Description</h2>
<p>Use coverage to include or exclude the underflow/overflow bins.</p>
<p>This algorithm has O(N) complexity, where N is the number of cells.</p>
<p>Returns true if all cells are empty, and false otherwise. </p>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
Dembinski<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../accumulators/weighted_sum.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.algorithm.empty_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="project_idm46275003774064.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,56 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Function template project</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../../histogram/reference.html#header.boost.histogram.algorithm.project_hpp" title="Header &lt;boost/histogram/algorithm/project.hpp&gt;">
<link rel="prev" href="project_idm46275003774064.html" title="Function template project">
<link rel="next" href="crop_idm46275003760352.html" title="Function crop">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="project_idm46275003774064.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.algorithm.project_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="crop_idm46275003760352.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.histogram.algorithm.project_idm46275003767440"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Function template project</span></h2>
<p>boost::histogram::algorithm::project — Returns a lower-dimensional histogram, summing over removed axes. </p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../histogram/reference.html#header.boost.histogram.algorithm.project_hpp" title="Header &lt;boost/histogram/algorithm/project.hpp&gt;">boost/histogram/algorithm/project.hpp</a>&gt;
</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> A<span class="special">,</span> <span class="keyword">typename</span> S<span class="special">,</span> <span class="keyword">typename</span> Iterable<span class="special">&gt;</span>
<span class="keyword">auto</span> <span class="identifier">project</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="../histogram.html" title="Class template histogram">histogram</a><span class="special">&lt;</span> <span class="identifier">A</span><span class="special">,</span> <span class="identifier">S</span> <span class="special">&gt;</span> <span class="special">&amp;</span> h<span class="special">,</span> <span class="keyword">const</span> <span class="identifier">Iterable</span> <span class="special">&amp;</span> c<span class="special">)</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm45878791140320"></a><h2>Description</h2>
<p>This version accepts a source histogram and an iterable range containing the remaining indices. </p>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
Dembinski<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="project_idm46275003774064.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.algorithm.project_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="crop_idm46275003760352.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,57 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Function template project</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../../histogram/reference.html#header.boost.histogram.algorithm.project_hpp" title="Header &lt;boost/histogram/algorithm/project.hpp&gt;">
<link rel="prev" href="empty.html" title="Function template empty">
<link rel="next" href="project_idm46275003767440.html" title="Function template project">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="empty.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.algorithm.project_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="project_idm46275003767440.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.histogram.algorithm.project_idm46275003774064"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Function template project</span></h2>
<p>boost::histogram::algorithm::project — Returns a lower-dimensional histogram, summing over removed axes. </p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../histogram/reference.html#header.boost.histogram.algorithm.project_hpp" title="Header &lt;boost/histogram/algorithm/project.hpp&gt;">boost/histogram/algorithm/project.hpp</a>&gt;
</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> A<span class="special">,</span> <span class="keyword">typename</span> S<span class="special">,</span> <span class="keyword">unsigned</span> N<span class="special">,</span> <span class="keyword">typename</span><span class="special">...</span> Ns<span class="special">&gt;</span>
<span class="keyword">auto</span> <span class="identifier">project</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="../histogram.html" title="Class template histogram">histogram</a><span class="special">&lt;</span> <span class="identifier">A</span><span class="special">,</span> <span class="identifier">S</span> <span class="special">&gt;</span> <span class="special">&amp;</span> h<span class="special">,</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">integral_constant</span><span class="special">&lt;</span> <span class="keyword">unsigned</span><span class="special">,</span> <span class="identifier">N</span> <span class="special">&gt;</span><span class="special">,</span> <span class="identifier">Ns</span><span class="special">...</span><span class="special">)</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm45878791161856"></a><h2>Description</h2>
<p>Arguments are the source histogram and compile-time numbers, the remaining indices of the axes. Returns a new histogram which only contains the subset of axes. The source histogram is summed over the removed axes. </p>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
Dembinski<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="empty.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.algorithm.project_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="project_idm46275003767440.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,77 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Function rebin</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_hpp" title="Header &lt;boost/histogram/algorithm/reduce.hpp&gt;">
<link rel="prev" href="rebin_idm46275003731952.html" title="Function rebin">
<link rel="next" href="reduce_idm46275003723168.html" title="Function template reduce">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="rebin_idm46275003731952.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_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="reduce_idm46275003723168.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.histogram.algorithm.rebin_idm46275003727008"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Function rebin</span></h2>
<p>boost::histogram::algorithm::rebin — Rebin command to be used in <code class="computeroutput">reduce</code>.</p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_hpp" title="Header &lt;boost/histogram/algorithm/reduce.hpp&gt;">boost/histogram/algorithm/reduce.hpp</a>&gt;
</span>
<span class="identifier">reduce_command</span> <span class="identifier">rebin</span><span class="special">(</span><span class="keyword">unsigned</span> merge<span class="special">)</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm45878790875792"></a><h2>Description</h2>
<p>Command is applied to corresponding axis in order of reduce arguments.</p>
<p>The command merges N adjacent bins into one. This makes the axis coarser and the bins wider. The original number of bins is divided by N. If there is a rest to this devision, the axis is implicitly shrunk at the upper end by that rest.</p>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">merge</code></span></p></td>
<td><p>how many adjacent bins to merge into one. </p></td>
</tr></tbody>
</table></div></td>
</tr></tbody>
</table></div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
Dembinski<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="rebin_idm46275003731952.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_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="reduce_idm46275003723168.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,83 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Function rebin</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_hpp" title="Header &lt;boost/histogram/algorithm/reduce.hpp&gt;">
<link rel="prev" href="crop_and_idm46275003739328.html" title="Function crop_and_rebin">
<link rel="next" href="rebin_idm46275003727008.html" title="Function rebin">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="crop_and_idm46275003739328.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_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="rebin_idm46275003727008.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.histogram.algorithm.rebin_idm46275003731952"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Function rebin</span></h2>
<p>boost::histogram::algorithm::rebin — Rebin command to be used in <code class="computeroutput">reduce</code>.</p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_hpp" title="Header &lt;boost/histogram/algorithm/reduce.hpp&gt;">boost/histogram/algorithm/reduce.hpp</a>&gt;
</span>
<span class="identifier">reduce_command</span> <span class="identifier">rebin</span><span class="special">(</span><span class="keyword">unsigned</span> iaxis<span class="special">,</span> <span class="keyword">unsigned</span> merge<span class="special">)</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm45878790890240"></a><h2>Description</h2>
<p>Command is applied to axis with given index.</p>
<p>The command merges N adjacent bins into one. This makes the axis coarser and the bins wider. The original number of bins is divided by N. If there is a rest to this devision, the axis is implicitly shrunk at the upper end by that rest.</p>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">iaxis</code></span></p></td>
<td><p>which axis to operate on. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">merge</code></span></p></td>
<td><p>how many adjacent bins to merge into one. </p></td>
</tr>
</tbody>
</table></div></td>
</tr></tbody>
</table></div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
Dembinski<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="crop_and_idm46275003739328.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_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="rebin_idm46275003727008.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,55 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Type definition reduce_command</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_hpp" title="Header &lt;boost/histogram/algorithm/reduce.hpp&gt;">
<link rel="prev" href="reduce_idm46275003710928.html" title="Function template reduce">
<link rel="next" href="shrink_idm46275003696976.html" title="Function shrink">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="reduce_idm46275003710928.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_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="shrink_idm46275003696976.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.histogram.algorithm.reduce_command"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Type definition reduce_command</span></h2>
<p>reduce_command — Holder for a reduce command. </p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_hpp" title="Header &lt;boost/histogram/algorithm/reduce.hpp&gt;">boost/histogram/algorithm/reduce.hpp</a>&gt;
</span>
<span class="keyword">typedef</span> <span class="emphasis"><em><span class="identifier">unspecified</span></em></span> <span class="identifier">reduce_command</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm45878790797680"></a><h2>Description</h2>
<p>Use this type to store reduce commands in a container. The internals of this type are an implementation detail. </p>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
Dembinski<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="reduce_idm46275003710928.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_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="shrink_idm46275003696976.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,90 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Function template reduce</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_hpp" title="Header &lt;boost/histogram/algorithm/reduce.hpp&gt;">
<link rel="prev" href="reduce_idm46275003723168.html" title="Function template reduce">
<link rel="next" href="reduce_command.html" title="Type definition reduce_command">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="reduce_idm46275003723168.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_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="reduce_command.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.histogram.algorithm.reduce_idm46275003710928"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Function template reduce</span></h2>
<p>boost::histogram::algorithm::reduce — Shrink, slice, and/or rebin axes of a histogram. </p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_hpp" title="Header &lt;boost/histogram/algorithm/reduce.hpp&gt;">boost/histogram/algorithm/reduce.hpp</a>&gt;
</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Histogram<span class="special">,</span> <span class="keyword">class</span><span class="special">...</span> Ts<span class="special">&gt;</span>
<span class="identifier">Histogram</span> <span class="identifier">reduce</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">Histogram</span> <span class="special">&amp;</span> hist<span class="special">,</span> <span class="keyword">const</span> <span class="identifier">reduce_command</span> <span class="special">&amp;</span> opt<span class="special">,</span>
<span class="keyword">const</span> <span class="identifier">Ts</span> <span class="special">&amp;</span><span class="special">...</span> opts<span class="special">)</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm45878790819680"></a><h2>Description</h2>
<p>Returns a new reduced histogram and leaves the original histogram untouched.</p>
<p>The commands <code class="computeroutput">rebin</code> and<code class="computeroutput">shrink</code> or<code class="computeroutput">slice</code> for the same axis are automatically combined, this is not an error. Passing a<code class="computeroutput">shrink</code> and a<code class="computeroutput">slice</code> command for the same axis or two<code class="computeroutput">rebin</code> commands triggers an invalid_argument exception. It is safe to reduce histograms with some axis that are not reducible along the other axes. Trying to reducing a non-reducible axis triggers an invalid_argument exception.</p>
<p>An overload allows one to pass an iterable of reduce_command.</p>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">hist</code></span></p></td>
<td><p>original histogram. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">opt</code></span></p></td>
<td><p>first reduce command; one of <code class="computeroutput">shrink</code>,<code class="computeroutput">slice</code>,<code class="computeroutput">rebin</code>,<code class="computeroutput">shrink_and_rebin</code>, or<code class="computeroutput">slice_or_rebin</code>.</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">opts</code></span></p></td>
<td><p>more reduce commands. </p></td>
</tr>
</tbody>
</table></div></td>
</tr></tbody>
</table></div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
Dembinski<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="reduce_idm46275003723168.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_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="reduce_command.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,85 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Function template reduce</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_hpp" title="Header &lt;boost/histogram/algorithm/reduce.hpp&gt;">
<link rel="prev" href="rebin_idm46275003727008.html" title="Function rebin">
<link rel="next" href="reduce_idm46275003710928.html" title="Function template reduce">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="rebin_idm46275003727008.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_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="reduce_idm46275003710928.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.histogram.algorithm.reduce_idm46275003723168"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Function template reduce</span></h2>
<p>boost::histogram::algorithm::reduce — Shrink, crop, slice, and/or rebin axes of a histogram. </p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_hpp" title="Header &lt;boost/histogram/algorithm/reduce.hpp&gt;">boost/histogram/algorithm/reduce.hpp</a>&gt;
</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Histogram<span class="special">,</span> <span class="keyword">typename</span> Iterable<span class="special">&gt;</span>
<span class="identifier">Histogram</span> <span class="identifier">reduce</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">Histogram</span> <span class="special">&amp;</span> hist<span class="special">,</span> <span class="keyword">const</span> <span class="identifier">Iterable</span> <span class="special">&amp;</span> options<span class="special">)</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm45878790855424"></a><h2>Description</h2>
<p>Returns a new reduced histogram and leaves the original histogram untouched.</p>
<p>The commands <code class="computeroutput">rebin</code> and<code class="computeroutput">shrink</code> or<code class="computeroutput">slice</code> for the same axis are automatically combined, this is not an error. Passing a<code class="computeroutput">shrink</code> and a<code class="computeroutput">slice</code> command for the same axis or two<code class="computeroutput">rebin</code> commands triggers an<code class="computeroutput">invalid_argument</code> exception. Trying to reducing a non-reducible axis triggers an<code class="computeroutput">invalid_argument</code> exception. Histograms with non-reducible axes can still be reduced along the other axes that are reducible.</p>
<p>An overload allows one to pass reduce_command as positional arguments.</p>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">hist</code></span></p></td>
<td><p>original histogram. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">options</code></span></p></td>
<td><p>iterable sequence of reduce commands: <code class="computeroutput">shrink</code>,<code class="computeroutput">slice</code>,<code class="computeroutput">rebin</code>,<code class="computeroutput">shrink_and_rebin</code>, or<code class="computeroutput">slice_and_rebin</code>. The element type of the iterable should be<code class="computeroutput">reduce_command</code>.</p></td>
</tr>
</tbody>
</table></div></td>
</tr></tbody>
</table></div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
Dembinski<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="rebin_idm46275003727008.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_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="reduce_idm46275003710928.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,87 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Function shrink_and_rebin</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_hpp" title="Header &lt;boost/histogram/algorithm/reduce.hpp&gt;">
<link rel="prev" href="shrink_a_idm46275003683872.html" title="Function shrink_and_rebin">
<link rel="next" href="slice_idm46275003668832.html" title="Function slice">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="shrink_a_idm46275003683872.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_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="slice_idm46275003668832.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.histogram.algorithm.shrink_a_idm46275003676208"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Function shrink_and_rebin</span></h2>
<p>boost::histogram::algorithm::shrink_and_rebin — Shrink and rebin command to be used in <code class="computeroutput">reduce</code>.</p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_hpp" title="Header &lt;boost/histogram/algorithm/reduce.hpp&gt;">boost/histogram/algorithm/reduce.hpp</a>&gt;
</span>
<span class="identifier">reduce_command</span> <span class="identifier">shrink_and_rebin</span><span class="special">(</span><span class="keyword">double</span> lower<span class="special">,</span> <span class="keyword">double</span> upper<span class="special">,</span> <span class="keyword">unsigned</span> merge<span class="special">)</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm45878790727280"></a><h2>Description</h2>
<p>Command is applied to corresponding axis in order of reduce arguments.</p>
<p>To <code class="computeroutput">shrink</code> and<code class="computeroutput">rebin</code> in one command (see the respective commands for more details). Equivalent to passing both commands for the same axis to<code class="computeroutput">reduce</code>.</p>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">lower</code></span></p></td>
<td><p>lowest bound that should be kept. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">merge</code></span></p></td>
<td><p>how many adjacent bins to merge into one. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">upper</code></span></p></td>
<td><p>highest bound that should be kept. If upper is inside bin interval, the whole interval is removed. </p></td>
</tr>
</tbody>
</table></div></td>
</tr></tbody>
</table></div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
Dembinski<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="shrink_a_idm46275003683872.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_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="slice_idm46275003668832.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,92 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Function shrink_and_rebin</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_hpp" title="Header &lt;boost/histogram/algorithm/reduce.hpp&gt;">
<link rel="prev" href="shrink_idm46275003689872.html" title="Function shrink">
<link rel="next" href="shrink_a_idm46275003676208.html" title="Function shrink_and_rebin">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="shrink_idm46275003689872.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_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="shrink_a_idm46275003676208.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.histogram.algorithm.shrink_a_idm46275003683872"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Function shrink_and_rebin</span></h2>
<p>boost::histogram::algorithm::shrink_and_rebin — Shrink and rebin command to be used in <code class="computeroutput">reduce</code>.</p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_hpp" title="Header &lt;boost/histogram/algorithm/reduce.hpp&gt;">boost/histogram/algorithm/reduce.hpp</a>&gt;
</span>
<span class="identifier">reduce_command</span>
<span class="identifier">shrink_and_rebin</span><span class="special">(</span><span class="keyword">unsigned</span> iaxis<span class="special">,</span> <span class="keyword">double</span> lower<span class="special">,</span> <span class="keyword">double</span> upper<span class="special">,</span> <span class="keyword">unsigned</span> merge<span class="special">)</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm45878790747664"></a><h2>Description</h2>
<p>Command is applied to corresponding axis in order of reduce arguments.</p>
<p>To shrink(unsigned, double, double) and rebin(unsigned, unsigned) in one command (see the respective commands for more details). Equivalent to passing both commands for the same axis to <code class="computeroutput">reduce</code>.</p>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">iaxis</code></span></p></td>
<td><p>which axis to operate on. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">lower</code></span></p></td>
<td><p>lowest bound that should be kept. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">merge</code></span></p></td>
<td><p>how many adjacent bins to merge into one. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">upper</code></span></p></td>
<td><p>highest bound that should be kept. If upper is inside bin interval, the whole interval is removed. </p></td>
</tr>
</tbody>
</table></div></td>
</tr></tbody>
</table></div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
Dembinski<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="shrink_idm46275003689872.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_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="shrink_a_idm46275003676208.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,84 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Function shrink</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_hpp" title="Header &lt;boost/histogram/algorithm/reduce.hpp&gt;">
<link rel="prev" href="shrink_idm46275003696976.html" title="Function shrink">
<link rel="next" href="shrink_a_idm46275003683872.html" title="Function shrink_and_rebin">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="shrink_idm46275003696976.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_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="shrink_a_idm46275003683872.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.histogram.algorithm.shrink_idm46275003689872"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Function shrink</span></h2>
<p>boost::histogram::algorithm::shrink — Shrink command to be used in <code class="computeroutput">reduce</code>.</p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_hpp" title="Header &lt;boost/histogram/algorithm/reduce.hpp&gt;">boost/histogram/algorithm/reduce.hpp</a>&gt;
</span>
<span class="identifier">reduce_command</span> <span class="identifier">shrink</span><span class="special">(</span><span class="keyword">double</span> lower<span class="special">,</span> <span class="keyword">double</span> upper<span class="special">)</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm45878790767344"></a><h2>Description</h2>
<p>Command is applied to corresponding axis in order of reduce arguments.</p>
<p>Shrinking is based on an inclusive value interval. The bin which contains the first value starts the range of bins to keep. The bin which contains the second value is the last included in that range. When the second value is exactly equal to a lower bin edge, then the previous bin is the last in the range.</p>
<p>The counts in removed bins are added to the corresponding underflow and overflow bins, if they are present. If they are not present, the counts are discarded. Also see <code class="computeroutput">crop</code>, which always discards the counts.</p>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">lower</code></span></p></td>
<td><p>bin which contains lower is first to be kept. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">upper</code></span></p></td>
<td><p>bin which contains upper is last to be kept, except if upper is equal to the lower edge. </p></td>
</tr>
</tbody>
</table></div></td>
</tr></tbody>
</table></div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
Dembinski<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="shrink_idm46275003696976.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_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="shrink_a_idm46275003683872.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,88 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Function shrink</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_hpp" title="Header &lt;boost/histogram/algorithm/reduce.hpp&gt;">
<link rel="prev" href="reduce_command.html" title="Type definition reduce_command">
<link rel="next" href="shrink_idm46275003689872.html" title="Function shrink">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="reduce_command.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_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="shrink_idm46275003689872.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.histogram.algorithm.shrink_idm46275003696976"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Function shrink</span></h2>
<p>boost::histogram::algorithm::shrink — Shrink command to be used in <code class="computeroutput">reduce</code>.</p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_hpp" title="Header &lt;boost/histogram/algorithm/reduce.hpp&gt;">boost/histogram/algorithm/reduce.hpp</a>&gt;
</span>
<span class="identifier">reduce_command</span> <span class="identifier">shrink</span><span class="special">(</span><span class="keyword">unsigned</span> iaxis<span class="special">,</span> <span class="keyword">double</span> lower<span class="special">,</span> <span class="keyword">double</span> upper<span class="special">)</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm45878790785568"></a><h2>Description</h2>
<p>Command is applied to axis with given index.</p>
<p>Shrinking is based on an inclusive value interval. The bin which contains the first value starts the range of bins to keep. The bin which contains the second value is the last included in that range. When the second value is exactly equal to a lower bin edge, then the previous bin is the last in the range.</p>
<p>The counts in removed bins are added to the corresponding underflow and overflow bins, if they are present. If they are not present, the counts are discarded. Also see <code class="computeroutput">crop</code>, which always discards the counts.</p>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">iaxis</code></span></p></td>
<td><p>which axis to operate on. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">lower</code></span></p></td>
<td><p>bin which contains lower is first to be kept. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">upper</code></span></p></td>
<td><p>bin which contains upper is last to be kept, except if upper is equal to the lower edge. </p></td>
</tr>
</tbody>
</table></div></td>
</tr></tbody>
</table></div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
Dembinski<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="reduce_command.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_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="shrink_idm46275003689872.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,93 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Function slice_and_rebin</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_hpp" title="Header &lt;boost/histogram/algorithm/reduce.hpp&gt;">
<link rel="prev" href="slice_an_idm46275003651792.html" title="Function slice_and_rebin">
<link rel="next" href="sum.html" title="Function template sum">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="slice_an_idm46275003651792.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_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="sum.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.histogram.algorithm.slice_an_idm46275003641952"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Function slice_and_rebin</span></h2>
<p>boost::histogram::algorithm::slice_and_rebin — Slice and rebin command to be used in <code class="computeroutput">reduce</code>.</p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_hpp" title="Header &lt;boost/histogram/algorithm/reduce.hpp&gt;">boost/histogram/algorithm/reduce.hpp</a>&gt;
</span>
<span class="identifier">reduce_command</span>
<span class="identifier">slice_and_rebin</span><span class="special">(</span><span class="identifier">axis</span><span class="special">::</span><span class="identifier">index_type</span> begin<span class="special">,</span> <span class="identifier">axis</span><span class="special">::</span><span class="identifier">index_type</span> end<span class="special">,</span> <span class="keyword">unsigned</span> merge<span class="special">,</span>
<span class="identifier">slice_mode</span> mode <span class="special">=</span> <span class="identifier">slice_mode</span><span class="special">::</span><span class="identifier">shrink</span><span class="special">)</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm45878790617824"></a><h2>Description</h2>
<p>Command is applied to corresponding axis in order of reduce arguments.</p>
<p>To <code class="computeroutput">slice</code> and<code class="computeroutput">rebin</code> in one command (see the respective commands for more details). Equivalent to passing both commands for the same axis to<code class="computeroutput">reduce</code>.</p>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">begin</code></span></p></td>
<td><p>first index that should be kept. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">end</code></span></p></td>
<td><p>one past the last index that should be kept. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">merge</code></span></p></td>
<td><p>how many adjacent bins to merge into one. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">mode</code></span></p></td>
<td><p>slice mode, see slice_mode. </p></td>
</tr>
</tbody>
</table></div></td>
</tr></tbody>
</table></div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
Dembinski<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="slice_an_idm46275003651792.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_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="sum.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,97 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Function slice_and_rebin</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_hpp" title="Header &lt;boost/histogram/algorithm/reduce.hpp&gt;">
<link rel="prev" href="slice_idm46275003659760.html" title="Function slice">
<link rel="next" href="slice_an_idm46275003641952.html" title="Function slice_and_rebin">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="slice_idm46275003659760.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_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="slice_an_idm46275003641952.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.histogram.algorithm.slice_an_idm46275003651792"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Function slice_and_rebin</span></h2>
<p>boost::histogram::algorithm::slice_and_rebin — Slice and rebin command to be used in <code class="computeroutput">reduce</code>.</p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_hpp" title="Header &lt;boost/histogram/algorithm/reduce.hpp&gt;">boost/histogram/algorithm/reduce.hpp</a>&gt;
</span>
<span class="identifier">reduce_command</span>
<span class="identifier">slice_and_rebin</span><span class="special">(</span><span class="keyword">unsigned</span> iaxis<span class="special">,</span> <span class="identifier">axis</span><span class="special">::</span><span class="identifier">index_type</span> begin<span class="special">,</span> <span class="identifier">axis</span><span class="special">::</span><span class="identifier">index_type</span> end<span class="special">,</span>
<span class="keyword">unsigned</span> merge<span class="special">,</span> <span class="identifier">slice_mode</span> mode <span class="special">=</span> <span class="identifier">slice_mode</span><span class="special">::</span><span class="identifier">shrink</span><span class="special">)</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm45878790646304"></a><h2>Description</h2>
<p>Command is applied to axis with given index.</p>
<p>To <code class="computeroutput">slice</code> and<code class="computeroutput">rebin</code> in one command (see the respective commands for more details). Equivalent to passing both commands for the same axis to<code class="computeroutput">reduce</code>.</p>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">begin</code></span></p></td>
<td><p>first index that should be kept. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">end</code></span></p></td>
<td><p>one past the last index that should be kept. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">iaxis</code></span></p></td>
<td><p>which axis to operate on. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">merge</code></span></p></td>
<td><p>how many adjacent bins to merge into one. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">mode</code></span></p></td>
<td><p>slice mode, see slice_mode. </p></td>
</tr>
</tbody>
</table></div></td>
</tr></tbody>
</table></div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
Dembinski<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="slice_idm46275003659760.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_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="slice_an_idm46275003641952.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,89 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Function slice</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_hpp" title="Header &lt;boost/histogram/algorithm/reduce.hpp&gt;">
<link rel="prev" href="slice_idm46275003668832.html" title="Function slice">
<link rel="next" href="slice_an_idm46275003651792.html" title="Function slice_and_rebin">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="slice_idm46275003668832.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_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="slice_an_idm46275003651792.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.histogram.algorithm.slice_idm46275003659760"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Function slice</span></h2>
<p>boost::histogram::algorithm::slice — Slice command to be used in <code class="computeroutput">reduce</code>.</p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_hpp" title="Header &lt;boost/histogram/algorithm/reduce.hpp&gt;">boost/histogram/algorithm/reduce.hpp</a>&gt;
</span>
<span class="identifier">reduce_command</span>
<span class="identifier">slice</span><span class="special">(</span><span class="identifier">axis</span><span class="special">::</span><span class="identifier">index_type</span> begin<span class="special">,</span> <span class="identifier">axis</span><span class="special">::</span><span class="identifier">index_type</span> end<span class="special">,</span>
<span class="identifier">slice_mode</span> mode <span class="special">=</span> <span class="identifier">slice_mode</span><span class="special">::</span><span class="identifier">shrink</span><span class="special">)</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm45878790674464"></a><h2>Description</h2>
<p>Command is applied to corresponding axis in order of reduce arguments.</p>
<p>Slicing works like <code class="computeroutput">shrink</code> or<code class="computeroutput">crop</code>, but uses bin indices instead of values.</p>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">begin</code></span></p></td>
<td><p>first index that should be kept. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">end</code></span></p></td>
<td><p>one past the last index that should be kept. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">mode</code></span></p></td>
<td><p>whether to behave like <code class="computeroutput">shrink</code> or<code class="computeroutput">crop</code> regarding removed bins.</p></td>
</tr>
</tbody>
</table></div></td>
</tr></tbody>
</table></div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
Dembinski<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="slice_idm46275003668832.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_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="slice_an_idm46275003651792.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,93 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Function slice</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_hpp" title="Header &lt;boost/histogram/algorithm/reduce.hpp&gt;">
<link rel="prev" href="shrink_a_idm46275003676208.html" title="Function shrink_and_rebin">
<link rel="next" href="slice_idm46275003659760.html" title="Function slice">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="shrink_a_idm46275003676208.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_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="slice_idm46275003659760.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.histogram.algorithm.slice_idm46275003668832"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Function slice</span></h2>
<p>boost::histogram::algorithm::slice — Slice command to be used in <code class="computeroutput">reduce</code>.</p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_hpp" title="Header &lt;boost/histogram/algorithm/reduce.hpp&gt;">boost/histogram/algorithm/reduce.hpp</a>&gt;
</span>
<span class="identifier">reduce_command</span>
<span class="identifier">slice</span><span class="special">(</span><span class="keyword">unsigned</span> iaxis<span class="special">,</span> <span class="identifier">axis</span><span class="special">::</span><span class="identifier">index_type</span> begin<span class="special">,</span> <span class="identifier">axis</span><span class="special">::</span><span class="identifier">index_type</span> end<span class="special">,</span>
<span class="identifier">slice_mode</span> mode <span class="special">=</span> <span class="identifier">slice_mode</span><span class="special">::</span><span class="identifier">shrink</span><span class="special">)</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm45878790701072"></a><h2>Description</h2>
<p>Command is applied to axis with given index.</p>
<p>Slicing works like <code class="computeroutput">shrink</code> or<code class="computeroutput">crop</code>, but uses bin indices instead of values.</p>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">begin</code></span></p></td>
<td><p>first index that should be kept. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">end</code></span></p></td>
<td><p>one past the last index that should be kept. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">iaxis</code></span></p></td>
<td><p>which axis to operate on. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">mode</code></span></p></td>
<td><p>whether to behave like <code class="computeroutput">shrink</code> or<code class="computeroutput">crop</code> regarding removed bins.</p></td>
</tr>
</tbody>
</table></div></td>
</tr></tbody>
</table></div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
Dembinski<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="shrink_a_idm46275003676208.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.algorithm.reduce_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="slice_idm46275003659760.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,103 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Function template sum</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../../histogram/reference.html#header.boost.histogram.algorithm.sum_hpp" title="Header &lt;boost/histogram/algorithm/sum.hpp&gt;">
<link rel="prev" href="slice_an_idm46275003641952.html" title="Function slice_and_rebin">
<link rel="next" href="../axis/boolean.html" title="Class template boolean">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="slice_an_idm46275003641952.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.algorithm.sum_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="../axis/boolean.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.histogram.algorithm.sum"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Function template sum</span></h2>
<p>boost::histogram::algorithm::sum — Compute the sum over all histogram cells (underflow/overflow included by default). </p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../histogram/reference.html#header.boost.histogram.algorithm.sum_hpp" title="Header &lt;boost/histogram/algorithm/sum.hpp&gt;">boost/histogram/algorithm/sum.hpp</a>&gt;
</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> A<span class="special">,</span> <span class="keyword">typename</span> S<span class="special">&gt;</span>
<span class="keyword">auto</span> <span class="identifier">sum</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="../histogram.html" title="Class template histogram">histogram</a><span class="special">&lt;</span> <span class="identifier">A</span><span class="special">,</span> <span class="identifier">S</span> <span class="special">&gt;</span> <span class="special">&amp;</span> hist<span class="special">,</span> <span class="keyword">const</span> <span class="identifier">coverage</span> cov <span class="special">=</span> <span class="identifier">coverage</span><span class="special">::</span><span class="identifier">all</span><span class="special">)</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm45878790559664"></a><h2>Description</h2>
<p>The implementation favors accuracy and protection against overflow over speed. If the value type of the histogram is an integral or floating point type, accumulators::sum&lt;double&gt; is used to compute the sum, else the original value type is used. Compilation fails, if the value type does not support operator+=. The return type is double if the value type of the histogram is integral or floating point, and the original value type otherwise.</p>
<p>If you need a different trade-off, you can write your own loop or use <code class="computeroutput">std::accumulate</code>:</p>
<pre class="programlisting"><span class="comment">// iterate over all bins</span>
<span class="keyword">auto</span> <span class="identifier">sum_all</span> <span class="special">=</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">accumulate</span><span class="special">(</span><span class="identifier">hist</span><span class="special">.</span><span class="identifier">begin</span><span class="special">(</span><span class="special">)</span><span class="special">,</span> <span class="identifier">hist</span><span class="special">.</span><span class="identifier">end</span><span class="special">(</span><span class="special">)</span><span class="special">,</span> <span class="number">0</span><span class="special">.</span><span class="number">0</span><span class="special">)</span><span class="special">;</span>
<span class="comment">// skip underflow/overflow bins</span>
<span class="keyword">double</span> <span class="identifier">sum</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span>
<span class="keyword">for</span> <span class="special">(</span><span class="keyword">auto</span><span class="special">&amp;&amp;</span> <span class="identifier">x</span> <span class="special">:</span> <span class="identifier">indexed</span><span class="special">(</span><span class="identifier">hist</span><span class="special">)</span><span class="special">)</span>
<span class="identifier">sum</span> <span class="special">+=</span> <span class="special">*</span><span class="identifier">x</span><span class="special">;</span> <span class="comment">// dereference accessor</span>
<span class="comment">// or:</span>
<span class="comment">// auto ind = boost::histogram::indexed(hist);</span>
<span class="comment">// auto sum = std::accumulate(ind.begin(), ind.end(), 0.0);</span>
</pre>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">cov</code></span></p></td>
<td><p>Iterate over all or only inner bins (optional, default: all). </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">hist</code></span></p></td>
<td><p>Const reference to the histogram. </p></td>
</tr>
</tbody>
</table></div></td>
</tr>
<tr>
<td><p><span class="term">Returns:</span></p></td>
<td><p>accumulator type or double</p></td>
</tr>
</tbody>
</table></div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
Dembinski<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="slice_an_idm46275003641952.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.algorithm.sum_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="../axis/boolean.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,139 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Class template boolean</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../../histogram/reference.html#header.boost.histogram.axis.boolean_hpp" title="Header &lt;boost/histogram/axis/boolean.hpp&gt;">
<link rel="prev" href="../algorithm/sum.html" title="Function template sum">
<link rel="next" href="category.html" title="Class template category">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<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>
</div>
<div class="refentry">
<a name="boost.histogram.axis.boolean"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class template boolean</span></h2>
<p>boost::histogram::axis::boolean — Discrete axis for boolean data. </p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../histogram/reference.html#header.boost.histogram.axis.boolean_hpp" title="Header &lt;boost/histogram/axis/boolean.hpp&gt;">boost/histogram/axis/boolean.hpp</a>&gt;
</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> MetaData<span class="special">&gt;</span>
<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&lt; boolean&lt; MetaData &gt; &gt;,
<span class="keyword">public</span> metadata_base_t&lt; MetaData &gt;
<span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
<span class="comment">// <a class="link" href="boolean.html#boost.histogram.axis.booleanconstruct-copy-destruct">construct/copy/destruct</a></span>
<span class="keyword">explicit</span> <a class="link" href="boolean.html#idm46275003597984-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>
<span class="comment">// <a class="link" href="boolean.html#idm46275003614016-bb">public member functions</a></span>
<span class="identifier">index_type</span> <a class="link" href="boolean.html#idm46275003613456-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>
<span class="identifier">value_type</span> <a class="link" href="boolean.html#idm46275003611504-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>
<span class="identifier">value_type</span> <a class="link" href="boolean.html#idm46275003609552-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>
<span class="identifier">index_type</span> <a class="link" href="boolean.html#idm46275003607600-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>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> M<span class="special">&gt;</span> <span class="keyword">bool</span> <a class="link" href="boolean.html#idm46275003606304-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">&lt;</span> <span class="identifier">M</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> M<span class="special">&gt;</span> <span class="keyword">bool</span> <a class="link" href="boolean.html#idm46275003603520-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">&lt;</span> <span class="identifier">M</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Archive<span class="special">&gt;</span> <span class="keyword">void</span> <a class="link" href="boolean.html#idm46275003600736-bb"><span class="identifier">serialize</span></a><span class="special">(</span><span class="identifier">Archive</span> <span class="special">&amp;</span><span class="special">,</span> <span class="keyword">unsigned</span><span class="special">)</span><span class="special">;</span>
<span class="comment">// <a class="link" href="boolean.html#idm46275003595456-bb">public static functions</a></span>
<span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keyword">bool</span> <a class="link" href="boolean.html#idm46275003594896-bb"><span class="identifier">inclusive</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keyword">unsigned</span> <a class="link" href="boolean.html#idm46275003592592-bb"><span class="identifier">options</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm45878790415856"></a><h2>Description</h2>
<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>
<p>
</p>
<div class="refsect2">
<a name="idm45878790414672"></a><h3>Template Parameters</h3>
<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
<pre class="literallayout"><span class="keyword">typename</span> MetaData</pre>
<p>type to store meta data. </p>
</li></ol></div>
</div>
<div class="refsect2">
<a name="idm45878790411504"></a><h3>
<a name="boost.histogram.axis.booleanconstruct-copy-destruct"></a><code class="computeroutput">boolean</code>
public
construct/copy/destruct</h3>
<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
<pre class="literallayout"><span class="keyword">explicit</span> <a name="idm46275003597984-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>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">meta</code></span></p></td>
<td><p>description of the axis. </p></td>
</tr></tbody>
</table></div></td>
</tr></tbody>
</table></div>
</li></ol></div>
</div>
<div class="refsect2">
<a name="idm45878790399056"></a><h3>
<a name="idm46275003614016-bb"></a><code class="computeroutput">boolean</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="identifier">index_type</span> <a name="idm46275003613456-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>
<li class="listitem">
<pre class="literallayout"><span class="identifier">value_type</span> <a name="idm46275003611504-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>
<li class="listitem">
<pre class="literallayout"><span class="identifier">value_type</span> <a name="idm46275003609552-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>
<li class="listitem">
<pre class="literallayout"><span class="identifier">index_type</span> <a name="idm46275003607600-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>
<li class="listitem"><pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> M<span class="special">&gt;</span> <span class="keyword">bool</span> <a name="idm46275003606304-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">&lt;</span> <span class="identifier">M</span> <span class="special">&gt;</span> <span class="special">&amp;</span> o<span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> M<span class="special">&gt;</span> <span class="keyword">bool</span> <a name="idm46275003603520-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">&lt;</span> <span class="identifier">M</span> <span class="special">&gt;</span> <span class="special">&amp;</span> o<span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Archive<span class="special">&gt;</span> <span class="keyword">void</span> <a name="idm46275003600736-bb"></a><span class="identifier">serialize</span><span class="special">(</span><span class="identifier">Archive</span> <span class="special">&amp;</span> ar<span class="special">,</span> <span class="keyword">unsigned</span><span class="special">)</span><span class="special">;</span></pre></li>
</ol></div>
</div>
<div class="refsect2">
<a name="idm45878790336112"></a><h3>
<a name="idm46275003595456-bb"></a><code class="computeroutput">boolean</code> public static functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keyword">bool</span> <a name="idm46275003594896-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>
<li class="listitem">
<pre class="literallayout"><span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keyword">unsigned</span> <a name="idm46275003592592-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>
</ol></div>
</div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
Dembinski<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<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>
</div>
</body>
</html>

View File

@@ -0,0 +1,269 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Class template category</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../../histogram/reference.html#header.boost.histogram.axis.category_hpp" title="Header &lt;boost/histogram/axis/category.hpp&gt;">
<link rel="prev" href="boolean.html" title="Class template boolean">
<link rel="next" href="integer.html" title="Class template integer">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="boolean.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.axis.category_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="integer.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.histogram.axis.category"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class template category</span></h2>
<p>boost::histogram::axis::category — Maps at a set of unique values to bin indices. </p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../histogram/reference.html#header.boost.histogram.axis.category_hpp" title="Header &lt;boost/histogram/axis/category.hpp&gt;">boost/histogram/axis/category.hpp</a>&gt;
</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Value<span class="special">,</span> <span class="keyword">typename</span> MetaData<span class="special">,</span> <span class="keyword">typename</span> Options<span class="special">,</span>
<span class="keyword">typename</span> Allocator<span class="special">&gt;</span>
<span class="keyword">class</span> <a class="link" href="category.html" title="Class template category">category</a> <span class="special">:</span> <span class="keyword">public</span> boost::histogram::axis::iterator_mixin&lt; category&lt; Value, MetaData, Options, Allocator &gt; &gt;,
<span class="keyword">public</span> metadata_base_t&lt; MetaData &gt;
<span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
<span class="comment">// <a class="link" href="category.html#boost.histogram.axis.categoryconstruct-copy-destruct">construct/copy/destruct</a></span>
<a class="link" href="category.html#idm46275003558400-bb"><span class="identifier">category</span></a><span class="special">(</span><span class="special">)</span> <span class="special">=</span> <span class="keyword">default</span><span class="special">;</span>
<span class="keyword">explicit</span> <a class="link" href="category.html#idm46275003558000-bb"><span class="identifier">category</span></a><span class="special">(</span><span class="identifier">allocator_type</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> It<span class="special">&gt;</span>
<a class="link" href="category.html#idm46275003556912-bb"><span class="identifier">category</span></a><span class="special">(</span><span class="identifier">It</span><span class="special">,</span> <span class="identifier">It</span><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="identifier">allocator_type</span> <span class="special">=</span> <span class="special">{</span><span class="special">}</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> C<span class="special">&gt;</span>
<a class="link" href="category.html#idm46275003550272-bb"><span class="identifier">category</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">C</span> <span class="special">&amp;</span><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="identifier">allocator_type</span> <span class="special">=</span> <span class="special">{</span><span class="special">}</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> U<span class="special">&gt;</span>
<a class="link" href="category.html#idm46275003544768-bb"><span class="identifier">category</span></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">initializer_list</span><span class="special">&lt;</span> <span class="identifier">U</span> <span class="special">&gt;</span><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="identifier">allocator_type</span> <span class="special">=</span> <span class="special">{</span><span class="special">}</span><span class="special">)</span><span class="special">;</span>
<a class="link" href="category.html#idm46275003538976-bb"><span class="identifier">category</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="category.html" title="Class template category">category</a> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">index_type</span><span class="special">,</span> <span class="identifier">index_type</span><span class="special">,</span> <span class="keyword">unsigned</span><span class="special">)</span><span class="special">;</span>
<span class="comment">// <a class="link" href="category.html#idm46275003580416-bb">public member functions</a></span>
<span class="identifier">index_type</span> <a class="link" href="category.html#idm46275003579856-bb"><span class="identifier">index</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">value_type</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span> <span class="identifier">index_type</span><span class="special">,</span> <span class="identifier">index_type</span> <span class="special">&gt;</span> <a class="link" href="category.html#idm46275003577904-bb"><span class="identifier">update</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">value_type</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">auto</span> <a class="link" href="category.html#idm46275003576176-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="special">;</span>
<span class="keyword">decltype</span><span class="special">(</span><span class="keyword">auto</span><span class="special">)</span> <a class="link" href="category.html#idm46275003573344-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="special">;</span>
<span class="identifier">index_type</span> <a class="link" href="category.html#idm46275003571376-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>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> V<span class="special">,</span> <span class="keyword">typename</span> M<span class="special">,</span> <span class="keyword">typename</span> O<span class="special">,</span> <span class="keyword">typename</span> A<span class="special">&gt;</span>
<span class="keyword">bool</span> <a class="link" href="category.html#idm46275003570080-bb"><span class="keyword">operator</span><span class="special">==</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="category.html" title="Class template category">category</a><span class="special">&lt;</span> <span class="identifier">V</span><span class="special">,</span> <span class="identifier">M</span><span class="special">,</span> <span class="identifier">O</span><span class="special">,</span> <span class="identifier">A</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> V<span class="special">,</span> <span class="keyword">typename</span> M<span class="special">,</span> <span class="keyword">typename</span> O<span class="special">,</span> <span class="keyword">typename</span> A<span class="special">&gt;</span>
<span class="keyword">bool</span> <a class="link" href="category.html#idm46275003566096-bb"><span class="keyword">operator</span><span class="special">!=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="category.html" title="Class template category">category</a><span class="special">&lt;</span> <span class="identifier">V</span><span class="special">,</span> <span class="identifier">M</span><span class="special">,</span> <span class="identifier">O</span><span class="special">,</span> <span class="identifier">A</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="identifier">allocator_type</span> <a class="link" href="category.html#idm46275003562112-bb"><span class="identifier">get_allocator</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Archive<span class="special">&gt;</span> <span class="keyword">void</span> <a class="link" href="category.html#idm46275003561152-bb"><span class="identifier">serialize</span></a><span class="special">(</span><span class="identifier">Archive</span> <span class="special">&amp;</span><span class="special">,</span> <span class="keyword">unsigned</span><span class="special">)</span><span class="special">;</span>
<span class="comment">// <a class="link" href="category.html#idm46275003535296-bb">public static functions</a></span>
<span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keyword">unsigned</span> <a class="link" href="category.html#idm46275003534736-bb"><span class="identifier">options</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keyword">bool</span> <a class="link" href="category.html#idm46275003533216-bb"><span class="identifier">inclusive</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keyword">bool</span> <a class="link" href="category.html#idm46275003530912-bb"><span class="identifier">ordered</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm45878790117008"></a><h2>Description</h2>
<p>The axis maps a set of values to bins, following the order of arguments in the constructor. The optional overflow bin for this axis counts input values that are not part of the set. Binning has O(N) complexity, but with a very small factor. For small N (the typical use case) it beats other kinds of lookup.</p>
<p>
The options <code class="computeroutput">underflow</code> and<code class="computeroutput">circular</code> are not allowed. The options<code class="computeroutput">growth</code> and<code class="computeroutput">overflow</code> are mutually exclusive.</p>
<div class="refsect2">
<a name="idm45878790112816"></a><h3>Template Parameters</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="keyword">typename</span> Value</pre>
<p>input value type, must be equal-comparable. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">typename</span> MetaData</pre>
<p>type to store meta data. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">typename</span> Options</pre>
<p>see boost::histogram::axis::option. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">typename</span> Allocator</pre>
<p>allocator to use for dynamic memory management.</p>
</li>
</ol></div>
</div>
<div class="refsect2">
<a name="idm45878790103376"></a><h3>
<a name="boost.histogram.axis.categoryconstruct-copy-destruct"></a><code class="computeroutput">category</code>
public
construct/copy/destruct</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem"><pre class="literallayout"><a name="idm46275003558400-bb"></a><span class="identifier">category</span><span class="special">(</span><span class="special">)</span> <span class="special">=</span> <span class="keyword">default</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="keyword">explicit</span> <a name="idm46275003558000-bb"></a><span class="identifier">category</span><span class="special">(</span><span class="identifier">allocator_type</span> alloc<span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> It<span class="special">&gt;</span>
<a name="idm46275003556912-bb"></a><span class="identifier">category</span><span class="special">(</span><span class="identifier">It</span> begin<span class="special">,</span> <span class="identifier">It</span> end<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="identifier">allocator_type</span> alloc <span class="special">=</span> <span class="special">{</span><span class="special">}</span><span class="special">)</span><span class="special">;</span></pre>Construct from iterator range of unique values. <p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">alloc</code></span></p></td>
<td><p>allocator instance to use. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">begin</code></span></p></td>
<td><p>begin of category range of unique values. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">end</code></span></p></td>
<td><p>end of category range of unique values. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">meta</code></span></p></td>
<td><p>description of the axis. </p></td>
</tr>
</tbody>
</table></div></td>
</tr></tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> C<span class="special">&gt;</span>
<a name="idm46275003550272-bb"></a><span class="identifier">category</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">C</span> <span class="special">&amp;</span> iterable<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="identifier">allocator_type</span> alloc <span class="special">=</span> <span class="special">{</span><span class="special">}</span><span class="special">)</span><span class="special">;</span></pre>Construct axis from iterable sequence of unique values. <p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">alloc</code></span></p></td>
<td><p>allocator instance to use. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">iterable</code></span></p></td>
<td><p>sequence of unique values. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">meta</code></span></p></td>
<td><p>description of the axis. </p></td>
</tr>
</tbody>
</table></div></td>
</tr></tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> U<span class="special">&gt;</span>
<a name="idm46275003544768-bb"></a><span class="identifier">category</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">initializer_list</span><span class="special">&lt;</span> <span class="identifier">U</span> <span class="special">&gt;</span> list<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="identifier">allocator_type</span> alloc <span class="special">=</span> <span class="special">{</span><span class="special">}</span><span class="special">)</span><span class="special">;</span></pre>Construct axis from an initializer list of unique values. <p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">alloc</code></span></p></td>
<td><p>allocator instance to use. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">list</code></span></p></td>
<td><p><code class="computeroutput">std::initializer_list</code> of unique values.</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">meta</code></span></p></td>
<td><p>description of the axis. </p></td>
</tr>
</tbody>
</table></div></td>
</tr></tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><a name="idm46275003538976-bb"></a><span class="identifier">category</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="category.html" title="Class template category">category</a> <span class="special">&amp;</span> src<span class="special">,</span> <span class="identifier">index_type</span> begin<span class="special">,</span> <span class="identifier">index_type</span> end<span class="special">,</span>
<span class="keyword">unsigned</span> merge<span class="special">)</span><span class="special">;</span></pre>Constructor used by algorithm::reduce to shrink and rebin (not for users). </li>
</ol></div>
</div>
<div class="refsect2">
<a name="idm45878790016576"></a><h3>
<a name="idm46275003580416-bb"></a><code class="computeroutput">category</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="identifier">index_type</span> <a name="idm46275003579856-bb"></a><span class="identifier">index</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">value_type</span> <span class="special">&amp;</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>
<li class="listitem">
<pre class="literallayout"><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span> <span class="identifier">index_type</span><span class="special">,</span> <span class="identifier">index_type</span> <span class="special">&gt;</span> <a name="idm46275003577904-bb"></a><span class="identifier">update</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">value_type</span> <span class="special">&amp;</span> x<span class="special">)</span><span class="special">;</span></pre>Returns index and shift (if axis has grown) for the passed argument. </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">auto</span> <a name="idm46275003576176-bb"></a><span class="identifier">value</span><span class="special">(</span><span class="identifier">index_type</span> idx<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Return value for index argument. <p>Throws <code class="computeroutput">std::out_of_range</code> if the index is out of bounds.</p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">decltype</span><span class="special">(</span><span class="keyword">auto</span><span class="special">)</span> <a name="idm46275003573344-bb"></a><span class="identifier">bin</span><span class="special">(</span><span class="identifier">index_type</span> idx<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Return value for index argument; alias for value(...). </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">index_type</span> <a name="idm46275003571376-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>
<li class="listitem"><pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> V<span class="special">,</span> <span class="keyword">typename</span> M<span class="special">,</span> <span class="keyword">typename</span> O<span class="special">,</span> <span class="keyword">typename</span> A<span class="special">&gt;</span>
<span class="keyword">bool</span> <a name="idm46275003570080-bb"></a><span class="keyword">operator</span><span class="special">==</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="category.html" title="Class template category">category</a><span class="special">&lt;</span> <span class="identifier">V</span><span class="special">,</span> <span class="identifier">M</span><span class="special">,</span> <span class="identifier">O</span><span class="special">,</span> <span class="identifier">A</span> <span class="special">&gt;</span> <span class="special">&amp;</span> o<span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> V<span class="special">,</span> <span class="keyword">typename</span> M<span class="special">,</span> <span class="keyword">typename</span> O<span class="special">,</span> <span class="keyword">typename</span> A<span class="special">&gt;</span>
<span class="keyword">bool</span> <a name="idm46275003566096-bb"></a><span class="keyword">operator</span><span class="special">!=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="category.html" title="Class template category">category</a><span class="special">&lt;</span> <span class="identifier">V</span><span class="special">,</span> <span class="identifier">M</span><span class="special">,</span> <span class="identifier">O</span><span class="special">,</span> <span class="identifier">A</span> <span class="special">&gt;</span> <span class="special">&amp;</span> o<span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="identifier">allocator_type</span> <a name="idm46275003562112-bb"></a><span class="identifier">get_allocator</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Archive<span class="special">&gt;</span> <span class="keyword">void</span> <a name="idm46275003561152-bb"></a><span class="identifier">serialize</span><span class="special">(</span><span class="identifier">Archive</span> <span class="special">&amp;</span> ar<span class="special">,</span> <span class="keyword">unsigned</span><span class="special">)</span><span class="special">;</span></pre></li>
</ol></div>
</div>
<div class="refsect2">
<a name="idm45878789920112"></a><h3>
<a name="idm46275003535296-bb"></a><code class="computeroutput">category</code> public static functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keyword">unsigned</span> <a name="idm46275003534736-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>
<li class="listitem">
<pre class="literallayout"><span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keyword">bool</span> <a name="idm46275003533216-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>
<li class="listitem">
<pre class="literallayout"><span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keyword">bool</span> <a name="idm46275003530912-bb"></a><span class="identifier">ordered</span><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Indicate that the axis is not ordered. </li>
</ol></div>
</div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
Dembinski<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="boolean.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.axis.category_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="integer.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,53 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Class template circular</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../../histogram/reference.html#header.boost.histogram.axis.regular_hpp" title="Header &lt;boost/histogram/axis/regular.hpp&gt;">
<link rel="prev" href="transform/sqrt.html" title="Struct sqrt">
<link rel="next" href="regular.html" title="Class template regular">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="transform/sqrt.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.axis.regular_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="regular.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.histogram.axis.circular"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class template circular</span></h2>
<p>boost::histogram::axis::circular — Regular axis with circular option already set. </p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../histogram/reference.html#header.boost.histogram.axis.regular_hpp" title="Header &lt;boost/histogram/axis/regular.hpp&gt;">boost/histogram/axis/regular.hpp</a>&gt;
</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Value <span class="special">=</span> <span class="keyword">double</span><span class="special">,</span> <span class="keyword">typename</span> MetaData <span class="special">=</span> <span class="identifier">use_default</span><span class="special">,</span>
<span class="keyword">typename</span> Options <span class="special">=</span> <span class="identifier">use_default</span><span class="special">&gt;</span>
<span class="keyword">class</span> <a class="link" href="circular.html" title="Class template circular">circular</a> <span class="special">{</span>
<span class="special">}</span><span class="special">;</span></pre></div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
Dembinski<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="transform/sqrt.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.axis.regular_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="regular.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,173 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Class template integer</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../../histogram/reference.html#header.boost.histogram.axis.integer_hpp" title="Header &lt;boost/histogram/axis/integer.hpp&gt;">
<link rel="prev" href="category.html" title="Class template category">
<link rel="next" href="interval_view.html" title="Class template interval_view">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="category.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.axis.integer_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="interval_view.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.histogram.axis.integer"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class template integer</span></h2>
<p>boost::histogram::axis::integer — Axis for an interval of integer values with unit steps. </p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../histogram/reference.html#header.boost.histogram.axis.integer_hpp" title="Header &lt;boost/histogram/axis/integer.hpp&gt;">boost/histogram/axis/integer.hpp</a>&gt;
</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Value<span class="special">,</span> <span class="keyword">typename</span> MetaData<span class="special">,</span> <span class="keyword">typename</span> Options<span class="special">&gt;</span>
<span class="keyword">class</span> <a class="link" href="integer.html" title="Class template integer">integer</a> <span class="special">:</span> <span class="keyword">public</span> boost::histogram::axis::iterator_mixin&lt; integer&lt; Value, MetaData, Options &gt; &gt;,
<span class="keyword">public</span> metadata_base_t&lt; MetaData &gt;
<span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
<span class="comment">// <a class="link" href="integer.html#boost.histogram.axis.integerconstruct-copy-destruct">construct/copy/destruct</a></span>
<a class="link" href="integer.html#idm46275003501984-bb"><span class="identifier">integer</span></a><span class="special">(</span><span class="special">)</span> <span class="special">=</span> <span class="keyword">default</span><span class="special">;</span>
<a class="link" href="integer.html#idm46275003501584-bb"><span class="identifier">integer</span></a><span class="special">(</span><span class="identifier">value_type</span><span class="special">,</span> <span class="identifier">value_type</span><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>
<a class="link" href="integer.html#idm46275003497040-bb"><span class="identifier">integer</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="integer.html" title="Class template integer">integer</a> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">index_type</span><span class="special">,</span> <span class="identifier">index_type</span><span class="special">,</span> <span class="keyword">unsigned</span><span class="special">)</span><span class="special">;</span>
<span class="comment">// <a class="link" href="integer.html#idm46275003521600-bb">public member functions</a></span>
<span class="identifier">index_type</span> <a class="link" href="integer.html#idm46275003521040-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>
<span class="keyword">auto</span> <a class="link" href="integer.html#idm46275003519088-bb"><span class="identifier">update</span></a><span class="special">(</span><span class="identifier">value_type</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="identifier">value_type</span> <a class="link" href="integer.html#idm46275003517104-bb"><span class="identifier">value</span></a><span class="special">(</span><span class="identifier">local_index_type</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="keyword">decltype</span><span class="special">(</span><span class="keyword">auto</span><span class="special">)</span> <a class="link" href="integer.html#idm46275003515152-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>
<span class="identifier">index_type</span> <a class="link" href="integer.html#idm46275003513200-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>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> V<span class="special">,</span> <span class="keyword">typename</span> M<span class="special">,</span> <span class="keyword">typename</span> O<span class="special">&gt;</span>
<span class="keyword">bool</span> <a class="link" href="integer.html#idm46275003511904-bb"><span class="keyword">operator</span><span class="special">==</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="integer.html" title="Class template integer">integer</a><span class="special">&lt;</span> <span class="identifier">V</span><span class="special">,</span> <span class="identifier">M</span><span class="special">,</span> <span class="identifier">O</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> V<span class="special">,</span> <span class="keyword">typename</span> M<span class="special">,</span> <span class="keyword">typename</span> O<span class="special">&gt;</span>
<span class="keyword">bool</span> <a class="link" href="integer.html#idm46275003508320-bb"><span class="keyword">operator</span><span class="special">!=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="integer.html" title="Class template integer">integer</a><span class="special">&lt;</span> <span class="identifier">V</span><span class="special">,</span> <span class="identifier">M</span><span class="special">,</span> <span class="identifier">O</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Archive<span class="special">&gt;</span> <span class="keyword">void</span> <a class="link" href="integer.html#idm46275003504736-bb"><span class="identifier">serialize</span></a><span class="special">(</span><span class="identifier">Archive</span> <span class="special">&amp;</span><span class="special">,</span> <span class="keyword">unsigned</span><span class="special">)</span><span class="special">;</span>
<span class="comment">// <a class="link" href="integer.html#idm46275003493376-bb">public static functions</a></span>
<span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keyword">unsigned</span> <a class="link" href="integer.html#idm46275003492816-bb"><span class="identifier">options</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keyword">bool</span> <a class="link" href="integer.html#idm46275003491296-bb"><span class="identifier">inclusive</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm45878789755648"></a><h2>Description</h2>
<p>Binning is a O(1) operation. This axis bins faster than a regular axis.</p>
<p>
</p>
<div class="refsect2">
<a name="idm45878789754640"></a><h3>Template Parameters</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="keyword">typename</span> Value</pre>
<p>input value type. Must be integer or floating point. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">typename</span> MetaData</pre>
<p>type to store meta data. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">typename</span> Options</pre>
<p>see boost::histogram::axis::option (all values allowed). </p>
</li>
</ol></div>
</div>
<div class="refsect2">
<a name="idm45878789747264"></a><h3>
<a name="boost.histogram.axis.integerconstruct-copy-destruct"></a><code class="computeroutput">integer</code>
public
construct/copy/destruct</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem"><pre class="literallayout"><a name="idm46275003501984-bb"></a><span class="identifier">integer</span><span class="special">(</span><span class="special">)</span> <span class="special">=</span> <span class="keyword">default</span><span class="special">;</span></pre></li>
<li class="listitem">
<pre class="literallayout"><a name="idm46275003501584-bb"></a><span class="identifier">integer</span><span class="special">(</span><span class="identifier">value_type</span> start<span class="special">,</span> <span class="identifier">value_type</span> stop<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 over semi-open integer interval [start, stop). <p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">meta</code></span></p></td>
<td><p>description of the axis. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">start</code></span></p></td>
<td><p>first integer of covered range. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">stop</code></span></p></td>
<td><p>one past last integer of covered range. </p></td>
</tr>
</tbody>
</table></div></td>
</tr></tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><a name="idm46275003497040-bb"></a><span class="identifier">integer</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="integer.html" title="Class template integer">integer</a> <span class="special">&amp;</span> src<span class="special">,</span> <span class="identifier">index_type</span> begin<span class="special">,</span> <span class="identifier">index_type</span> end<span class="special">,</span> <span class="keyword">unsigned</span> merge<span class="special">)</span><span class="special">;</span></pre>Constructor used by algorithm::reduce to shrink and rebin. </li>
</ol></div>
</div>
<div class="refsect2">
<a name="idm45878789714976"></a><h3>
<a name="idm46275003521600-bb"></a><code class="computeroutput">integer</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="identifier">index_type</span> <a name="idm46275003521040-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>
<li class="listitem">
<pre class="literallayout"><span class="keyword">auto</span> <a name="idm46275003519088-bb"></a><span class="identifier">update</span><span class="special">(</span><span class="identifier">value_type</span> x<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Returns index and shift (if axis has grown) for the passed argument. </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">value_type</span> <a name="idm46275003517104-bb"></a><span class="identifier">value</span><span class="special">(</span><span class="identifier">local_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>
<li class="listitem">
<pre class="literallayout"><span class="keyword">decltype</span><span class="special">(</span><span class="keyword">auto</span><span class="special">)</span> <a name="idm46275003515152-bb"></a><span class="identifier">bin</span><span class="special">(</span><span class="identifier">index_type</span> idx<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>
<li class="listitem">
<pre class="literallayout"><span class="identifier">index_type</span> <a name="idm46275003513200-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>
<li class="listitem"><pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> V<span class="special">,</span> <span class="keyword">typename</span> M<span class="special">,</span> <span class="keyword">typename</span> O<span class="special">&gt;</span>
<span class="keyword">bool</span> <a name="idm46275003511904-bb"></a><span class="keyword">operator</span><span class="special">==</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="integer.html" title="Class template integer">integer</a><span class="special">&lt;</span> <span class="identifier">V</span><span class="special">,</span> <span class="identifier">M</span><span class="special">,</span> <span class="identifier">O</span> <span class="special">&gt;</span> <span class="special">&amp;</span> o<span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> V<span class="special">,</span> <span class="keyword">typename</span> M<span class="special">,</span> <span class="keyword">typename</span> O<span class="special">&gt;</span>
<span class="keyword">bool</span> <a name="idm46275003508320-bb"></a><span class="keyword">operator</span><span class="special">!=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="integer.html" title="Class template integer">integer</a><span class="special">&lt;</span> <span class="identifier">V</span><span class="special">,</span> <span class="identifier">M</span><span class="special">,</span> <span class="identifier">O</span> <span class="special">&gt;</span> <span class="special">&amp;</span> o<span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Archive<span class="special">&gt;</span> <span class="keyword">void</span> <a name="idm46275003504736-bb"></a><span class="identifier">serialize</span><span class="special">(</span><span class="identifier">Archive</span> <span class="special">&amp;</span> ar<span class="special">,</span> <span class="keyword">unsigned</span><span class="special">)</span><span class="special">;</span></pre></li>
</ol></div>
</div>
<div class="refsect2">
<a name="idm45878789634432"></a><h3>
<a name="idm46275003493376-bb"></a><code class="computeroutput">integer</code> public static functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keyword">unsigned</span> <a name="idm46275003492816-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>
<li class="listitem">
<pre class="literallayout"><span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keyword">bool</span> <a name="idm46275003491296-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>
</ol></div>
</div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
Dembinski<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="category.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.axis.integer_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="interval_view.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,94 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Class template interval_view</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../../histogram/reference.html#header.boost.histogram.axis.interval_view_hpp" title="Header &lt;boost/histogram/axis/interval_view.hpp&gt;">
<link rel="prev" href="integer.html" title="Class template integer">
<link rel="next" href="iterator_mixin.html" title="Class template iterator_mixin">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="integer.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.axis.interval_view_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="iterator_mixin.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.histogram.axis.interval_view"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class template interval_view</span></h2>
<p>boost::histogram::axis::interval_view — Lightweight bin view. </p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../histogram/reference.html#header.boost.histogram.axis.interval_view_hpp" title="Header &lt;boost/histogram/axis/interval_view.hpp&gt;">boost/histogram/axis/interval_view.hpp</a>&gt;
</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Axis<span class="special">&gt;</span>
<span class="keyword">class</span> <a class="link" href="interval_view.html" title="Class template interval_view">interval_view</a> <span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
<span class="comment">// <a class="link" href="interval_view.html#boost.histogram.axis.interval_viewconstruct-copy-destruct">construct/copy/destruct</a></span>
<a class="link" href="interval_view.html#idm46275003474672-bb"><span class="identifier">interval_view</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">Axis</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">index_type</span><span class="special">)</span><span class="special">;</span>
<a class="link" href="interval_view.html#idm46275003473168-bb"><span class="identifier">interval_view</span></a><span class="special">(</span><span class="identifier">Axis</span> <span class="special">&amp;&amp;</span><span class="special">,</span> <span class="identifier">index_type</span><span class="special">)</span> <span class="special">=</span> <span class="keyword">delete</span><span class="special">;</span>
<span class="comment">// <a class="link" href="interval_view.html#idm46275003484928-bb">public member functions</a></span>
<span class="keyword">decltype</span><span class="special">(</span><span class="keyword">auto</span><span class="special">)</span> <a class="link" href="interval_view.html#idm46275003484368-bb"><span class="identifier">lower</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="keyword">decltype</span><span class="special">(</span><span class="keyword">auto</span><span class="special">)</span> <a class="link" href="interval_view.html#idm46275003483104-bb"><span class="identifier">upper</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="keyword">decltype</span><span class="special">(</span><span class="keyword">auto</span><span class="special">)</span> <a class="link" href="interval_view.html#idm46275003481840-bb"><span class="identifier">center</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="keyword">decltype</span><span class="special">(</span><span class="keyword">auto</span><span class="special">)</span> <a class="link" href="interval_view.html#idm46275003480592-bb"><span class="identifier">width</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> BinType<span class="special">&gt;</span> <span class="keyword">bool</span> <a class="link" href="interval_view.html#idm46275003479344-bb"><span class="keyword">operator</span><span class="special">==</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">BinType</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> BinType<span class="special">&gt;</span> <span class="keyword">bool</span> <a class="link" href="interval_view.html#idm46275003477008-bb"><span class="keyword">operator</span><span class="special">!=</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">BinType</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm45878789529216"></a><h2>Description</h2>
<p>Represents the current bin interval. </p>
<div class="refsect2">
<a name="idm45878789528496"></a><h3>
<a name="boost.histogram.axis.interval_viewconstruct-copy-destruct"></a><code class="computeroutput">interval_view</code>
public
construct/copy/destruct</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem"><pre class="literallayout"><a name="idm46275003474672-bb"></a><span class="identifier">interval_view</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">Axis</span> <span class="special">&amp;</span> axis<span class="special">,</span> <span class="identifier">index_type</span> idx<span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><a name="idm46275003473168-bb"></a><span class="identifier">interval_view</span><span class="special">(</span><span class="identifier">Axis</span> <span class="special">&amp;&amp;</span> axis<span class="special">,</span> <span class="identifier">index_type</span> idx<span class="special">)</span> <span class="special">=</span> <span class="keyword">delete</span><span class="special">;</span></pre></li>
</ol></div>
</div>
<div class="refsect2">
<a name="idm45878789511280"></a><h3>
<a name="idm46275003484928-bb"></a><code class="computeroutput">interval_view</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="keyword">decltype</span><span class="special">(</span><span class="keyword">auto</span><span class="special">)</span> <a name="idm46275003484368-bb"></a><span class="identifier">lower</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Return lower edge of bin. </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">decltype</span><span class="special">(</span><span class="keyword">auto</span><span class="special">)</span> <a name="idm46275003483104-bb"></a><span class="identifier">upper</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Return upper edge of bin. </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">decltype</span><span class="special">(</span><span class="keyword">auto</span><span class="special">)</span> <a name="idm46275003481840-bb"></a><span class="identifier">center</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Return center of bin. </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">decltype</span><span class="special">(</span><span class="keyword">auto</span><span class="special">)</span> <a name="idm46275003480592-bb"></a><span class="identifier">width</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Return width of bin. </li>
<li class="listitem"><pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> BinType<span class="special">&gt;</span> <span class="keyword">bool</span> <a name="idm46275003479344-bb"></a><span class="keyword">operator</span><span class="special">==</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">BinType</span> <span class="special">&amp;</span> rhs<span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> BinType<span class="special">&gt;</span> <span class="keyword">bool</span> <a name="idm46275003477008-bb"></a><span class="keyword">operator</span><span class="special">!=</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">BinType</span> <span class="special">&amp;</span> rhs<span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li>
</ol></div>
</div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
Dembinski<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="integer.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.axis.interval_view_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="iterator_mixin.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,79 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Class template iterator_mixin</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../../histogram/reference.html#header.boost.histogram.axis.iterator_hpp" title="Header &lt;boost/histogram/axis/iterator.hpp&gt;">
<link rel="prev" href="interval_view.html" title="Class template interval_view">
<link rel="next" href="metadata_base.html" title="Class template metadata_base">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="interval_view.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.axis.iterator_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="metadata_base.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.histogram.axis.iterator_mixin"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class template iterator_mixin</span></h2>
<p>boost::histogram::axis::iterator_mixin — Uses CRTP to inject iterator logic into Derived. </p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../histogram/reference.html#header.boost.histogram.axis.iterator_hpp" title="Header &lt;boost/histogram/axis/iterator.hpp&gt;">boost/histogram/axis/iterator.hpp</a>&gt;
</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Derived<span class="special">&gt;</span>
<span class="keyword">class</span> <a class="link" href="iterator_mixin.html" title="Class template iterator_mixin">iterator_mixin</a> <span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
<span class="comment">// types</span>
<span class="keyword">typedef</span> <span class="identifier">iterator</span><span class="special">&lt;</span> <span class="identifier">Derived</span> <span class="special">&gt;</span> <a name="boost.histogram.axis.iterator_mixin.const_iterator"></a><span class="identifier">const_iterator</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">reverse_iterator</span><span class="special">&lt;</span> <span class="identifier">const_iterator</span> <span class="special">&gt;</span> <a name="boost.histogram.axis.iterator_mixin.const_reverse_iterator"></a><span class="identifier">const_reverse_iterator</span><span class="special">;</span>
<span class="comment">// <a class="link" href="iterator_mixin.html#idm46275003466336-bb">public member functions</a></span>
<span class="identifier">const_iterator</span> <a class="link" href="iterator_mixin.html#idm46275003465776-bb"><span class="identifier">begin</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="identifier">const_iterator</span> <a class="link" href="iterator_mixin.html#idm46275003464496-bb"><span class="identifier">end</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="identifier">const_reverse_iterator</span> <a class="link" href="iterator_mixin.html#idm46275003463216-bb"><span class="identifier">rbegin</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="identifier">const_reverse_iterator</span> <a class="link" href="iterator_mixin.html#idm46275003461920-bb"><span class="identifier">rend</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm45878789397936"></a><h2>Description</h2>
<div class="refsect2">
<a name="idm45878789397520"></a><h3>
<a name="idm46275003466336-bb"></a><code class="computeroutput">iterator_mixin</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="identifier">const_iterator</span> <a name="idm46275003465776-bb"></a><span class="identifier">begin</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Bin iterator to beginning of the axis (read-only). </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">const_iterator</span> <a name="idm46275003464496-bb"></a><span class="identifier">end</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Bin iterator to the end of the axis (read-only). </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">const_reverse_iterator</span> <a name="idm46275003463216-bb"></a><span class="identifier">rbegin</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Reverse bin iterator to the last entry of the axis (read-only). </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">const_reverse_iterator</span> <a name="idm46275003461920-bb"></a><span class="identifier">rend</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Reverse bin iterator to the end (read-only). </li>
</ol></div>
</div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
Dembinski<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="interval_view.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.axis.iterator_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="metadata_base.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,101 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Class template metadata_base</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../../histogram/reference.html#header.boost.histogram.axis.metadata_base_hpp" title="Header &lt;boost/histogram/axis/metadata_base.hpp&gt;">
<link rel="prev" href="iterator_mixin.html" title="Class template iterator_mixin">
<link rel="next" href="option/bit.html" title="Struct template bit">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="iterator_mixin.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.axis.metadata_base_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="option/bit.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.histogram.axis.metadata_base"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class template metadata_base</span></h2>
<p>boost::histogram::axis::metadata_base — Meta data holder with space optimization for empty meta data types. </p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../histogram/reference.html#header.boost.histogram.axis.metadata_base_hpp" title="Header &lt;boost/histogram/axis/metadata_base.hpp&gt;">boost/histogram/axis/metadata_base.hpp</a>&gt;
</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Metadata<span class="special">&gt;</span>
<span class="keyword">class</span> <a class="link" href="metadata_base.html" title="Class template metadata_base">metadata_base</a> <span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
<span class="comment">// <a class="link" href="metadata_base.html#boost.histogram.axis.metadata_baseconstruct-copy-destruct">construct/copy/destruct</a></span>
<a class="link" href="metadata_base.html#idm46275003455216-bb"><span class="identifier">metadata_base</span></a><span class="special">(</span><span class="special">)</span> <span class="special">=</span> <span class="keyword">default</span><span class="special">;</span>
<a class="link" href="metadata_base.html#idm46275003454816-bb"><span class="identifier">metadata_base</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="metadata_base.html" title="Class template metadata_base">metadata_base</a> <span class="special">&amp;</span><span class="special">)</span> <span class="special">=</span> <span class="keyword">default</span><span class="special">;</span>
<a class="link" href="metadata_base.html#idm46275003451168-bb"><span class="identifier">metadata_base</span></a><span class="special">(</span><a class="link" href="metadata_base.html" title="Class template metadata_base">metadata_base</a> <span class="special">&amp;&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
<a class="link" href="metadata_base.html#idm46275003449792-bb"><span class="identifier">metadata_base</span></a><span class="special">(</span><span class="identifier">metadata_type</span> <span class="special">&amp;&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
<a class="link" href="metadata_base.html" title="Class template metadata_base">metadata_base</a> <span class="special">&amp;</span> <a class="link" href="metadata_base.html#idm46275003453280-bb"><span class="keyword">operator</span><span class="special">=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="metadata_base.html" title="Class template metadata_base">metadata_base</a> <span class="special">&amp;</span><span class="special">)</span> <span class="special">=</span> <span class="keyword">default</span><span class="special">;</span>
<a class="link" href="metadata_base.html" title="Class template metadata_base">metadata_base</a> <span class="special">&amp;</span> <a class="link" href="metadata_base.html#idm46275003448704-bb"><span class="keyword">operator</span><span class="special">=</span></a><span class="special">(</span><a class="link" href="metadata_base.html" title="Class template metadata_base">metadata_base</a> <span class="special">&amp;&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="comment">// <a class="link" href="metadata_base.html#idm46275003446752-bb">public member functions</a></span>
<span class="identifier">metadata_type</span> <span class="special">&amp;</span> <a class="link" href="metadata_base.html#idm46275003446192-bb"><span class="identifier">metadata</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="identifier">metadata_type</span> <span class="special">&amp;</span> <a class="link" href="metadata_base.html#idm46275003444928-bb"><span class="identifier">metadata</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm45878789295408"></a><h2>Description</h2>
<p>Allows write-access to metadata even if const.</p>
<p>
</p>
<div class="refsect2">
<a name="idm45878789294416"></a><h3>Template Parameters</h3>
<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
<pre class="literallayout"><span class="keyword">typename</span> Metadata</pre>
<p>Wrapped meta data type. </p>
</li></ol></div>
</div>
<div class="refsect2">
<a name="idm45878789291248"></a><h3>
<a name="boost.histogram.axis.metadata_baseconstruct-copy-destruct"></a><code class="computeroutput">metadata_base</code>
public
construct/copy/destruct</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem"><pre class="literallayout"><a name="idm46275003455216-bb"></a><span class="identifier">metadata_base</span><span class="special">(</span><span class="special">)</span> <span class="special">=</span> <span class="keyword">default</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><a name="idm46275003454816-bb"></a><span class="identifier">metadata_base</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="metadata_base.html" title="Class template metadata_base">metadata_base</a> <span class="special">&amp;</span><span class="special">)</span> <span class="special">=</span> <span class="keyword">default</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><a name="idm46275003451168-bb"></a><span class="identifier">metadata_base</span><span class="special">(</span><a class="link" href="metadata_base.html" title="Class template metadata_base">metadata_base</a> <span class="special">&amp;&amp;</span> o<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><a name="idm46275003449792-bb"></a><span class="identifier">metadata_base</span><span class="special">(</span><span class="identifier">metadata_type</span> <span class="special">&amp;&amp;</span> o<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><a class="link" href="metadata_base.html" title="Class template metadata_base">metadata_base</a> <span class="special">&amp;</span> <a name="idm46275003453280-bb"></a><span class="keyword">operator</span><span class="special">=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="metadata_base.html" title="Class template metadata_base">metadata_base</a> <span class="special">&amp;</span><span class="special">)</span> <span class="special">=</span> <span class="keyword">default</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><a class="link" href="metadata_base.html" title="Class template metadata_base">metadata_base</a> <span class="special">&amp;</span> <a name="idm46275003448704-bb"></a><span class="keyword">operator</span><span class="special">=</span><span class="special">(</span><a class="link" href="metadata_base.html" title="Class template metadata_base">metadata_base</a> <span class="special">&amp;&amp;</span> o<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li>
</ol></div>
</div>
<div class="refsect2">
<a name="idm45878789248448"></a><h3>
<a name="idm46275003446752-bb"></a><code class="computeroutput">metadata_base</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="identifier">metadata_type</span> <span class="special">&amp;</span> <a name="idm46275003446192-bb"></a><span class="identifier">metadata</span><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Returns reference to metadata. </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">metadata_type</span> <span class="special">&amp;</span> <a name="idm46275003444928-bb"></a><span class="identifier">metadata</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 reference to mutable metadata from const axis. </li>
</ol></div>
</div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
Dembinski<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="iterator_mixin.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.axis.metadata_base_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="option/bit.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,63 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Struct null_type</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../../histogram/reference.html#header.boost.histogram.fwd_hpp" title="Header &lt;boost/histogram/fwd.hpp&gt;">
<link rel="prev" href="../../../histogram/reference.html" title="Reference">
<link rel="next" href="../../../BOOST_HI_idm46275018510016.html" title="Macro BOOST_HISTOGRAM_DETAIL_AXES_LIMIT">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../../../histogram/reference.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.fwd_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="../../../BOOST_HI_idm46275018510016.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.histogram.axis.null_type"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Struct null_type</span></h2>
<p>boost::histogram::axis::null_type — Empty metadata type. </p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../histogram/reference.html#header.boost.histogram.fwd_hpp" title="Header &lt;boost/histogram/fwd.hpp&gt;">boost/histogram/fwd.hpp</a>&gt;
</span>
<span class="keyword">struct</span> <a class="link" href="null_type.html" title="Struct null_type">null_type</a> <span class="special">{</span>
<span class="comment">// <a class="link" href="null_type.html#idm46275018273344-bb">public member functions</a></span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Archive<span class="special">&gt;</span> <span class="keyword">void</span> <a class="link" href="null_type.html#idm46275018272784-bb"><span class="identifier">serialize</span></a><span class="special">(</span><span class="identifier">Archive</span> <span class="special">&amp;</span><span class="special">,</span> <span class="keyword">unsigned</span><span class="special">)</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm45878797185824"></a><h2>Description</h2>
<div class="refsect2">
<a name="idm45878797185408"></a><h3>
<a name="idm46275018273344-bb"></a><code class="computeroutput">null_type</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Archive<span class="special">&gt;</span> <span class="keyword">void</span> <a name="idm46275018272784-bb"></a><span class="identifier">serialize</span><span class="special">(</span><span class="identifier">Archive</span> <span class="special">&amp;</span><span class="special">,</span> <span class="keyword">unsigned</span><span class="special">)</span><span class="special">;</span></pre></li></ol></div>
</div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
Dembinski<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../../../histogram/reference.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.fwd_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="../../../BOOST_HI_idm46275018510016.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,56 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Function template operator==</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../../histogram/reference.html#header.boost.histogram.axis.variant_hpp" title="Header &lt;boost/histogram/axis/variant.hpp&gt;">
<link rel="prev" href="operator_idm46275003081248.html" title="Function template operator==">
<link rel="next" href="variant.html" title="Class template variant">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="operator_idm46275003081248.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.axis.variant_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="variant.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.histogram.axis.operator_idm46275003075824"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Function template operator==</span></h2>
<p>boost::histogram::axis::operator== — Compare variant with a concrete axis type. </p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../histogram/reference.html#header.boost.histogram.axis.variant_hpp" title="Header &lt;boost/histogram/axis/variant.hpp&gt;">boost/histogram/axis/variant.hpp</a>&gt;
</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span><span class="special">...</span> Us<span class="special">,</span> <span class="keyword">typename</span> T<span class="special">&gt;</span>
<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">==</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="variant.html" title="Class template variant">variant</a><span class="special">&lt;</span> <span class="identifier">Us</span><span class="special">...</span> <span class="special">&gt;</span> <span class="special">&amp;</span> u<span class="special">,</span> <span class="keyword">const</span> <span class="identifier">T</span> <span class="special">&amp;</span> t<span class="special">)</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm45878786842720"></a><h2>Description</h2>
<p>Return true if the variant point to the same concrete axis type and the types compare equal. Otherwise return false. </p>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
Dembinski<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="operator_idm46275003081248.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.axis.variant_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="variant.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,56 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Function template operator==</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../../histogram/reference.html#header.boost.histogram.axis.variant_hpp" title="Header &lt;boost/histogram/axis/variant.hpp&gt;">
<link rel="prev" href="variable.html" title="Class template variable">
<link rel="next" href="operator_idm46275003075824.html" title="Function template operator==">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="variable.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.axis.variant_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="operator_idm46275003075824.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.histogram.axis.operator_idm46275003081248"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Function template operator==</span></h2>
<p>boost::histogram::axis::operator== — Compare two variants. </p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../histogram/reference.html#header.boost.histogram.axis.variant_hpp" title="Header &lt;boost/histogram/axis/variant.hpp&gt;">boost/histogram/axis/variant.hpp</a>&gt;
</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span><span class="special">...</span> Us<span class="special">,</span> <span class="keyword">class</span><span class="special">...</span> Vs<span class="special">&gt;</span>
<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">==</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="variant.html" title="Class template variant">variant</a><span class="special">&lt;</span> <span class="identifier">Us</span><span class="special">...</span> <span class="special">&gt;</span> <span class="special">&amp;</span> u<span class="special">,</span> <span class="keyword">const</span> <a class="link" href="variant.html" title="Class template variant">variant</a><span class="special">&lt;</span> <span class="identifier">Vs</span><span class="special">...</span> <span class="special">&gt;</span> <span class="special">&amp;</span> v<span class="special">)</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm45878786862896"></a><h2>Description</h2>
<p>Return true if the variants point to the same concrete axis type and the types compare equal. Otherwise return false. </p>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
Dembinski<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="variable.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.axis.variant_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="operator_idm46275003075824.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,64 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Struct template bit</title>
<link rel="stylesheet" href="../../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../../../histogram/reference.html#header.boost.histogram.axis.option_hpp" title="Header &lt;boost/histogram/axis/option.hpp&gt;">
<link rel="prev" href="../metadata_base.html" title="Class template metadata_base">
<link rel="next" href="bitset.html" title="Struct template bitset">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../metadata_base.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../../histogram/reference.html#header.boost.histogram.axis.option_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="bitset.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.histogram.axis.option.bit"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Struct template bit</span></h2>
<p>boost::histogram::axis::option::bit — Single option flag. </p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../../histogram/reference.html#header.boost.histogram.axis.option_hpp" title="Header &lt;boost/histogram/axis/option.hpp&gt;">boost/histogram/axis/option.hpp</a>&gt;
</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">unsigned</span> Pos<span class="special">&gt;</span>
<span class="keyword">struct</span> <a class="link" href="bit.html" title="Struct template bit">bit</a> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">histogram</span><span class="special">::</span><span class="identifier">axis</span><span class="special">::</span><span class="identifier">option</span><span class="special">::</span><span class="identifier">bitset</span><span class="special">&lt;</span><span class="special">(</span><span class="number">1</span><span class="special">&lt;&lt;</span> <span class="identifier">Pos</span><span class="special">)</span><span class="special">&gt;</span> <span class="special">{</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm45878789087824"></a><h2>Description</h2>
<p>
</p>
<div class="refsect2">
<a name="idm45878789087152"></a><h3>Template Parameters</h3>
<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
<pre class="literallayout"><span class="keyword">unsigned</span> Pos</pre>
<p>position of the bit in the set. </p>
</li></ol></div>
</div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
Dembinski<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../metadata_base.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../../histogram/reference.html#header.boost.histogram.axis.option_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="bitset.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,64 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Struct template bitset</title>
<link rel="stylesheet" href="../../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../../../histogram/reference.html#header.boost.histogram.axis.option_hpp" title="Header &lt;boost/histogram/axis/option.hpp&gt;">
<link rel="prev" href="bit.html" title="Struct template bit">
<link rel="next" href="circular.html" title="Global circular">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="bit.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../../histogram/reference.html#header.boost.histogram.axis.option_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="circular.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.histogram.axis.option.bitset"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Struct template bitset</span></h2>
<p>boost::histogram::axis::option::bitset — Holder of axis options. </p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../../histogram/reference.html#header.boost.histogram.axis.option_hpp" title="Header &lt;boost/histogram/axis/option.hpp&gt;">boost/histogram/axis/option.hpp</a>&gt;
</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">unsigned</span> Bits<span class="special">&gt;</span>
<span class="keyword">struct</span> <a class="link" href="bitset.html" title="Struct template bitset">bitset</a> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">integral_constant</span><span class="special">&lt;</span> <span class="keyword">unsigned</span><span class="special">,</span> <span class="identifier">Bits</span> <span class="special">&gt;</span> <span class="special">{</span>
<span class="comment">// <a class="link" href="bitset.html#idm46275003433040-bb">public static functions</a></span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">unsigned</span> B<span class="special">&gt;</span> <span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keyword">auto</span> <a class="link" href="bitset.html#idm46275003432480-bb"><span class="identifier">test</span></a><span class="special">(</span><a class="link" href="bitset.html" title="Struct template bitset">bitset</a><span class="special">&lt;</span> <span class="identifier">B</span> <span class="special">&gt;</span><span class="special">)</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm45878789056176"></a><h2>Description</h2>
<div class="refsect2">
<a name="idm45878789055760"></a><h3>
<a name="idm46275003433040-bb"></a><code class="computeroutput">bitset</code> public static functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">unsigned</span> B<span class="special">&gt;</span> <span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keyword">auto</span> <a name="idm46275003432480-bb"></a><span class="identifier">test</span><span class="special">(</span><a class="link" href="bitset.html" title="Struct template bitset">bitset</a><span class="special">&lt;</span> <span class="identifier">B</span> <span class="special">&gt;</span><span class="special">)</span><span class="special">;</span></pre>Returns true if all option flags in the argument are set and false otherwise. </li></ol></div>
</div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
Dembinski<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="bit.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../../histogram/reference.html#header.boost.histogram.axis.option_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="circular.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,50 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Global circular</title>
<link rel="stylesheet" href="../../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../../../histogram/reference.html#header.boost.histogram.axis.option_hpp" title="Header &lt;boost/histogram/axis/option.hpp&gt;">
<link rel="prev" href="bitset.html" title="Struct template bitset">
<link rel="next" href="growth.html" title="Global growth">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="bitset.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../../histogram/reference.html#header.boost.histogram.axis.option_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="growth.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.histogram.axis.option.circular"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Global circular</span></h2>
<p>boost::histogram::axis::option::circular — Instance of <code class="computeroutput">circular_t</code>.</p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../../histogram/reference.html#header.boost.histogram.axis.option_hpp" title="Header &lt;boost/histogram/axis/option.hpp&gt;">boost/histogram/axis/option.hpp</a>&gt;
</span><span class="keyword">constexpr</span> <span class="identifier">circular_t</span> circular<span class="special">;</span></pre></div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
Dembinski<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="bitset.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../../histogram/reference.html#header.boost.histogram.axis.option_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="growth.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,50 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Global growth</title>
<link rel="stylesheet" href="../../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../../../histogram/reference.html#header.boost.histogram.axis.option_hpp" title="Header &lt;boost/histogram/axis/option.hpp&gt;">
<link rel="prev" href="circular.html" title="Global circular">
<link rel="next" href="none.html" title="Global none">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="circular.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../../histogram/reference.html#header.boost.histogram.axis.option_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="none.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.histogram.axis.option.growth"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Global growth</span></h2>
<p>boost::histogram::axis::option::growth — Instance of <code class="computeroutput">growth_t</code>.</p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../../histogram/reference.html#header.boost.histogram.axis.option_hpp" title="Header &lt;boost/histogram/axis/option.hpp&gt;">boost/histogram/axis/option.hpp</a>&gt;
</span><span class="keyword">constexpr</span> <span class="identifier">growth_t</span> growth<span class="special">;</span></pre></div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
Dembinski<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="circular.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../../histogram/reference.html#header.boost.histogram.axis.option_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="none.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,50 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Global none</title>
<link rel="stylesheet" href="../../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../../../histogram/reference.html#header.boost.histogram.axis.option_hpp" title="Header &lt;boost/histogram/axis/option.hpp&gt;">
<link rel="prev" href="growth.html" title="Global growth">
<link rel="next" href="overflow.html" title="Global overflow">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="growth.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../../histogram/reference.html#header.boost.histogram.axis.option_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="overflow.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.histogram.axis.option.none"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Global none</span></h2>
<p>boost::histogram::axis::option::none — Instance of <code class="computeroutput">none_t</code>.</p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../../histogram/reference.html#header.boost.histogram.axis.option_hpp" title="Header &lt;boost/histogram/axis/option.hpp&gt;">boost/histogram/axis/option.hpp</a>&gt;
</span><span class="keyword">constexpr</span> <span class="identifier">none_t</span> none<span class="special">;</span></pre></div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
Dembinski<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="growth.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../../histogram/reference.html#header.boost.histogram.axis.option_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="overflow.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,50 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Global overflow</title>
<link rel="stylesheet" href="../../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../../../histogram/reference.html#header.boost.histogram.axis.option_hpp" title="Header &lt;boost/histogram/axis/option.hpp&gt;">
<link rel="prev" href="none.html" title="Global none">
<link rel="next" href="underflow.html" title="Global underflow">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="none.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../../histogram/reference.html#header.boost.histogram.axis.option_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="underflow.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.histogram.axis.option.overflow"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Global overflow</span></h2>
<p>boost::histogram::axis::option::overflow — Instance of <code class="computeroutput">overflow_t</code>.</p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../../histogram/reference.html#header.boost.histogram.axis.option_hpp" title="Header &lt;boost/histogram/axis/option.hpp&gt;">boost/histogram/axis/option.hpp</a>&gt;
</span><span class="keyword">constexpr</span> <span class="identifier">overflow_t</span> overflow<span class="special">;</span></pre></div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
Dembinski<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="none.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../../histogram/reference.html#header.boost.histogram.axis.option_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="underflow.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,50 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Global underflow</title>
<link rel="stylesheet" href="../../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../../../histogram/reference.html#header.boost.histogram.axis.option_hpp" title="Header &lt;boost/histogram/axis/option.hpp&gt;">
<link rel="prev" href="overflow.html" title="Global overflow">
<link rel="next" href="../polymorphic_bin.html" title="Class template polymorphic_bin">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="overflow.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../../histogram/reference.html#header.boost.histogram.axis.option_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="../polymorphic_bin.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.histogram.axis.option.underflow"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Global underflow</span></h2>
<p>boost::histogram::axis::option::underflow — Instance of <code class="computeroutput">underflow_t</code>.</p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../../histogram/reference.html#header.boost.histogram.axis.option_hpp" title="Header &lt;boost/histogram/axis/option.hpp&gt;">boost/histogram/axis/option.hpp</a>&gt;
</span><span class="keyword">constexpr</span> <span class="identifier">underflow_t</span> underflow<span class="special">;</span></pre></div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
Dembinski<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="overflow.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../../histogram/reference.html#header.boost.histogram.axis.option_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="../polymorphic_bin.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,101 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Class template polymorphic_bin</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../../histogram/reference.html#header.boost.histogram.axis.polymorphic_bin_hpp" title="Header &lt;boost/histogram/axis/polymorphic_bin.hpp&gt;">
<link rel="prev" href="option/underflow.html" title="Global underflow">
<link rel="next" href="transform/id.html" title="Struct id">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="option/underflow.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.axis.polymorphic_bin_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="transform/id.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.histogram.axis.polymorphic_bin"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class template polymorphic_bin</span></h2>
<p>boost::histogram::axis::polymorphic_bin — Holds the bin data of an <a class="link" href="variant.html" title="Class template variant">axis::variant</a>.</p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../histogram/reference.html#header.boost.histogram.axis.polymorphic_bin_hpp" title="Header &lt;boost/histogram/axis/polymorphic_bin.hpp&gt;">boost/histogram/axis/polymorphic_bin.hpp</a>&gt;
</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> RealType<span class="special">&gt;</span>
<span class="keyword">class</span> <a class="link" href="polymorphic_bin.html" title="Class template polymorphic_bin">polymorphic_bin</a> <span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
<span class="comment">// <a class="link" href="polymorphic_bin.html#boost.histogram.axis.polymorphic_binconstruct-copy-destruct">construct/copy/destruct</a></span>
<a class="link" href="polymorphic_bin.html#idm46275003374688-bb"><span class="identifier">polymorphic_bin</span></a><span class="special">(</span><span class="identifier">value_type</span><span class="special">,</span> <span class="identifier">value_type</span><span class="special">)</span><span class="special">;</span>
<span class="comment">// <a class="link" href="polymorphic_bin.html#idm46275003387504-bb">public member functions</a></span>
<a class="link" href="polymorphic_bin.html#idm46275003386944-bb"><span class="keyword">operator</span> <span class="keyword">const</span> <span class="identifier">value_type</span> <span class="special">&amp;</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="identifier">value_type</span> <a class="link" href="polymorphic_bin.html#idm46275003385648-bb"><span class="identifier">lower</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="identifier">value_type</span> <a class="link" href="polymorphic_bin.html#idm46275003384384-bb"><span class="identifier">upper</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="identifier">value_type</span> <a class="link" href="polymorphic_bin.html#idm46275003383120-bb"><span class="identifier">center</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="identifier">value_type</span> <a class="link" href="polymorphic_bin.html#idm46275003381872-bb"><span class="identifier">width</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> BinType<span class="special">&gt;</span> <span class="keyword">bool</span> <a class="link" href="polymorphic_bin.html#idm46275003380624-bb"><span class="keyword">operator</span><span class="special">==</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">BinType</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> BinType<span class="special">&gt;</span> <span class="keyword">bool</span> <a class="link" href="polymorphic_bin.html#idm46275003378288-bb"><span class="keyword">operator</span><span class="special">!=</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">BinType</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="keyword">bool</span> <a class="link" href="polymorphic_bin.html#idm46275003375952-bb"><span class="identifier">is_discrete</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm45878788918416"></a><h2>Description</h2>
<p>The interface is a superset of the <a class="link" href="interval_view.html" title="Class template interval_view">axis::interval_view</a> class. In addition, the object is implicitly convertible to the value type, returning the equivalent of a call to lower(). For discrete axes, lower() == upper(), and width() returns zero.</p>
<p>This is not a view like <a class="link" href="interval_view.html" title="Class template interval_view">axis::interval_view</a> for two reasons.</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem"><p>Sequential calls to lower() and upper() would have to each loop through the variant types. This is likely to be slower than filling all the data in one loop.</p></li>
<li class="listitem"><p><a class="link" href="polymorphic_bin.html" title="Class template polymorphic_bin">polymorphic_bin</a> may be created from a temporary instance of<a class="link" href="variant.html" title="Class template variant">axis::variant</a>, like in the call histogram::axis(0). Storing a reference to the axis would result in a dangling reference. Rather than specialing the code to handle this, it seems easier to just use a value instead of a view.</p></li>
</ul></div>
<div class="refsect2">
<a name="idm45878788912416"></a><h3>
<a name="boost.histogram.axis.polymorphic_binconstruct-copy-destruct"></a><code class="computeroutput">polymorphic_bin</code>
public
construct/copy/destruct</h3>
<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><pre class="literallayout"><a name="idm46275003374688-bb"></a><span class="identifier">polymorphic_bin</span><span class="special">(</span><span class="identifier">value_type</span> lower<span class="special">,</span> <span class="identifier">value_type</span> upper<span class="special">)</span><span class="special">;</span></pre></li></ol></div>
</div>
<div class="refsect2">
<a name="idm45878788904352"></a><h3>
<a name="idm46275003387504-bb"></a><code class="computeroutput">polymorphic_bin</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><a name="idm46275003386944-bb"></a><span class="keyword">operator</span> <span class="keyword">const</span> <span class="identifier">value_type</span> <span class="special">&amp;</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Implicitly convert to bin value (for axis with discrete values). </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">value_type</span> <a name="idm46275003385648-bb"></a><span class="identifier">lower</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Return lower edge of bin. </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">value_type</span> <a name="idm46275003384384-bb"></a><span class="identifier">upper</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Return upper edge of bin. </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">value_type</span> <a name="idm46275003383120-bb"></a><span class="identifier">center</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Return center of bin. </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">value_type</span> <a name="idm46275003381872-bb"></a><span class="identifier">width</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Return width of bin. </li>
<li class="listitem"><pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> BinType<span class="special">&gt;</span> <span class="keyword">bool</span> <a name="idm46275003380624-bb"></a><span class="keyword">operator</span><span class="special">==</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">BinType</span> <span class="special">&amp;</span> rhs<span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> BinType<span class="special">&gt;</span> <span class="keyword">bool</span> <a name="idm46275003378288-bb"></a><span class="keyword">operator</span><span class="special">!=</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">BinType</span> <span class="special">&amp;</span> rhs<span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">bool</span> <a name="idm46275003375952-bb"></a><span class="identifier">is_discrete</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Return true if bin is discrete. </li>
</ol></div>
</div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
Dembinski<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="option/underflow.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.axis.polymorphic_bin_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="transform/id.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,312 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Class template regular</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../../histogram/reference.html#header.boost.histogram.axis.regular_hpp" title="Header &lt;boost/histogram/axis/regular.hpp&gt;">
<link rel="prev" href="circular.html" title="Class template circular">
<link rel="next" href="traits/continuous.html" title="Function template continuous">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="circular.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.axis.regular_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="traits/continuous.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.histogram.axis.regular"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class template regular</span></h2>
<p>boost::histogram::axis::regular — Axis for equidistant intervals on the real line. </p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../histogram/reference.html#header.boost.histogram.axis.regular_hpp" title="Header &lt;boost/histogram/axis/regular.hpp&gt;">boost/histogram/axis/regular.hpp</a>&gt;
</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Value<span class="special">,</span> <span class="keyword">typename</span> Transform<span class="special">,</span> <span class="keyword">typename</span> MetaData<span class="special">,</span>
<span class="keyword">typename</span> Options<span class="special">&gt;</span>
<span class="keyword">class</span> <a class="link" href="regular.html" title="Class template regular">regular</a> <span class="special">:</span> <span class="keyword">public</span> boost::histogram::axis::iterator_mixin&lt; regular&lt; Value, Transform, MetaData, Options &gt; &gt;,
<span class="keyword">public</span> metadata_base_t&lt; MetaData &gt;
<span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
<span class="comment">// <a class="link" href="regular.html#boost.histogram.axis.regularconstruct-copy-destruct">construct/copy/destruct</a></span>
<a class="link" href="regular.html#idm46275003339760-bb"><span class="identifier">regular</span></a><span class="special">(</span><span class="special">)</span> <span class="special">=</span> <span class="keyword">default</span><span class="special">;</span>
<a class="link" href="regular.html#idm46275003339360-bb"><span class="identifier">regular</span></a><span class="special">(</span><span class="identifier">transform_type</span><span class="special">,</span> <span class="keyword">unsigned</span><span class="special">,</span> <span class="identifier">value_type</span><span class="special">,</span> <span class="identifier">value_type</span><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>
<a class="link" href="regular.html#idm46275003332640-bb"><span class="identifier">regular</span></a><span class="special">(</span><span class="keyword">unsigned</span><span class="special">,</span> <span class="identifier">value_type</span><span class="special">,</span> <span class="identifier">value_type</span><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>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span>
<a class="link" href="regular.html#idm46275003327056-bb"><span class="identifier">regular</span></a><span class="special">(</span><span class="identifier">transform_type</span><span class="special">,</span> <span class="identifier">step_type</span><span class="special">&lt;</span> <span class="identifier">T</span> <span class="special">&gt;</span><span class="special">,</span> <span class="identifier">value_type</span><span class="special">,</span> <span class="identifier">value_type</span><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>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span>
<a class="link" href="regular.html#idm46275003319456-bb"><span class="identifier">regular</span></a><span class="special">(</span><span class="identifier">step_type</span><span class="special">&lt;</span> <span class="identifier">T</span> <span class="special">&gt;</span><span class="special">,</span> <span class="identifier">value_type</span><span class="special">,</span> <span class="identifier">value_type</span><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>
<a class="link" href="regular.html#idm46275003312992-bb"><span class="identifier">regular</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="regular.html" title="Class template regular">regular</a> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">index_type</span><span class="special">,</span> <span class="identifier">index_type</span><span class="special">,</span> <span class="keyword">unsigned</span><span class="special">)</span><span class="special">;</span>
<span class="comment">// <a class="link" href="regular.html#idm46275003361472-bb">public member functions</a></span>
<span class="keyword">const</span> <span class="identifier">transform_type</span> <span class="special">&amp;</span> <a class="link" href="regular.html#idm46275003360912-bb"><span class="identifier">transform</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="identifier">index_type</span> <a class="link" href="regular.html#idm46275003359648-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>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span> <span class="identifier">index_type</span><span class="special">,</span> <span class="identifier">index_type</span> <span class="special">&gt;</span> <a class="link" href="regular.html#idm46275003357696-bb"><span class="identifier">update</span></a><span class="special">(</span><span class="identifier">value_type</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="identifier">value_type</span> <a class="link" href="regular.html#idm46275003355696-bb"><span class="identifier">value</span></a><span class="special">(</span><span class="identifier">real_index_type</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="keyword">decltype</span><span class="special">(</span><span class="keyword">auto</span><span class="special">)</span> <a class="link" href="regular.html#idm46275003353728-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>
<span class="identifier">index_type</span> <a class="link" href="regular.html#idm46275003351776-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>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> V<span class="special">,</span> <span class="keyword">typename</span> T<span class="special">,</span> <span class="keyword">typename</span> M<span class="special">,</span> <span class="keyword">typename</span> O<span class="special">&gt;</span>
<span class="keyword">bool</span> <a class="link" href="regular.html#idm46275003350480-bb"><span class="keyword">operator</span><span class="special">==</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="regular.html" title="Class template regular">regular</a><span class="special">&lt;</span> <span class="identifier">V</span><span class="special">,</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">M</span><span class="special">,</span> <span class="identifier">O</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> V<span class="special">,</span> <span class="keyword">typename</span> T<span class="special">,</span> <span class="keyword">typename</span> M<span class="special">,</span> <span class="keyword">typename</span> O<span class="special">&gt;</span>
<span class="keyword">bool</span> <a class="link" href="regular.html#idm46275003346496-bb"><span class="keyword">operator</span><span class="special">!=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="regular.html" title="Class template regular">regular</a><span class="special">&lt;</span> <span class="identifier">V</span><span class="special">,</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">M</span><span class="special">,</span> <span class="identifier">O</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Archive<span class="special">&gt;</span> <span class="keyword">void</span> <a class="link" href="regular.html#idm46275003342512-bb"><span class="identifier">serialize</span></a><span class="special">(</span><span class="identifier">Archive</span> <span class="special">&amp;</span><span class="special">,</span> <span class="keyword">unsigned</span><span class="special">)</span><span class="special">;</span>
<span class="comment">// <a class="link" href="regular.html#idm46275003309312-bb">public static functions</a></span>
<span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keyword">unsigned</span> <a class="link" href="regular.html#idm46275003308752-bb"><span class="identifier">options</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm45878788301616"></a><h2>Description</h2>
<p>The most common binning strategy. Very fast. Binning is a O(1) operation.</p>
<p>
</p>
<div class="refsect2">
<a name="idm45878788300592"></a><h3>Template Parameters</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="keyword">typename</span> Value</pre>
<p>input value type, must be floating point. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">typename</span> Transform</pre>
<p>builtin or user-defined transform type. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">typename</span> MetaData</pre>
<p>type to store meta data. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">typename</span> Options</pre>
<p>see boost::histogram::axis::option (all values allowed). </p>
</li>
</ol></div>
</div>
<div class="refsect2">
<a name="idm45878788291120"></a><h3>
<a name="boost.histogram.axis.regularconstruct-copy-destruct"></a><code class="computeroutput">regular</code>
public
construct/copy/destruct</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem"><pre class="literallayout"><a name="idm46275003339760-bb"></a><span class="identifier">regular</span><span class="special">(</span><span class="special">)</span> <span class="special">=</span> <span class="keyword">default</span><span class="special">;</span></pre></li>
<li class="listitem">
<pre class="literallayout"><a name="idm46275003339360-bb"></a><span class="identifier">regular</span><span class="special">(</span><span class="identifier">transform_type</span> trans<span class="special">,</span> <span class="keyword">unsigned</span> n<span class="special">,</span> <span class="identifier">value_type</span> start<span class="special">,</span> <span class="identifier">value_type</span> stop<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 n bins over real transformed range [start, stop). <p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">meta</code></span></p></td>
<td><p>description of the axis (optional). </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">n</code></span></p></td>
<td><p>number of bins. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">start</code></span></p></td>
<td><p>low edge of first bin. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">stop</code></span></p></td>
<td><p>high edge of last bin. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">trans</code></span></p></td>
<td><p>transform instance to use. </p></td>
</tr>
</tbody>
</table></div></td>
</tr></tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><a name="idm46275003332640-bb"></a><span class="identifier">regular</span><span class="special">(</span><span class="keyword">unsigned</span> n<span class="special">,</span> <span class="identifier">value_type</span> start<span class="special">,</span> <span class="identifier">value_type</span> stop<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 n bins over real range [start, stop). <p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">meta</code></span></p></td>
<td><p>description of the axis (optional). </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">n</code></span></p></td>
<td><p>number of bins. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">start</code></span></p></td>
<td><p>low edge of first bin. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">stop</code></span></p></td>
<td><p>high edge of last bin. </p></td>
</tr>
</tbody>
</table></div></td>
</tr></tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span>
<a name="idm46275003327056-bb"></a><span class="identifier">regular</span><span class="special">(</span><span class="identifier">transform_type</span> trans<span class="special">,</span> <span class="identifier">step_type</span><span class="special">&lt;</span> <span class="identifier">T</span> <span class="special">&gt;</span> step<span class="special">,</span> <span class="identifier">value_type</span> start<span class="special">,</span>
<span class="identifier">value_type</span> stop<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 bins with the given step size over real transformed range [start, stop). <p>
The axis computes the number of bins as n = abs(stop - start) / step, rounded down. This means that stop is an upper limit to the actual value (start + n * step). </p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">meta</code></span></p></td>
<td><p>description of the axis (optional).</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">start</code></span></p></td>
<td><p>low edge of first bin. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">step</code></span></p></td>
<td><p>width of a single bin. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">stop</code></span></p></td>
<td><p>upper limit of high edge of last bin (see below). </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">trans</code></span></p></td>
<td><p>transform instance to use. </p></td>
</tr>
</tbody>
</table></div></td>
</tr></tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span>
<a name="idm46275003319456-bb"></a><span class="identifier">regular</span><span class="special">(</span><span class="identifier">step_type</span><span class="special">&lt;</span> <span class="identifier">T</span> <span class="special">&gt;</span> step<span class="special">,</span> <span class="identifier">value_type</span> start<span class="special">,</span> <span class="identifier">value_type</span> stop<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 bins with the given step size over real range [start, stop). <p>
The axis computes the number of bins as n = abs(stop - start) / step, rounded down. This means that stop is an upper limit to the actual value (start + n * step). </p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">meta</code></span></p></td>
<td><p>description of the axis (optional).</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">start</code></span></p></td>
<td><p>low edge of first bin. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">step</code></span></p></td>
<td><p>width of a single bin. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">stop</code></span></p></td>
<td><p>upper limit of high edge of last bin (see below). </p></td>
</tr>
</tbody>
</table></div></td>
</tr></tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><a name="idm46275003312992-bb"></a><span class="identifier">regular</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="regular.html" title="Class template regular">regular</a> <span class="special">&amp;</span> src<span class="special">,</span> <span class="identifier">index_type</span> begin<span class="special">,</span> <span class="identifier">index_type</span> end<span class="special">,</span> <span class="keyword">unsigned</span> merge<span class="special">)</span><span class="special">;</span></pre>Constructor used by algorithm::reduce to shrink and rebin (not for users). </li>
</ol></div>
</div>
<div class="refsect2">
<a name="idm45878788190080"></a><h3>
<a name="idm46275003361472-bb"></a><code class="computeroutput">regular</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="keyword">const</span> <span class="identifier">transform_type</span> <span class="special">&amp;</span> <a name="idm46275003360912-bb"></a><span class="identifier">transform</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Return instance of the transform type. </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">index_type</span> <a name="idm46275003359648-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>
<li class="listitem">
<pre class="literallayout"><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span> <span class="identifier">index_type</span><span class="special">,</span> <span class="identifier">index_type</span> <span class="special">&gt;</span> <a name="idm46275003357696-bb"></a><span class="identifier">update</span><span class="special">(</span><span class="identifier">value_type</span> x<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Returns index and shift (if axis has grown) for the passed argument. </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">value_type</span> <a name="idm46275003355696-bb"></a><span class="identifier">value</span><span class="special">(</span><span class="identifier">real_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 fractional index argument. </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">decltype</span><span class="special">(</span><span class="keyword">auto</span><span class="special">)</span> <a name="idm46275003353728-bb"></a><span class="identifier">bin</span><span class="special">(</span><span class="identifier">index_type</span> idx<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>
<li class="listitem">
<pre class="literallayout"><span class="identifier">index_type</span> <a name="idm46275003351776-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>
<li class="listitem"><pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> V<span class="special">,</span> <span class="keyword">typename</span> T<span class="special">,</span> <span class="keyword">typename</span> M<span class="special">,</span> <span class="keyword">typename</span> O<span class="special">&gt;</span>
<span class="keyword">bool</span> <a name="idm46275003350480-bb"></a><span class="keyword">operator</span><span class="special">==</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="regular.html" title="Class template regular">regular</a><span class="special">&lt;</span> <span class="identifier">V</span><span class="special">,</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">M</span><span class="special">,</span> <span class="identifier">O</span> <span class="special">&gt;</span> <span class="special">&amp;</span> o<span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> V<span class="special">,</span> <span class="keyword">typename</span> T<span class="special">,</span> <span class="keyword">typename</span> M<span class="special">,</span> <span class="keyword">typename</span> O<span class="special">&gt;</span>
<span class="keyword">bool</span> <a name="idm46275003346496-bb"></a><span class="keyword">operator</span><span class="special">!=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="regular.html" title="Class template regular">regular</a><span class="special">&lt;</span> <span class="identifier">V</span><span class="special">,</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">M</span><span class="special">,</span> <span class="identifier">O</span> <span class="special">&gt;</span> <span class="special">&amp;</span> o<span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Archive<span class="special">&gt;</span> <span class="keyword">void</span> <a name="idm46275003342512-bb"></a><span class="identifier">serialize</span><span class="special">(</span><span class="identifier">Archive</span> <span class="special">&amp;</span> ar<span class="special">,</span> <span class="keyword">unsigned</span><span class="special">)</span><span class="special">;</span></pre></li>
</ol></div>
</div>
<div class="refsect2">
<a name="idm45878788093024"></a><h3>
<a name="idm46275003309312-bb"></a><code class="computeroutput">regular</code> public static functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
<pre class="literallayout"><span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keyword">unsigned</span> <a name="idm46275003308752-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></ol></div>
</div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
Dembinski<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="circular.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../histogram/reference.html#header.boost.histogram.axis.regular_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="traits/continuous.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,76 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Function template continuous</title>
<link rel="stylesheet" href="../../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../../../histogram/reference.html#header.boost.histogram.axis.traits_hpp" title="Header &lt;boost/histogram/axis/traits.hpp&gt;">
<link rel="prev" href="../regular.html" title="Class template regular">
<link rel="next" href="extent.html" title="Function template extent">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../regular.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../../histogram/reference.html#header.boost.histogram.axis.traits_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="extent.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.histogram.axis.traits.continuous"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Function template continuous</span></h2>
<p>boost::histogram::axis::traits::continuous — Returns true if axis is continuous or false. </p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../../histogram/reference.html#header.boost.histogram.axis.traits_hpp" title="Header &lt;boost/histogram/axis/traits.hpp&gt;">boost/histogram/axis/traits.hpp</a>&gt;
</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Axis<span class="special">&gt;</span> <span class="keyword">constexpr</span> <span class="keyword">bool</span> <span class="identifier">continuous</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">Axis</span> <span class="special">&amp;</span> axis<span class="special">)</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm45878787896496"></a><h2>Description</h2>
<p>See <code class="computeroutput"><a class="link" href="is_continuous.html" title="Struct template is_continuous">is_continuous</a></code> for details.</p>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">axis</code></span></p></td>
<td><p>any axis instance </p></td>
</tr></tbody>
</table></div></td>
</tr></tbody>
</table></div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
Dembinski<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../regular.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../../histogram/reference.html#header.boost.histogram.axis.traits_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="extent.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,75 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Function template extent</title>
<link rel="stylesheet" href="../../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../../../histogram/reference.html#header.boost.histogram.axis.traits_hpp" title="Header &lt;boost/histogram/axis/traits.hpp&gt;">
<link rel="prev" href="continuous.html" title="Function template continuous">
<link rel="next" href="get_options.html" title="Struct template get_options">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="continuous.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../../histogram/reference.html#header.boost.histogram.axis.traits_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="get_options.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.histogram.axis.traits.extent"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Function template extent</span></h2>
<p>boost::histogram::axis::traits::extent — Returns axis size plus any extra bins for under- and overflow. </p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../../histogram/reference.html#header.boost.histogram.axis.traits_hpp" title="Header &lt;boost/histogram/axis/traits.hpp&gt;">boost/histogram/axis/traits.hpp</a>&gt;
</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Axis<span class="special">&gt;</span> <span class="identifier">index_type</span> <span class="identifier">extent</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">Axis</span> <span class="special">&amp;</span> axis<span class="special">)</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm45878787879536"></a><h2>Description</h2>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">axis</code></span></p></td>
<td><p>any axis instance </p></td>
</tr></tbody>
</table></div></td>
</tr></tbody>
</table></div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
Dembinski<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="continuous.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../../histogram/reference.html#header.boost.histogram.axis.traits_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="get_options.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,66 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Struct template get_options</title>
<link rel="stylesheet" href="../../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../../../histogram/reference.html#header.boost.histogram.axis.traits_hpp" title="Header &lt;boost/histogram/axis/traits.hpp&gt;">
<link rel="prev" href="extent.html" title="Function template extent">
<link rel="next" href="inclusive.html" title="Function template inclusive">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="extent.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../../histogram/reference.html#header.boost.histogram.axis.traits_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="inclusive.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.histogram.axis.traits.get_options"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Struct template get_options</span></h2>
<p>boost::histogram::axis::traits::get_options — Get axis options for axis type. </p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../../histogram/reference.html#header.boost.histogram.axis.traits_hpp" title="Header &lt;boost/histogram/axis/traits.hpp&gt;">boost/histogram/axis/traits.hpp</a>&gt;
</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Axis<span class="special">&gt;</span>
<span class="keyword">struct</span> <a class="link" href="get_options.html" title="Struct template get_options">get_options</a> <span class="special">{</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm45878787865952"></a><h2>Description</h2>
<p>Doxygen does not render this well. This is a meta-function (template alias), it accepts an axis type and returns the <a class="link" href="../option/bitset.html" title="Struct template bitset">boost::histogram::axis::option::bitset</a>.</p>
<p>If Axis::options() is valid and constexpr, <a class="link" href="get_options.html" title="Struct template get_options">get_options</a> is the corresponding option type. Otherwise, it is boost::histogram::axis::option::growth_t, if the axis has a method<code class="computeroutput">update</code>, else boost::histogram::axis::option::none_t.</p>
<p>
</p>
<div class="refsect2">
<a name="idm45878787862016"></a><h3>Template Parameters</h3>
<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
<pre class="literallayout"><span class="keyword">typename</span> Axis</pre>
<p>axis type </p>
</li></ol></div>
</div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
Dembinski<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="extent.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../../histogram/reference.html#header.boost.histogram.axis.traits_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="inclusive.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,76 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Function template inclusive</title>
<link rel="stylesheet" href="../../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../../../histogram/reference.html#header.boost.histogram.axis.traits_hpp" title="Header &lt;boost/histogram/axis/traits.hpp&gt;">
<link rel="prev" href="get_options.html" title="Struct template get_options">
<link rel="next" href="index.html" title="Function template index">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="get_options.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../../histogram/reference.html#header.boost.histogram.axis.traits_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="index.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.histogram.axis.traits.inclusive"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Function template inclusive</span></h2>
<p>boost::histogram::axis::traits::inclusive — Returns true if axis is inclusive or false. </p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../../histogram/reference.html#header.boost.histogram.axis.traits_hpp" title="Header &lt;boost/histogram/axis/traits.hpp&gt;">boost/histogram/axis/traits.hpp</a>&gt;
</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Axis<span class="special">&gt;</span> <span class="keyword">constexpr</span> <span class="keyword">bool</span> <span class="identifier">inclusive</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">Axis</span> <span class="special">&amp;</span> axis<span class="special">)</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm45878787846464"></a><h2>Description</h2>
<p>See <code class="computeroutput"><a class="link" href="is_inclusive.html" title="Struct template is_inclusive">is_inclusive</a></code> for details.</p>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">axis</code></span></p></td>
<td><p>any axis instance </p></td>
</tr></tbody>
</table></div></td>
</tr></tbody>
</table></div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
Dembinski<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="get_options.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../../histogram/reference.html#header.boost.histogram.axis.traits_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="index.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,83 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Function template index</title>
<link rel="stylesheet" href="../../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../../../histogram/reference.html#header.boost.histogram.axis.traits_hpp" title="Header &lt;boost/histogram/axis/traits.hpp&gt;">
<link rel="prev" href="inclusive.html" title="Function template inclusive">
<link rel="next" href="is_continuous.html" title="Struct template is_continuous">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="inclusive.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../../histogram/reference.html#header.boost.histogram.axis.traits_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="is_continuous.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.histogram.axis.traits.index"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Function template index</span></h2>
<p>boost::histogram::axis::traits::index — Returns axis index for value. </p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../../histogram/reference.html#header.boost.histogram.axis.traits_hpp" title="Header &lt;boost/histogram/axis/traits.hpp&gt;">boost/histogram/axis/traits.hpp</a>&gt;
</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Axis<span class="special">,</span> <span class="keyword">typename</span> U<span class="special">&gt;</span>
<span class="identifier">axis</span><span class="special">::</span><span class="identifier">index_type</span> <span class="identifier">index</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">Axis</span> <span class="special">&amp;</span> axis<span class="special">,</span> <span class="keyword">const</span> <span class="identifier">U</span> <span class="special">&amp;</span> value<span class="special">)</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm45878787824400"></a><h2>Description</h2>
<p>Throws std::invalid_argument if the value argument is not implicitly convertible.</p>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">axis</code></span></p></td>
<td><p>any axis instance </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">value</code></span></p></td>
<td><p>argument to be passed to <code class="computeroutput">index</code> method</p></td>
</tr>
</tbody>
</table></div></td>
</tr></tbody>
</table></div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
Dembinski<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="inclusive.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../../histogram/reference.html#header.boost.histogram.axis.traits_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="is_continuous.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,57 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Struct template is_continuous</title>
<link rel="stylesheet" href="../../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../../../histogram/reference.html#header.boost.histogram.axis.traits_hpp" title="Header &lt;boost/histogram/axis/traits.hpp&gt;">
<link rel="prev" href="index.html" title="Function template index">
<link rel="next" href="is_inclusive.html" title="Struct template is_inclusive">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="index.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../../histogram/reference.html#header.boost.histogram.axis.traits_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="is_inclusive.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.histogram.axis.traits.is_continuous"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Struct template is_continuous</span></h2>
<p>boost::histogram::axis::traits::is_continuous — Whether axis is continuous or discrete. </p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../../histogram/reference.html#header.boost.histogram.axis.traits_hpp" title="Header &lt;boost/histogram/axis/traits.hpp&gt;">boost/histogram/axis/traits.hpp</a>&gt;
</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Axis<span class="special">&gt;</span>
<span class="keyword">struct</span> <a class="link" href="is_continuous.html" title="Struct template is_continuous">is_continuous</a> <span class="special">{</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm45878787808400"></a><h2>Description</h2>
<p>Doxygen does not render this well. This is a meta-function (template alias), it accepts an axis type and returns a compile-time boolean.</p>
<p>If the boolean is true, the axis is continuous (covers a continuous range of values). Otherwise it is discrete (covers discrete values). </p>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
Dembinski<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="index.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../../histogram/reference.html#header.boost.histogram.axis.traits_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="is_inclusive.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,67 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Struct template is_inclusive</title>
<link rel="stylesheet" href="../../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../../../histogram/reference.html#header.boost.histogram.axis.traits_hpp" title="Header &lt;boost/histogram/axis/traits.hpp&gt;">
<link rel="prev" href="is_continuous.html" title="Struct template is_continuous">
<link rel="next" href="is_ordered.html" title="Struct template is_ordered">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="is_continuous.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../../histogram/reference.html#header.boost.histogram.axis.traits_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="is_ordered.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.histogram.axis.traits.is_inclusive"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Struct template is_inclusive</span></h2>
<p>boost::histogram::axis::traits::is_inclusive — Meta-function to detect whether an axis is inclusive. </p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../../histogram/reference.html#header.boost.histogram.axis.traits_hpp" title="Header &lt;boost/histogram/axis/traits.hpp&gt;">boost/histogram/axis/traits.hpp</a>&gt;
</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Axis<span class="special">&gt;</span>
<span class="keyword">struct</span> <a class="link" href="is_inclusive.html" title="Struct template is_inclusive">is_inclusive</a> <span class="special">{</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm45878787797152"></a><h2>Description</h2>
<p>Doxygen does not render this well. This is a meta-function (template alias), it accepts an axis type and represents compile-time boolean which is true or false, depending on whether the axis is inclusive or not.</p>
<p>An axis with underflow and overflow bins is always inclusive, but an axis may be inclusive under other conditions. The meta-function checks for the method <code class="computeroutput">constexpr static bool inclusive()</code>, and uses the result. If this method is not present, it uses get_options&lt;Axis&gt; and checks whether the underflow and overflow bits are present.</p>
<p>An inclusive axis has a bin for every possible input value. A histogram which consists only of inclusive axes can be filled more efficiently, since input values always end up in a valid cell and there is no need to keep track of input tuples that need to be discarded.</p>
<p>
</p>
<div class="refsect2">
<a name="idm45878787794160"></a><h3>Template Parameters</h3>
<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
<pre class="literallayout"><span class="keyword">typename</span> Axis</pre>
<p>axis type </p>
</li></ol></div>
</div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
Dembinski<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="is_continuous.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../../histogram/reference.html#header.boost.histogram.axis.traits_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="is_ordered.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,67 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Struct template is_ordered</title>
<link rel="stylesheet" href="../../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../../../histogram/reference.html#header.boost.histogram.axis.traits_hpp" title="Header &lt;boost/histogram/axis/traits.hpp&gt;">
<link rel="prev" href="is_inclusive.html" title="Struct template is_inclusive">
<link rel="next" href="is_reducible.html" title="Struct template is_reducible">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="is_inclusive.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../../histogram/reference.html#header.boost.histogram.axis.traits_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="is_reducible.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.histogram.axis.traits.is_ordered"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Struct template is_ordered</span></h2>
<p>boost::histogram::axis::traits::is_ordered — Meta-function to detect whether an axis is ordered. </p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../../histogram/reference.html#header.boost.histogram.axis.traits_hpp" title="Header &lt;boost/histogram/axis/traits.hpp&gt;">boost/histogram/axis/traits.hpp</a>&gt;
</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Axis<span class="special">&gt;</span>
<span class="keyword">struct</span> <a class="link" href="is_ordered.html" title="Struct template is_ordered">is_ordered</a> <span class="special">{</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm45878787781184"></a><h2>Description</h2>
<p>Doxygen does not render this well. This is a meta-function (template alias), it accepts an axis type and returns a compile-time boolean. If the boolean is true, the axis is ordered.</p>
<p>The meta-function checks for the method <code class="computeroutput">constexpr static bool ordered()</code>, and uses the result. If this method is not present, it returns true if the value type of the Axis is arithmetic and false otherwise.</p>
<p>An ordered axis has a value type that is ordered, which means that indices i &lt; j &lt; k implies either value(i) &lt; value(j) &lt; value(k) or value(i) &gt; value(j) &gt; value(k) for all i,j,k. For example, the integer axis is ordered, but the category axis is not. Axis which are not ordered must not have underflow bins, because they only have an "other" category, which is identified with the overflow bin if it is available.</p>
<p>
</p>
<div class="refsect2">
<a name="idm45878787777840"></a><h3>Template Parameters</h3>
<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
<pre class="literallayout"><span class="keyword">typename</span> Axis</pre>
<p>axis type </p>
</li></ol></div>
</div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
Dembinski<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="is_inclusive.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../../histogram/reference.html#header.boost.histogram.axis.traits_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="is_reducible.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,66 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Struct template is_reducible</title>
<link rel="stylesheet" href="../../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../../../histogram/reference.html#header.boost.histogram.axis.traits_hpp" title="Header &lt;boost/histogram/axis/traits.hpp&gt;">
<link rel="prev" href="is_ordered.html" title="Struct template is_ordered">
<link rel="next" href="metadata.html" title="Function template metadata">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="is_ordered.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../../histogram/reference.html#header.boost.histogram.axis.traits_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="metadata.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.histogram.axis.traits.is_reducible"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Struct template is_reducible</span></h2>
<p>boost::histogram::axis::traits::is_reducible — Meta-function to detect whether an axis is reducible. </p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../../histogram/reference.html#header.boost.histogram.axis.traits_hpp" title="Header &lt;boost/histogram/axis/traits.hpp&gt;">boost/histogram/axis/traits.hpp</a>&gt;
</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Axis<span class="special">&gt;</span>
<span class="keyword">struct</span> <a class="link" href="is_reducible.html" title="Struct template is_reducible">is_reducible</a> <span class="special">{</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm45878787764528"></a><h2>Description</h2>
<p>Doxygen does not render this well. This is a meta-function (template alias), it accepts an axis type and represents compile-time boolean which is true or false, depending on whether the axis can be reduced with boost::histogram::algorithm::reduce().</p>
<p>An axis can be made reducible by adding a special constructor, see Axis concept for details.</p>
<p>
</p>
<div class="refsect2">
<a name="idm45878787762960"></a><h3>Template Parameters</h3>
<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
<pre class="literallayout"><span class="keyword">typename</span> Axis</pre>
<p>axis type. </p>
</li></ol></div>
</div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
Dembinski<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="is_ordered.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../../histogram/reference.html#header.boost.histogram.axis.traits_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="metadata.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,76 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Function template metadata</title>
<link rel="stylesheet" href="../../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../../../histogram/reference.html#header.boost.histogram.axis.traits_hpp" title="Header &lt;boost/histogram/axis/traits.hpp&gt;">
<link rel="prev" href="is_reducible.html" title="Struct template is_reducible">
<link rel="next" href="options.html" title="Function template options">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="is_reducible.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../../histogram/reference.html#header.boost.histogram.axis.traits_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="options.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.histogram.axis.traits.metadata"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Function template metadata</span></h2>
<p>boost::histogram::axis::traits::metadata — Returns reference to metadata of an axis. </p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../../histogram/reference.html#header.boost.histogram.axis.traits_hpp" title="Header &lt;boost/histogram/axis/traits.hpp&gt;">boost/histogram/axis/traits.hpp</a>&gt;
</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Axis<span class="special">&gt;</span> <span class="keyword">decltype</span><span class="special">(</span><span class="keyword">auto</span><span class="special">)</span> <span class="identifier">metadata</span><span class="special">(</span><span class="identifier">Axis</span> <span class="special">&amp;&amp;</span> axis<span class="special">)</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm45878787747184"></a><h2>Description</h2>
<p>If the expression x.metadata() for an axis instance <code class="computeroutput">x</code> (maybe const) is valid, return the result. Otherwise, return a reference to a static instance of<code class="computeroutput"><a class="link" href="../null_type.html" title="Struct null_type">boost::histogram::axis::null_type</a></code>.</p>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">axis</code></span></p></td>
<td><p>any axis instance </p></td>
</tr></tbody>
</table></div></td>
</tr></tbody>
</table></div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
Dembinski<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="is_reducible.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../../histogram/reference.html#header.boost.histogram.axis.traits_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="options.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,76 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Function template options</title>
<link rel="stylesheet" href="../../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../../../histogram/reference.html#header.boost.histogram.axis.traits_hpp" title="Header &lt;boost/histogram/axis/traits.hpp&gt;">
<link rel="prev" href="metadata.html" title="Function template metadata">
<link rel="next" href="ordered.html" title="Function template ordered">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="metadata.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../../histogram/reference.html#header.boost.histogram.axis.traits_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="ordered.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.histogram.axis.traits.options"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Function template options</span></h2>
<p>boost::histogram::axis::traits::options — Returns axis options as unsigned integer. </p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../../histogram/reference.html#header.boost.histogram.axis.traits_hpp" title="Header &lt;boost/histogram/axis/traits.hpp&gt;">boost/histogram/axis/traits.hpp</a>&gt;
</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Axis<span class="special">&gt;</span> <span class="keyword">constexpr</span> <span class="keyword">unsigned</span> <span class="identifier">options</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">Axis</span> <span class="special">&amp;</span> axis<span class="special">)</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm45878787728800"></a><h2>Description</h2>
<p>See <code class="computeroutput"><a class="link" href="get_options.html" title="Struct template get_options">get_options</a></code> for details.</p>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">axis</code></span></p></td>
<td><p>any axis instance </p></td>
</tr></tbody>
</table></div></td>
</tr></tbody>
</table></div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
Dembinski<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="metadata.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../../histogram/reference.html#header.boost.histogram.axis.traits_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="ordered.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,76 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Function template ordered</title>
<link rel="stylesheet" href="../../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../../../histogram/reference.html#header.boost.histogram.axis.traits_hpp" title="Header &lt;boost/histogram/axis/traits.hpp&gt;">
<link rel="prev" href="options.html" title="Function template options">
<link rel="next" href="rank.html" title="Function template rank">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="options.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../../histogram/reference.html#header.boost.histogram.axis.traits_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="rank.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.histogram.axis.traits.ordered"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Function template ordered</span></h2>
<p>boost::histogram::axis::traits::ordered — Returns true if axis is ordered or false. </p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../../histogram/reference.html#header.boost.histogram.axis.traits_hpp" title="Header &lt;boost/histogram/axis/traits.hpp&gt;">boost/histogram/axis/traits.hpp</a>&gt;
</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Axis<span class="special">&gt;</span> <span class="keyword">constexpr</span> <span class="keyword">bool</span> <span class="identifier">ordered</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">Axis</span> <span class="special">&amp;</span> axis<span class="special">)</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm45878787711200"></a><h2>Description</h2>
<p>See <code class="computeroutput"><a class="link" href="is_ordered.html" title="Struct template is_ordered">is_ordered</a></code> for details.</p>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">axis</code></span></p></td>
<td><p>any axis instance </p></td>
</tr></tbody>
</table></div></td>
</tr></tbody>
</table></div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
Dembinski<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="options.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../../histogram/reference.html#header.boost.histogram.axis.traits_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="rank.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,75 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Function template rank</title>
<link rel="stylesheet" href="../../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../../../histogram/reference.html#header.boost.histogram.axis.traits_hpp" title="Header &lt;boost/histogram/axis/traits.hpp&gt;">
<link rel="prev" href="ordered.html" title="Function template ordered">
<link rel="next" href="update.html" title="Function template update">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="ordered.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../../histogram/reference.html#header.boost.histogram.axis.traits_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="update.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.histogram.axis.traits.rank"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Function template rank</span></h2>
<p>boost::histogram::axis::traits::rank — Return axis rank (how many arguments it processes). </p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../../histogram/reference.html#header.boost.histogram.axis.traits_hpp" title="Header &lt;boost/histogram/axis/traits.hpp&gt;">boost/histogram/axis/traits.hpp</a>&gt;
</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Axis<span class="special">&gt;</span> <span class="keyword">constexpr</span> <span class="keyword">unsigned</span> <span class="keyword">int</span> <span class="identifier">rank</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">Axis</span> <span class="special">&amp;</span> axis<span class="special">)</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm45878787692960"></a><h2>Description</h2>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">axis</code></span></p></td>
<td><p>any axis instance </p></td>
</tr></tbody>
</table></div></td>
</tr></tbody>
</table></div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
Dembinski<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="ordered.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../../histogram/reference.html#header.boost.histogram.axis.traits_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="update.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,83 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Function template update</title>
<link rel="stylesheet" href="../../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../../../histogram/reference.html#header.boost.histogram.axis.traits_hpp" title="Header &lt;boost/histogram/axis/traits.hpp&gt;">
<link rel="prev" href="rank.html" title="Function template rank">
<link rel="next" href="value.html" title="Function template value">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="rank.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../../histogram/reference.html#header.boost.histogram.axis.traits_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="value.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.histogram.axis.traits.update"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Function template update</span></h2>
<p>boost::histogram::axis::traits::update — Returns pair of axis index and shift for the value argument. </p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../../histogram/reference.html#header.boost.histogram.axis.traits_hpp" title="Header &lt;boost/histogram/axis/traits.hpp&gt;">boost/histogram/axis/traits.hpp</a>&gt;
</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Axis<span class="special">,</span> <span class="keyword">typename</span> U<span class="special">&gt;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span> <span class="identifier">index_type</span><span class="special">,</span> <span class="identifier">index_type</span> <span class="special">&gt;</span> <span class="identifier">update</span><span class="special">(</span><span class="identifier">Axis</span> <span class="special">&amp;</span> axis<span class="special">,</span> <span class="keyword">const</span> <span class="identifier">U</span> <span class="special">&amp;</span> value<span class="special">)</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm45878787670000"></a><h2>Description</h2>
<p>Throws <code class="computeroutput">std::invalid_argument</code> if the value argument is not implicitly convertible to the argument expected by the<code class="computeroutput">index</code> method. If the result of boost::histogram::axis::traits::get_options&lt;decltype(axis)&gt; has the growth flag set, call<code class="computeroutput">update</code> method with the argument and return the result. Otherwise, call<code class="computeroutput">index</code> and return the pair of the result and a zero shift.</p>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">axis</code></span></p></td>
<td><p>any axis instance </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">value</code></span></p></td>
<td><p>argument to be passed to <code class="computeroutput">update</code> or<code class="computeroutput">index</code> method</p></td>
</tr>
</tbody>
</table></div></td>
</tr></tbody>
</table></div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
Dembinski<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="rank.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../../histogram/reference.html#header.boost.histogram.axis.traits_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="value.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

Some files were not shown because too many files have changed in this diff Show More