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

Function calcPermFunction02

tests/testfn.h:3288–3309  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3286 0.0, &calcPermFunction01, &calcPermFunction01_p };
3287
3288static double calcPermFunction02( const double* const x, const int N )
3289{
3290 const double Beta = 1000.0;
3291 double s1 = 0.0;
3292 int k;
3293
3294 for( k = 1; k <= N; k++ )
3295 {
3296 double s2 = 0.0;
3297 int i;
3298
3299 for( i = 1; i <= N; i++ )
3300 {
3301 s2 += ( pow( (double) i, (double) k ) + Beta ) *
3302 ( pow( x[ i - 1 ], (double) k ) - 1.0 / i );
3303 }
3304
3305 s1 += s2 * s2;
3306 }
3307
3308 return( s1 );
3309}
3310
3311static void calcPermFunction02_p( double* const minv, double* const maxv,
3312 const int N, double* const optv )

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected