Helios++
Helios software for LiDAR simulations
IMathFunction.hpp
1 #pragma once
2 
3 #include <vector>
4 
5 #include <surfaceinspector/util/Object.hpp>
6 
7 using std::vector;
8 
10 
11 namespace SurfaceInspector { namespace maths{ namespace functions{
12 
21 template <typename Tin, typename Tout>
22 class IMathFunction : public Object{
23 public:
24  // *** MATH FUNCTION INTERFACE *** //
25  // ********************************* //
32  virtual Tout operator() (Tin const &x);
37  virtual inline Tout operator() (Tin const &&x) {(*this)(x);}
38 
39  // *** MATH FUNCTION BASE *** //
40  // **************************** //
47  virtual inline vector<Tout> operator() (vector<Tin> const &u)
48  {
49  vector<Tout> v(0);
50  for(Tin const &x : u) v.push_back((*this)(x));
51  return v;
52  }
53 };
54 
55 }}}
Interface defining math function core mechanics.
Definition: IMathFunction.hpp:22
virtual Tout operator()(Tin const &x)
Math function callable. It must be implemented by any concrete implementation of a valid math functio...
Class representing an object. All surface inspector classes must extend Object.
Definition: Object.hpp:12