Alexandria
2.18
Please provide a description of the project.
MathUtils
MathUtils
function
Piecewise.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2012-2021 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 <memory>
29
#include <vector>
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
:
64
Piecewise
(
std::vector<double>
knots,
std::vector
<
std::shared_ptr<Function>
> functions);
65
66
Piecewise
(
std::vector<double>
knots,
std::vector
<
std::unique_ptr<Function>
>&& functions);
67
69
virtual
~Piecewise
() =
default
;
70
72
const
std::vector<double>
& getKnots()
const
;
73
75
const
std::vector<std::unique_ptr<Function>
>& getFunctions()
const
;
76
79
double
operator()(
const
double
)
const override
;
80
83
std::unique_ptr<Function>
clone()
const override
;
84
92
double
integrate
(
const
double
x1,
const
double
x2)
const override
;
93
94
private
:
96
std::vector<double>
m_knots
;
98
std::vector<std::unique_ptr<Function>
>
m_functions
;
99
};
100
101
}
// namespace MathUtils
102
}
// end of namespace Euclid
103
104
#endif
/* MATHUTILS_PIECEWISE_H */
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:98
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::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
Generated by
1.8.20