PPCKO: Principal Predictive Components for Estimating an Autoregressive Operator
 
Loading...
Searching...
No Matches
interp_func.hpp
Go to the documentation of this file.
1// Copyright (c) 2024 Andrea Enrico Franzoni (andreaenrico.franzoni@gmail.com)
2//
3// This file is part of PPCKO
4//
5// Permission is hereby granted, free of charge, to any person obtaining a copy
6// of PPCKO and associated documentation files (the PPCKO software), to deal
7// PPCKO without restriction, including without limitation the rights
8// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9// copies of PPCKO, and to permit persons to whom PPCKO is
10// furnished to do so, subject to the following conditions:
11//
12// PPCKO IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17// OUT OF OR IN CONNECTION WITH PPCKO OR THE USE OR OTHER DEALINGS IN
18// PPCKO.
19
20#ifndef INTEGRAND_INTERP_L2_SCALAR_PROD_HPP
21#define INTEGRAND_INTERP_L2_SCALAR_PROD_HPP
22
23#include <vector>
24#include <functional>
25
26#include "interp1D_util.hpp"
27
33
34
40{
41 std::vector<double> grid_eval;
42
49 double operator()(const double &x, const std::vector<double> &evals)
50 {
51 return apsc::interp1D(grid_eval, evals, x);
52 }
53};
54
55#endif //INTEGRAND_INTERP_L2_SCALAR_PROD_HPP
auto interp1D(RAIterator const &begin, RAIterator const &end, Key const &keyVal, ExtractKey const &extractKey, ExtractValue const &extractValue, CompareKey const &comp=std::less< Key >())
Definition interp1D.hpp:92
Contains a specialization for the template class for interpolating an unidimensional-univariate funct...
Contains the function to perform unidimensional-univariate function interpolation and the grid for wh...
Definition interp_func.hpp:40
double operator()(const double &x, const std::vector< double > &evals)
Perform the interpolation of the function on a given point.
Definition interp_func.hpp:49
std::vector< double > grid_eval
Grid for which the function evaluation are already available.
Definition interp_func.hpp:41