-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
34 lines (29 loc) · 797 Bytes
/
main.cpp
File metadata and controls
34 lines (29 loc) · 797 Bytes
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
#include <iostream>
#include <vector>
#include <fstream>
#include "Statistics.h"
void Fast_Fourier_Transform(std::vector<double>);
void Cubic_Spline_Interpolation(std::vector<double>);
int main(int argc, char* argv[])
{
// Test data
std::vector<double> x_data = { 1, 2.2, 4.6, 8, 10, 11, 11.5, 12 };
std::vector<double> y_data = {-2.2, -2.8, -6.1, -3.9, 0.0, 1.1, -0.6, -1.1};
float del_x = 0.01f; // change in x
for (int i = 1; i < argc; i++)
{
int val = (int)argv[i];
switch (val)
{
case FAST_FOURIER_TRANSFORM:
Fast_Fourier_Transform(y_data, del_x);
break;
case CUBIC_SPLINE_INTERPOLATION:
Cubic_Spline_Interpolation(x_data, y_data, del_x); // Computationally Expensive
break;
default:
break;
}
}
return 0;
}