Transform.qbk 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. [/
  2. Copyright Hans Dembinski 2018 - 2019.
  3. Distributed under the Boost Software License, Version 1.0.
  4. (See accompanying file LICENSE_1_0.txt or copy at
  5. https://www.boost.org/LICENSE_1_0.txt)
  6. ]
  7. [section:Transform Transform]
  8. 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].
  9. [heading Required features]
  10. * `T` is a type meeting the requirements of [*Transform]
  11. * `t` is a value of type `T`
  12. * `X` is a type with the semantics of a floating-point type
  13. * `x` is a value of type `X`
  14. * `Y` is a floating-point type
  15. * `y` is a value of type `Y`
  16. [table Valid expressions
  17. [[Expression] [Returns] [Semantics, Pre/Post-conditions]]
  18. [
  19. [`t.forward(x)`]
  20. [`Y`]
  21. [
  22. Const or static member function which maps the external value to the corresponding internal value. The return type `Y` may differ from `X`.
  23. ]
  24. ]
  25. [
  26. [`t.inverse(y)`]
  27. [`X`]
  28. [
  29. 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.
  30. ]
  31. ]
  32. [
  33. [`t == u`]
  34. [`bool`]
  35. [
  36. `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.
  37. ]
  38. ]
  39. ]
  40. [heading Optional features]
  41. * `T` is a type meeting the requirements of [*Transform]
  42. * `t` is a value of type `T`
  43. * `ar` is a value of an archive with Boost.Serialization semantics
  44. [table Valid expressions
  45. [[Expression] [Returns] [Semantics, Pre/Post-conditions]]
  46. [
  47. [`t.serialize(ar, n)`]
  48. []
  49. [
  50. `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.
  51. ]
  52. ]
  53. ]
  54. [heading Models]
  55. * [classref boost::histogram::axis::transform::id]
  56. * [classref boost::histogram::axis::transform::log]
  57. * [classref boost::histogram::axis::transform::sqrt]
  58. * [classref boost::histogram::axis::transform::pow]
  59. [endsect]