Functional.hh
Go to the documentation of this file.
1 
39 #ifndef CRL_MULTISENSE_FUNCTIONAL_HH
40 #define CRL_MULTISENSE_FUNCTIONAL_HH
41 
42 namespace crl {
43 namespace multisense {
44 namespace details {
45 namespace utility {
46 
47 template <class Type>
48 inline bool
49 approximatelyEqual(Type const& xx, Type const& yy, Type const& epsilon) {
50  return (((xx)-(yy) < (epsilon)) && ((xx)-(yy) > -(epsilon)));
51 }
52 
53 template <class Type>
54 inline bool
55 approxEqual(Type const& xx, Type const& yy, Type const& epsilon) {
56  return approximatelyEqual(xx, yy, epsilon);
57 }
58 
59 template <class Type>
60 inline Type
61 boundValue(Type const& value, Type const& minimum, Type const& maximum) {
62  return ((value > maximum) ? maximum : (value < minimum) ? minimum : value);
63 }
64 
65 template <class Type>
66 inline Type
67 decayedAverage(Type const& previous, Type const& samples, Type const& newest) {
68  return (((samples - 1) * previous) + newest) / samples;
69 }
70 
71 }}}} // namespaces
72 
73 #endif /* #ifndef CRL_MULTISENSE_FUNCTIONAL_HH */
epsilon
double epsilon
crl::multisense::details::utility::decayedAverage
Type decayedAverage(Type const &previous, Type const &samples, Type const &newest)
Definition: Functional.hh:67
crl
Definition: Legacy/details/channel.cc:61
crl::multisense::details::utility::approxEqual
bool approxEqual(Type const &xx, Type const &yy, Type const &epsilon)
Definition: Functional.hh:55
multisense
Definition: factory.cc:39
crl::multisense::details::utility::approximatelyEqual
bool approximatelyEqual(Type const &xx, Type const &yy, Type const &epsilon)
Definition: Functional.hh:49
crl::multisense::details::utility::boundValue
Type boundValue(Type const &value, Type const &minimum, Type const &maximum)
Definition: Functional.hh:61


multisense_lib
Author(s):
autogenerated on Thu Apr 17 2025 02:49:08