TDMS
Time Domain Maxwell Solver
|
Tests the performance of bandlimited interpolation against cubic interpolation. More...
#include "interpolation_methods.h"
#include <algorithm>
#include <cmath>
#include <catch2/catch_test_macros.hpp>
#include <spdlog/spdlog.h>
#include "input_flags.h"
#include "unit_test_utils.h"
Functions | |
double | f_BLi_vs_Cubic (double x) |
TEST_CASE ("Benchmark: BLi is better than cubic interpolation") | |
We will check that BLi gives a better approximation than cubic interpolation. | |
Tests the performance of bandlimited interpolation against cubic interpolation.
TEST_CASE | ( | "Benchmark: BLi is better than cubic interpolation" | ) |
We will check that BLi gives a better approximation than cubic interpolation.
The metric we will use is the norm of the error-vector. As the cell-size becomes larger (across the same domain), BLi should begin to perform better than cubic interpolation.
For the following cell sizes, over the range -2 to 2, and for the function f(x) = 1/(10x^2+1), MATLAB predicts the following errors: Cell size | BLi err | Cubic err 0.25 | 1.25953429e-02 | 3.28105674e-02 0.1 | 7.10587711e-04 | 5.49601748e-03 0.05 | 7.80325615e-04 | 5.53430587e-04 0.01 | 1.97562511e-03 | 2.06917814e-06 Values computed via the benchmark_test_BLi_vs_cubic.m script.
We will test the following: