| 41 | }; |
| 42 | |
| 43 | int main() |
| 44 | { |
| 45 | CBiteRnd rnd; |
| 46 | rnd.init( 1 ); // Needs to be seeded with different values on each run. |
| 47 | |
| 48 | CTestOpt opt; |
| 49 | opt.init( rnd ); |
| 50 | |
| 51 | int i; |
| 52 | |
| 53 | for( i = 0; i < 10000; i++ ) |
| 54 | { |
| 55 | opt.optimize( rnd ); |
| 56 | |
| 57 | if( opt.getBestCost() < 0.000001 ) |
| 58 | { |
| 59 | break; |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | printf( "IterCount: %i\n", i ); |
| 64 | printf( "BestCost: %f\n", opt.getBestCost() ); |
| 65 | printf( "%f ", opt.getBestParams()[ 0 ]); |
| 66 | printf( "%f\n", opt.getBestParams()[ 1 ]); |
| 67 | |
| 68 | return( 0 ); |
| 69 | } |
nothing calls this directly
no test coverage detected