histogram/doc/getting_started.qbk
2018-09-15 22:55:03 +02:00

28 lines
1.1 KiB
Plaintext

[section:getting_started Getting started]
To get you started quickly, here are some heavily commented examples to copy paste from. If you prefer a more traditional, structured exposition, check out the [link histogram.guide full user guide].
[section Make and use a static 1d-histogram in C++]
If possible, use the static histogram. It is faster and user errors are caught at compile time.
[import ../examples/getting_started_listing_01.cpp]
[getting_started_listing_01]
[endsect]
[section Make and use a dynamic 3d-histogram in C++]
Dynamic histograms are a bit slower than static histograms, but still faster than other libraries. Use a dynamic histogram when you only know at runtime which and how many axis are going to be used, for example, because you wrote a graphical user interface that uses Boost.Histogram underneath.
[import ../examples/getting_started_listing_02.cpp]
[getting_started_listing_02]
[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]
[endsect]