MCPcopy Create free account
hub / github.com/boostorg/histogram / regular

Method regular

include/boost/histogram/axis/types.hpp:129–142  ·  view source on GitHub ↗

Construct axis with n bins over real range [lower, upper). * * \param n number of bins. * \param lower low edge of first bin. * \param upper high edge of last bin. * \param label description of the axis. * \param uoflow whether to add under-/overflow bins. * \param trans arguments passed to the transform. */

Source from the content-addressed store, hash-verified

127 * \param trans arguments passed to the transform.
128 */
129 regular(unsigned n, value_type lower, value_type upper, string_view label = {},
130 uoflow_type uo = uoflow_type::on, transform_type trans = transform_type(),
131 const allocator_type& a = allocator_type())
132 : base_type(n, uo, label, a)
133 , transform_type(trans)
134 , min_(trans.forward(lower))
135 , delta_((trans.forward(upper) - trans.forward(lower)) / n) {
136 if (lower < upper) {
137 BOOST_ASSERT(!std::isnan(min_));
138 BOOST_ASSERT(!std::isnan(delta_));
139 } else {
140 throw std::invalid_argument("lower < upper required");
141 }
142 }
143
144 regular() = default;
145 regular(const regular&) = default;

Calls 1

forwardMethod · 0.45

Tested by

no test coverage detected