Alexandria  2.22.0
Please provide a description of the project.
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  InterpolationType type, bool extrapolate = false);
109 
123 ELEMENTS_API double simple_interpolation(double x, const std::vector<double>& xp, const std::vector<double>& yp,
124  bool extrapolate = false);
125 
126 } // namespace MathUtils
127 } // end of namespace Euclid
128 
129 #define INTERPOLATION_IMPL
131 #undef INTERPOLATION_IMPL
132 
133 #endif /* INTERPOLATION_H */
Exception(ExitCode e=ExitCode::NOT_OK)
This module provides an interface for accessing two dimensional datasets (pairs of (X,...
Definition: XYDataset.h:59
#define ELEMENTS_API
ELEMENTS_API std::unique_ptr< Function > interpolate(const std::vector< double > &x, const std::vector< double > &y, InterpolationType type, bool extrapolate=false)
ELEMENTS_API double simple_interpolation(double x, const std::vector< double > &xp, const std::vector< double > &yp, bool extrapolate=false)
InterpolationType
Enumeration of the different supported interpolation types.
Definition: interpolation.h:43
ELEMENTS_API std::unique_ptr< NAryFunction< N > > interpn(const Coordinates< N > &grid, const NdArray::NdArray< double > &values, InterpolationType type, bool extrapolate=false)