YODA::Transformation< N, Args > Class Template Reference
Detailed Descriptiontemplate<size_t N, typename... Args> class YODA::Transformation< N, Args > Generalised transformation The tranformation uses a functor that acts on a double (possibly with additional arguments) and returns a double. The generalisation is in the number of dimensions in which the trf can be applied. Definition at line 31 of file Transformation.h. Member Typedef Documentation◆ Breakdown
template<size_t N, typename... Args>
Definition at line 38 of file Transformation.h. ◆ NdVal
template<size_t N, typename... Args>
Definition at line 36 of file Transformation.h. ◆ NdValPair
template<size_t N, typename... Args>
Definition at line 37 of file Transformation.h. ◆ Pair
template<size_t N, typename... Args>
Convenient aliases. Definition at line 35 of file Transformation.h. Constructor & Destructor Documentation◆ Transformation() [1/3]
template<size_t N, typename... Args>
No nullary constructor since a trf method should always be supplied ◆ Transformation() [2/3]
template<size_t N, typename... Args>
Default constructor setting the trf method. Definition at line 49 of file Transformation.h. 49: _Fn(fn) { }
◆ Transformation() [3/3]
template<size_t N, typename... Args>
Default constructor setting the trf method. Definition at line 52 of file Transformation.h. 52: _Fn(std::move(fn)) { }
Member Function Documentation◆ operator()()
template<size_t N, typename... Args>
Operator calling the functor. Definition at line 56 of file Transformation.h. 56{ return _Fn(v, std::forward<Args>(args)...); }
◆ transform() [1/5]
template<size_t N, typename... Args>
Transform value val. Definition at line 65 of file Transformation.h. 65{ val = _Fn(val, std::forward<Args>(args)...); }
Referenced by YODA::PointBase< N >::scale(), YODA::Estimate::scale(), YODA::PointBase< N >::scale(), YODA::Transformation< N, Args >::transform(), YODA::Transformation< N, Args >::transform(), YODA::Transformation< N, Args >::transform(), and YODA::Transformation< N, Args >::transform(). ◆ transform() [2/5]
template<size_t N, typename... Args>
Transform value val and breakdown of signed error pairs signed_errs. Definition at line 77 of file Transformation.h. 77 {
78 // keep track of original central value
79 const double oldval = val;
80 // transform central value
81 transform(val, std::forward<Args>(args)...);
82 // transform errors
83 for (auto& item : signed_errs) {
84 item.second.first = _Fn(oldval + item.second.first, std::forward<Args>(args)...) - val;
85 item.second.second = _Fn(oldval + item.second.second, std::forward<Args>(args)...) - val;
86 }
87 }
void transform(double &val, Args &&... args) const Transform value val. Definition Transformation.h:65 References YODA::Transformation< N, Args >::transform(). ◆ transform() [3/5]
template<size_t N, typename... Args>
Transform value val and error pair errs. Definition at line 90 of file Transformation.h. 90 {
91 // transform errors
92 const double trf_min = _Fn(val - errs.first, std::forward<Args>(args)...);
93 const double trf_max = _Fn(val + errs.second, std::forward<Args>(args)...);
94 // transform central value
95 transform(val, std::forward<Args>(args)...);
96 // Deal with possible inversions of min/max ordering under the transformation
97 const double new_min = std::min(trf_min, trf_max);
98 const double new_max = std::max(trf_min, trf_max);
99 errs = std::make_pair(val - new_min, new_max - val);
100 }
References YODA::Transformation< N, Args >::transform(). ◆ transform() [4/5]
template<size_t N, typename... Args>
Transform values vals. Definition at line 68 of file Transformation.h. References YODA::Transformation< N, Args >::transform(). ◆ transform() [5/5]
template<size_t N, typename... Args>
Transform values vals and error pairs errs. Definition at line 103 of file Transformation.h. 103 {
104 for (size_t i = 0; i < N; ++i) {
105 transform(vals[i], errs[i], std::forward<Args>(args)...);
106 }
107 }
References YODA::Transformation< N, Args >::transform(). The documentation for this class was generated from the following file:
Generated on Mon Oct 28 2024 13:47:24 for YODA - Yet more Objects for Data Analysis by 1.9.8 |