| 1793 | &calcCigar, NULL }; |
| 1794 | |
| 1795 | static double calcDeflCorrSpring( const double* const x, const int N ) |
| 1796 | { |
| 1797 | const double a = 5.0; |
| 1798 | const double k = 5.0; |
| 1799 | double s = 0.0; |
| 1800 | int i; |
| 1801 | |
| 1802 | for( i = 0; i < N; i++ ) |
| 1803 | { |
| 1804 | s += sqr(x[i]-a); |
| 1805 | } |
| 1806 | |
| 1807 | return( 0.1*s-cos(k*sqrt(s)) ); |
| 1808 | } |
| 1809 | |
| 1810 | static const CTestFn TestFnDeflCorrSpring = { "DeflCorrSpring", 0, |
| 1811 | 0.0, 10.0, -1.0, &calcDeflCorrSpring, NULL }; |