Alexandria
2.16
Please provide a description of the project.
MathUtils
MathUtils
function
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
33
#include "
MathUtils/function/Integrable.h
"
34
35
namespace
Euclid
{
36
namespace
MathUtils {
37
48
class
ELEMENTS_API
Piecewise
:
public
Integrable
{
49
50
public
:
51
65
Piecewise
(
std::vector<double>
knots,
std::vector
<
std::shared_ptr<Function>
> functions);
66
67
Piecewise
(
std::vector<double>
knots,
std::vector
<
std::unique_ptr<Function>
>&& functions);
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
98
std::vector<double>
m_knots
;
100
std::vector<std::unique_ptr<Function>
>
m_functions
;
101
102
};
103
104
}
// End of MathUtils
105
}
// end of namespace Euclid
106
107
#endif
/* MATHUTILS_PIECEWISE_H */
108
std::shared_ptr
STL class.
Euclid::MathUtils::Piecewise::m_functions
std::vector< std::unique_ptr< Function > > m_functions
A vector where the sub-functions are kept.
Definition:
Piecewise.h:100
Export.h
std::vector< double >
Euclid::MathUtils::Piecewise
Represents a piecewise function.
Definition:
Piecewise.h:48
Euclid::MathUtils::Piecewise::~Piecewise
virtual ~Piecewise()=default
Default destructor.
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::Piecewise
Piecewise(std::vector< double > knots, std::vector< std::shared_ptr< Function >> functions)
Euclid::MathUtils::Piecewise::m_knots
std::vector< double > m_knots
A vector where the knots are kept.
Definition:
Piecewise.h:98
Integrable.h
std::unique_ptr
STL class.
Euclid
Definition:
InstOrRefHolder.h:29
Generated by
1.8.18