Alexandria  2.14.1
Please provide a description of the project.
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  virtual ~Piecewise() = default;
69 
71  const std::vector<double>& getKnots() const;
72 
74  const std::vector<std::shared_ptr<Function>>& getFunctions() const;
75 
78  double operator()(const double) const override;
79 
82  std::unique_ptr<Function> clone() const override;
83 
91  double integrate(const double x1, const double x2) const override;
92 
93 private:
94 
99 
100 };
101 
102 } // End of MathUtils
103 } // end of namespace Euclid
104 
105 #endif /* MATHUTILS_PIECEWISE_H */
106 
std::shared_ptr
STL class.
Export.h
std::vector< double >
Euclid::MathUtils::Piecewise
Represents a piecewise function.
Definition: Piecewise.h:48
Euclid::MathUtils::integrate
ELEMENTS_API double integrate(const Function &function, const double min, const double max, std::unique_ptr< NumericalIntegrationScheme > numericalIntegrationScheme=nullptr)
Definition: function_tools.cpp:33
ELEMENTS_API
#define ELEMENTS_API
Euclid::MathUtils::Integrable
Interface representing an integrable function.
Definition: Integrable.h:44
Euclid::MathUtils::Piecewise::m_knots
std::vector< double > m_knots
A vector where the knots are kept.
Definition: Piecewise.h:96
Integrable.h
std::unique_ptr
STL class.
Euclid
Definition: InstOrRefHolder.h:29
Euclid::MathUtils::Piecewise::m_functions
std::vector< std::shared_ptr< Function > > m_functions
A vector where the sub-functions are kept.
Definition: Piecewise.h:98