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

Method optcost

example.cpp:28–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26 }
27
28 virtual double optcost( const double* const p )
29 {
30 const double x = p[ 0 ];
31 const double y = p[ 1 ];
32
33 return( sqr( x + 2 * y - 7 ) + sqr( 2 * x + y - 5 ));
34// return( 0.26 * ( x * x + y * y ) - 0.48 * x * y );
35// return( x * x + y * y );
36// return( 2 * x * x - 1.05 * sqr( sqr( x )) + sqr( sqr( sqr( x ))) / 6 + x * y + y * y );
37// return( 0.5 + ( sqr( sin( x * x - y * y )) - 0.5 ) / sqr( 1 + 0.001 * ( x * x + y * y )));
38// return( 100 * sqr( y - x * x ) + sqr( x - 1 ));
39// return( sqr( 1.5 - x + x * y ) + sqr( 2.25 - x + x * y * y ) + sqr( 2.625 - x + x * y * y * y ));
40 }
41};
42
43int main()

Callers

nothing calls this directly

Calls 1

sqrFunction · 0.85

Tested by

no test coverage detected