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

Method run

tests/tester.h:639–959  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

637 */
638
639 void run()
640 {
641 #if defined( OPT_PERF )
642 LARGE_INTEGER Freq;
643 QueryPerformanceFrequency( &Freq );
644 LARGE_INTEGER t1;
645 QueryPerformanceCounter( &t1 );
646 #endif // defined( OPT_PERF )
647
648 SumStats.clear();
649 SumStats.TotalAttempts = FnCount * IterCount;
650
651 CTestOpt* opt;
652 int* Iters = new int[ IterCount ];
653 int k;
654
655 #if OPT_THREADS
656 CWorkerThreadPool Threads;
657
658 for( k = 0; k < CSystem :: getProcessorCount(); k++ )
659 {
660 Threads.add( new CTestOpt() );
661 }
662 #else // OPT_THREADS
663 opt = new CTestOpt();
664 #endif // OPT_THREADS
665
666 for( k = 0; k < FnCount; k++ )
667 {
668 const CTestFnData* const fndata = &FuncData[ k ];
669 const int Dims = ( Funcs[ k ] -> Dims == 0 ?
670 fndata -> DefDims : Funcs[ k ] -> Dims );
671
672 CFuncStats FuncStats;
673 int j;
674
675 for( j = 0; j < IterCount; j++ )
676 {
677 #if OPT_THREADS
678 VOXERRSKIP( Threads.getIdleThread( opt ));
679 #endif // OPT_THREADS
680
681 opt -> rnd.init( k + 1 + ( j + 1 ) * 10000 );
682 opt -> updateDims( Dims );
683 opt -> fn = Funcs[ k ];
684 opt -> DoRandomize = fndata -> DoRandomize;
685 opt -> DoRandomizeAll = fndata -> DoRandomizeAll;
686 opt -> MaxIters = InnerIterCount;
687 opt -> SumStats = &SumStats;
688 opt -> FuncStats = &FuncStats;
689 opt -> Index = j;
690 opt -> Iters = Iters;
691 opt -> optv = opt -> fn -> OptValue;
692
693 int i;
694
695 if( opt -> fn -> ParamFunc != NULL )
696 {

Callers 4

mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80

Calls 9

getMethod · 0.80
performOptMethod · 0.80
getChoiceCountMethod · 0.80
clearMethod · 0.45
initMethod · 0.45
updateDimsMethod · 0.45
getSelsMethod · 0.45
getSelNamesMethod · 0.45
getSelCountMethod · 0.45

Tested by

no test coverage detected