Alexandria  2.25.0
SDC-CH common library for the Euclid project
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
interpolation.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 INTERPOLATION_H
26 #define INTERPOLATION_H
27 
28 #include <array>
29 #include <memory>
30 #include <vector>
31 
33 #include "ElementsKernel/Export.h"
34 
36 #include "NdArray/NdArray.h"
37 #include "XYDataset/XYDataset.h"
38 
39 namespace Euclid {
40 namespace MathUtils {
41 
44 
47 };
48 
64  InterpolationType type, bool extrapolate = false);
65 
78  bool extrapolate = false);
79 
85 template <std::size_t N>
87 
106 template <std::size_t N>
108  const NdArray::NdArray<double>& values, InterpolationType type,
109  bool extrapolate = false);
110 
124 ELEMENTS_API double simple_interpolation(double x, const std::vector<double>& xp, const std::vector<double>& yp,
125  bool extrapolate = false);
129 ELEMENTS_API double simple_interpolation(double x, double x0, double x1, double y0, double y1,
130  bool extrapolate) noexcept;
131 
132 } // namespace MathUtils
133 } // end of namespace Euclid
134 
135 #define INTERPOLATION_IMPL
137 #undef INTERPOLATION_IMPL
138 
139 #endif /* INTERPOLATION_H */
ELEMENTS_API double simple_interpolation(double x, const std::vector< double > &xp, const std::vector< double > &yp, bool extrapolate=false)
std::unique_ptr< NAryFunction< N > > interpn(const Coordinates< N > &grid, const NdArray::NdArray< double > &values, InterpolationType type, bool extrapolate)
#define ELEMENTS_API
Exception(ExitCode e=ExitCode::NOT_OK)
constexpr std::size_t N
STL class.
This module provides an interface for accessing two dimensional datasets (pairs of (X...
Definition: XYDataset.h:59
STL class.
InterpolationType
Enumeration of the different supported interpolation types.
Definition: interpolation.h:43
ELEMENTS_API std::unique_ptr< Function > interpolate(const std::vector< double > &x, const std::vector< double > &y, InterpolationType type, bool extrapolate=false)