716 Commits

Author SHA1 Message Date
Henry Schreiner 2193e29a28 fix: move b2 project requirements out of build.jam (#433)
<local-visibility>hidden as a global project requirement leaks into the
install targets that boost-library generates and breaks alternative
selection when building the Boost superproject. The warning flags,
/bigobj, and hidden visibility only matter when compiling tests and
examples, so move them into test/Jamfile and examples/Jamfile.

Fixes #425

Assisted-by: ClaudeCode:claude-fable-5
2026-07-23 18:33:37 +02:00
Henry Schreiner 7fefd5d22e fix: lower CMake requirement to 3.10, raise policy max to 4.4 (#435)
FindPython3 was the only 3.12 dependency; on older CMake the two
Python consistency checks are skipped (they still run in CI).
Standalone builds on older CMake also skip the benchmarks, since
google/benchmark requires 3.13. Raising the policy max to 4.4 needs
CMP0169 set to OLD for BoostFetch.cmake's FetchContent_Populate.

Fixes #417

Assisted-by: ClaudeCode:claude-fable-5
2026-07-23 18:30:08 +02:00
Henry Schreiner ad57696898 fix: ambiguous comparison between indexed accessor and cell reference (#436)
Comparing two const accessors, or an accessor with a storage cell
reference, did not compile with the default storage: the accessor's
catch-all comparison templates and the mirrored friend operators of
unlimited_storage::reference were equally good matches.

Make the accessor-vs-accessor operators const so that standard
algorithms (which compare through const references) use them, and
constrain the generic operators in detail/operators.hpp to yield when
the other operand's class handles the comparison with a member, as
operator== already did.

Fixes #403

Assisted-by: ClaudeCode:claude-fable-5
2026-07-23 18:27:54 +02:00
Henry Schreiner 80fcf10c68 fix: avoid dangling-reference in sample tuple conversion for C++23 compatibility (#423)
Under C++23 P2255R2 (Type Traits To Detect References Binding To
Temporaries), std::tuple's converting constructor is deleted when a
reference element would bind to a temporary. This broke code that
converts tuple<int> to tuple<const double&>, since the int is
first converted to a temporary double.

Fix: strip cv-qualifiers and reference from the deduced sample
argument types in accumulator_traits. This makes
accumulator_traits<mean<double>>::args == tuple<double> instead of
tuple<const double&>, so the compile-time convertibility check
is_convertible<tuple<int>, tuple<double>> succeeds.

Runtime behavior is unchanged; accumulators still receive arguments
through their const double& parameter.


Assisted-by: OpenCode:Kimi-K2.6

Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
2026-07-23 10:40:29 +02:00
Henry Schreiner 7e1fd1989e chore: linting drift (#428)
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
2026-07-23 10:36:52 +02:00
Henry Schreiner 05c6910c49 feat: support passing a coverage parameter to project (#422)
* feat: support passing a coverage parameter to project

This would be useful for boost-histogram, as we could support `flow=False` there directly with this. This uses the existing coverage tag, allowing it to be passed in.

Assisted-by: Copilot:Kimi-K2.6
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>

* fix: reduce diff with develop a bit

Signed-off-by: Henry Schreiner <henryfs@princeton.edu>

---------

Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
2026-07-23 08:58:45 +02:00
Henry Schreiner 40add38b22 fix: support sparse storage with accumulators (#421)
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
2026-03-26 21:38:50 +01:00
René Ferdinand Rivera Morell b5cce2833b Add support for modular build structure. (#401)
* Make the library modular usable
* Move inter-lib dependencies to a project variable and into the build targets
* Bump B2 require to 5.2
* Update dependencies used in CI: compiler versions, tools, etc.

---------

Co-authored-by: Hans Dembinski <hans.dembinski@gmail.com>
2025-06-05 15:23:06 +02:00
Hans Dembinski 66842660c0 fix some false positive warnings emitted by msvc (#399)
* fix some false positive warnings emitted by msvc
* make find_package for Python3 more specific
2024-04-25 12:51:47 +02:00
Ruggero Turra 90867e24a4 Add collector accumulator (#390)
Co-authored-by: Hans Dembinski <hans.dembinski@gmail.com>
2024-04-25 09:05:40 +02:00
Hans Dembinski cd3e1110cb Updates from #370 (#397)
This PR keeps the useful changes from PR #370, which was never finished.
2024-04-24 17:39:24 +02:00
Ed Catmur b11364eb99 Split out dynamic-only tests (#388)
Compiling tests under Visual Studio 2019 14.29.30133 (19.29.30145.0) fails with a not very helpful error:
```
libs\histogram\test\algorithm_project_test.cpp(186,1): fatal error C1903: unable to recover from previous error(s); stopping compilation
```
This can be fixed by moving the dynamic-only tests into a separate function, so that they are only compiled and run once.

---------

Co-authored-by: Hans Dembinski <hans.dembinski@gmail.com>
2024-04-24 16:08:42 +02:00
Matt Borland 04fb105bc6 Fix python3 variables (#398) 2024-04-24 11:52:19 +02:00
Matt Borland cda7447c97 Replace deprecated find_package for python (#393)
* Replace deprecated find_package for python
* update cmake minimum version

---------

Co-authored-by: Hans Dembinski <hans.dembinski@gmail.com>
2024-04-23 14:11:46 +02:00
Hans Dembinski 70b98302a2 Replace detail::span and detail::make_span with implementations in boost::core (#384)
* fix cmake build of benchmarks

* wip

* u

* u

* rename span.hpp to make_span.hpp

* missing file

* also replace make_span
2023-02-19 17:42:01 +01:00
Hans Dembinski 652c7f8ebb try to catch for illegal min,max macros (#381) 2022-12-26 12:14:05 +01:00
Han Jiang 78021d54d8 add parentheses around min and max (#377) 2022-12-24 14:26:14 +01:00
Hans Dembinski 72064c642a increase coverage and fix noexcept (#375) 2022-12-23 01:21:39 +01:00
Andrey Semashev 3804826411 Use std::is_same instead of boost::core::is_same. (#374)
boost::core::is_same is deprecated, so use std::is_same instead.
2022-12-23 00:59:15 +01:00
Hans Dembinski 25608fe86a fix sub_array and span in C++20 (#368) 2022-10-03 13:57:08 +02:00
Hans Dembinski 1c9077a6e1 Enable pre-commit (#366) 2022-09-28 12:11:50 +02:00
Jay Gohil 10c19df918 Add fraction accumulator (for calculating efficiencies, etc) (#361)
* Added fraction accumulator
* Added binomial proportion interval computers: Wald, Wilson Score, Clopper Pearson, Jeffreys
* Width of intervals for all classes can be set via deviation or confidence_level
* Support valarray in histogram::fill
* Add fraction and count to user guide

Co-authored-by: Hans Dembinski <hans.dembinski@gmail.com>
Co-authored-by: Hans Dembinski <HDembinski@users.noreply.github.com>
2022-09-28 11:18:46 +02:00
Hans Dembinski 7cf67610f8 make iterator_adaptor easier to use (#364) 2022-09-17 18:35:33 +02:00
Hans Dembinski 4699dbc0e8 fix tests for msvc 2022 (#363) 2022-07-28 19:16:27 +02:00
Hans Dembinski b62d38051e fix for cmake tests 2022-07-27 23:04:20 +02:00
Hans Dembinski 8b1657553d Enable ascii ostream tests on windows (#360) 2022-07-20 10:32:56 +02:00
Hans Dembinski 843cacffbf fix indexed crash for histograms with axes of zero size (physical or logical) (#356) 2022-07-20 09:51:16 +02:00
Hans Dembinski 9caf633366 remove deprecated API, as previously announced (#359) 2022-07-19 23:08:38 +02:00
Hans Dembinski bebb509224 add ascii test and clarify why tests are skipped (#357) 2022-07-19 21:17:39 +02:00
Hans Dembinski d736aab212 Division support for weighted_sum (#351) 2022-02-10 10:36:07 +01:00
Hans Dembinski bf7712f0d7 regular and variable axis are closed intervals if overflow bin is absent (#344) 2021-11-15 09:29:14 +01:00
Hans Dembinski b482598597 cpp17: set axis compile-time options via deduction guide (#340) 2021-11-15 09:29:12 +01:00
Hans Dembinski 8f3a3c07e4 clean up 2021-11-15 09:28:35 +01:00
Hans Dembinski f6577ec473 deprecate accumulators::sum::small and ::large as workaround for bug in windows.h (#343) 2021-11-15 08:18:05 +01:00
Hans Dembinski 6cc4601b87 Fix bug in 1D histogram::fill when axis is growing and argument is single value (#334) 2021-09-26 18:31:35 +02:00
Hans Dembinski 4a10c2c11b Fix and test for missing count division (#329) 2021-08-19 14:22:41 +02:00
Hans Dembinski 90a58d03ee fix scaling for count and update CI (#328) 2021-06-27 16:58:14 +02:00
Hans Dembinski 6cde30a366 deprecate accumulators::thread_safe, replace with optionally thread-safe accumulators::count (#326) 2021-05-17 22:20:47 +02:00
Hans Dembinski 2d9623d7ff Generalize indexed; allow interation over user-provided rectangular range (#321) 2021-04-24 22:37:42 +02:00
Hans Dembinski c1b51ad640 fix inclusive() in integer axis (#320)
It was possible to trigger this bug, which triggered an assertion in debug mode. In release mode, it would have probably caused a segfault.
2021-04-24 12:24:47 +02:00
Hans Dembinski d60f96ded6 ostream improvements: support more accumulators, unicode plots (#317) 2021-04-23 20:15:12 +02:00
Hans Dembinski c80ab0ca34 add method to get effective count for weighted accumulators (#312)
following the discussion around boost-histogram's interface (Python wrapper)
2021-04-23 15:06:05 +02:00
Hans Dembinski 14fdb6fb56 Support floating point numbers in thread_safe accumulator, don't inherit from std::atomic (#315)
* don't inherit from std::atomic anymore
* support float and double
* added .value() method for consistency
2021-04-23 15:04:23 +02:00
Hans Dembinski 5d671b4ffc update internal detect code, add is_explicitly_convertible and is_complete (#316) 2021-04-23 14:58:54 +02:00
Hans Dembinski f0e9e77a33 fixing bug in detection of weight support in user-defined accumulators (#314)
* Also fixed the accumulator concept spec, which was wrong
2021-03-18 12:58:12 +01:00
Hans Dembinski f9920135c5 fix weighted_mean::operator+= and add missing noexcept to operator*= (#311) 2021-03-17 11:53:10 +01:00
Hans Dembinski de33fc74a4 Fix variance calculation in accumulators::mean::operator+= (#308) 2021-03-16 13:17:40 +01:00
Hans Dembinski e6c2014897 More crop tests with rebin and regular axis (#303) 2020-12-08 00:33:26 +01:00
Hans Dembinski 5bd5bfb978 Bug-fix for one-sided cropping and clarify how cropping works (#302) 2020-12-07 15:12:20 +01:00
Hans Dembinski ebe9010db8 bug-fix: handling of special values in ctor and in value method #301
* Fixed: Passing nan to the ctor of axis::variable failed to throw std::invalid_argument
* Fixed: axis::variable{{0, 1, inf}}.value(1) was nan, because interpolation would compute 0 * inf
2020-11-10 22:18:32 +01:00