@@ -14,7 +14,13 @@ To use databox, simply include the relevant header:
14
14
15
15
#include <databox.hpp>
16
16
17
- ``DatBox `` is templated on underyling data type, which defaults to the
17
+ ``DataBox `` Templates
18
+ ^^^^^^^^^^^^^^^^^^^^^
19
+
20
+ Underlying Data Type
21
+ --------------------
22
+
23
+ ``DataBox `` is templated on the underyling data type, which defaults to the
18
24
``Real `` type provided by ``ports-of-call ``. (This is usually a
19
25
``double ``.)
20
26
@@ -30,6 +36,9 @@ single type, you may wish to declare a type alias such as:
30
36
31
37
using DataBox = Spiner::DataBox<double>
32
38
39
+ Interpolation Gridding
40
+ ----------------------
41
+
33
42
Spiner is also templated on how the interpolation gridding works. This
34
43
template parameter is called ``Grid_t ``. The available options at this time are:
35
44
@@ -47,6 +56,40 @@ as, for example:
47
56
More detail on the interpolation gridding is available below and in
48
57
the interpolation section.
49
58
59
+ Transformations
60
+ ---------------
61
+
62
+ Spiner performs linear interpolation of the data, but can apply transformations
63
+ to the data in order to enable interpolation methods like log-log, log-lin,
64
+ etc. Spiner will perform linear interpolation of the transformed variables.
65
+
66
+ When constructing the gridding, ``Spiner::RegularGrid1D<T> `` and
67
+ ``Spiner::PiecewiseGrid1D<T> `` are templated on the independent variable
68
+ transformation. Note that all independent variables will use the same
69
+ transformation. ``DataBox `` is templated on the dependent variable
70
+ transformation. In all cases, the default is a linear "transformation" (no
71
+ transformation to the data), so if you do not specify the transformation then
72
+ you get linear interpolation. The available transformations are in
73
+ ``spiner/transformations.hpp `` and users can write custom transformations
74
+ following the examples there.
75
+
76
+ For example, if the user wants to transform the independent variables with a
77
+ logarithm and the dependent variable with a custom arctangent transformation,
78
+ the declaration of the ``DataBox `` might look like
79
+
80
+ .. code-block :: cpp
81
+
82
+ using DataBox = Spiner::DataBox<double, Spiner::RegularGrid1D<double,
83
+ Spiner::TransformLogarithmic>, CustomArctanTransform>;
84
+
85
+ This would result in interpolation according to the equation
86
+
87
+ .. math ::
88
+
89
+ \arctan (y) = b + \sum m_i \log (x_i)
90
+
91
+ where :math: `x_i` are the independent variables.
92
+
50
93
.. note ::
51
94
In C++17 and later, you can also get the default type specialization
52
95
by simply omitting the template arguments.
0 commit comments