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

Function calcZeroSum

tests/testfn.h:1269–1280  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1267 -0.1994114689059, &calcMishra04, NULL };
1268
1269static double calcZeroSum( const double* const x, const int N )
1270{
1271 double s = 0.0;
1272 int i;
1273
1274 for( i = 0; i < N; i++ )
1275 {
1276 s += x[i];
1277 }
1278
1279 return( s == 0.0 ? 0.0 : 1.0+pow(10000.0*fabs(s),0.5) );
1280}
1281
1282static const CTestFn TestFnZeroSum = { "ZeroSum", 0, -10.0, 10.0, 0.0,
1283 &calcZeroSum, NULL };

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected