MCPcopy Create free account
hub / github.com/avaneev/biteopt / calcDeflCorrSpring

Function calcDeflCorrSpring

tests/testfn.h:1795–1808  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1793 &calcCigar, NULL };
1794
1795static 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
1810static const CTestFn TestFnDeflCorrSpring = { "DeflCorrSpring", 0,
1811 0.0, 10.0, -1.0, &calcDeflCorrSpring, NULL };

Callers

nothing calls this directly

Calls 1

sqrFunction · 0.85

Tested by

no test coverage detected