-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathInterpolation.h
executable file
·42 lines (37 loc) · 1.09 KB
/
Interpolation.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef INTERPOLATION_H
#define INTERPOLATION_H
class Interpolation
{
public:
/**
@param x[] all points
@param y[] corresponding f(x)
@param a point to be interpolated
@param n size of the input array
@return interpolated point
*/
double NewtInt(double x[], double y[], double a, int n);
/**
@param x[] all points
@param y[] corresponding f(x)
@param a point to be interpolated
@param n size of the input array
@return interpolated point
*/
double Spline(double x[], double y[], double a, int n);
protected:
private:
/**
@param x[] array of interval limits
@param a point to be interpolated
@param n number of elements in array x[]
Finds the interval of the interpolated point to calculate the interpolant
*/
double findingInterval(double x[], double a, int n);
/**
@param a[] array to be printed
@param n size of the array
*/
void printArray(double a[], int n);
};
#endif // INTERPOLATION_H