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

Function calcMultiGaussian

tests/testfn.h:2845–2860  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2843 0.0000435526619, &calcMeyerRoth, NULL };
2844
2845static double calcMultiGaussian( const double* const x, const int N )
2846{
2847 static const double a[ 5 ] = { 0.5, 1.2, 1.0, 1.0, 1.2 };
2848 static const double b[ 5 ] = { 0.0, 1.0, 0.0, -0.5, 0.0 };
2849 static const double c[ 5 ] = { 0.0, 0.0, -0.5, 0.0, 1.0 };
2850 static const double d[ 5 ] = { 0.1, 0.5, 0.5, 0.5, 0.5 };
2851 double s = 0.0;
2852 int i;
2853
2854 for( i = 0; i < 5; i++ )
2855 {
2856 s += a[i]*exp(-(sqr(x[0]-b[i])+sqr(x[1]-c[i]))/sqr(d[i]));
2857 }
2858
2859 return( -s );
2860}
2861
2862static const CTestFn TestFnMultiGaussian = { "MultiGaussian", 2, -2.0, 2.0,
2863 -1.2969540459538, &calcMultiGaussian, NULL };

Callers

nothing calls this directly

Calls 1

sqrFunction · 0.85

Tested by

no test coverage detected