Alexandria 2.31.0
SDC-CH common library for the Euclid project
Loading...
Searching...
No Matches
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
34
36#include "NdArray/NdArray.h"
37#include "XYDataset/XYDataset.h"
38
39namespace Euclid {
40namespace MathUtils {
41
44
48
64 InterpolationType type, bool extrapolate = false);
65
78 bool extrapolate = false);
79
85template <std::size_t N>
87
106template <std::size_t N>
109 bool extrapolate = false);
110
125 bool extrapolate = false);
129ELEMENTS_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 */
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< NAryFunction< N > > interpn(const Coordinates< N > &grid, const NdArray::NdArray< double > &values, InterpolationType type, bool extrapolate=false)
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.