| 875 | } |
| 876 | |
| 877 | void _checkNorm(DenseMatrix normValues, int row, size_t numPoints, double one_eps, double two_eps, double inf_eps) |
| 878 | { |
| 879 | bool withinThreshold =\ |
| 880 | normValues(row,0) / numPoints <= one_eps |
| 881 | && normValues(row,1) <= two_eps |
| 882 | && normValues(row,2) <= inf_eps; |
| 883 | |
| 884 | INFO(std::setw(16) << std::left << "1-norm (\"avg\"):" << std::setw(16) << std::right << normValues(row,0) / numPoints); |
| 885 | INFO(std::setw(16) << std::left << "2-norm:" << std::setw(16) << std::right << normValues(row,1)); |
| 886 | INFO(std::setw(16) << std::left << "inf-norm:" << std::setw(16) << std::right << normValues(row,2)); |
| 887 | |
| 888 | CHECK(withinThreshold); |
| 889 | } |
| 890 | |
| 891 | // Must use std::function because a capturing alpha cannot be converted to a function pointer |
| 892 | void testApproximation(std::vector<TestFunction *> funcs, |