Alexandria  2.16
Please provide a description of the project.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Piecewise.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2020 Euclid Science Ground Segment
3  *
4  * This library is free software; you can redistribute it and/or modify it under
5  * the terms of the GNU Lesser General Public License as published by the Free
6  * Software Foundation; either version 3.0 of the License, or (at your option)
7  * any later version.
8  *
9  * This library is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12  * details.
13  *
14  * You should have received a copy of the GNU Lesser General Public License
15  * along with this library; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17  */
18 
25 #ifndef MATHUTILS_PIECEWISE_H
26 #define MATHUTILS_PIECEWISE_H
27 
28 #include <vector>
29 #include <memory>
30 
31 #include "ElementsKernel/Export.h"
32 
34 
35 namespace Euclid {
36 namespace MathUtils {
37 
49 
50 public:
51 
66 
68 
70  virtual ~Piecewise() = default;
71 
73  const std::vector<double>& getKnots() const;
74 
76  const std::vector<std::unique_ptr<Function>>& getFunctions() const;
77 
80  double operator()(const double) const override;
81 
84  std::unique_ptr<Function> clone() const override;
85 
93  double integrate(const double x1, const double x2) const override;
94 
95 private:
96 
101 
102 };
103 
104 } // End of MathUtils
105 } // end of namespace Euclid
106 
107 #endif /* MATHUTILS_PIECEWISE_H */
108 
std::vector< double > m_knots
A vector where the knots are kept.
Definition: Piecewise.h:98
Interface representing an integrable function.
Definition: Integrable.h:44
std::vector< std::unique_ptr< Function > > m_functions
A vector where the sub-functions are kept.
Definition: Piecewise.h:100
#define ELEMENTS_API
ELEMENTS_API double integrate(const Function &function, const double min, const double max, std::unique_ptr< NumericalIntegrationScheme > numericalIntegrationScheme=nullptr)
STL class.
Represents a piecewise function.
Definition: Piecewise.h:48