| 564 | */ |
| 565 | |
| 566 | class CTester |
| 567 | { |
| 568 | public: |
| 569 | int DefDims; ///< The default number of dimensions to use. |
| 570 | CSumStats SumStats; ///< Summary statistics. |
| 571 | double SuccessAt; ///< Average Success attempts, available after run(). |
| 572 | double AvgIt; ///< Average Iters, available after run(). |
| 573 | double AvgIt_l10n; ///< Average Iters/ln(10), available after run(). |
| 574 | double AvgRMS; ///< Average RMS, available after run(). |
| 575 | double AvgRMS_l10n; ///< Average RMS/ln(10), available after run(). |
| 576 | double AvgRjCost; ///< Average reject cost, available after run(). |
| 577 | |
| 578 | CTester() |
| 579 | : RMCacheCount( 0 ) |
| 580 | { |
| 581 | } |
| 582 | |
| 583 | /** |
| 584 | * Function initalizes the tester. Then the addCorpus() function should be |
| 585 | * called at least once. |
| 586 | * |
| 587 | * @param Threshold Objective function value threshold - stop condition. |
| 588 | * @param IterCount The number of attempts to solve a function to perform. |
| 589 | * @param InnerIterCount The maximal number of solver iterations to |
| 590 | * perform. |
| 591 | * @param DoPrint "True" if results should be printed to "stdout". |
| 592 | */ |
| 593 | |
| 594 | void init( const double aThreshold, const int aIterCount, |
| 595 | const int aInnerIterCount, const bool aDoPrint ) |
| 596 | { |
| 597 | CostThreshold = aThreshold; |
| 598 | IterCount = aIterCount; |
| 599 | InnerIterCount = aInnerIterCount; |
| 600 | DoPrint = aDoPrint; |
| 601 | FnCount = 0; |
| 602 | } |
| 603 | |
| 604 | /** |
| 605 | * Function adds a function corpus to the tester. |
| 606 | * |
| 607 | * @param aDefDims The number of dimensions in each function with variable |
| 608 | * number of dimensions. |
| 609 | * @param Corpus NULL-limited list of test functions. |
| 610 | * @param DoRandomize "True" if randomization of parameter shifts and |
| 611 | * rotations should be performed. |
| 612 | * @param DoRandomizeAll "True" if all randomizations should be applied, |
| 613 | * otherwise only shifts and scales will be applied. |
| 614 | */ |
| 615 | |
| 616 | void addCorpus( const int aDefDims, const CTestFn** Corpus, |
| 617 | const bool aDoRandomize, const bool aDoRandomizeAll ) |
| 618 | { |
| 619 | while( FnCount < MaxFuncs ) |
| 620 | { |
| 621 | if( *Corpus == NULL ) |
| 622 | { |
| 623 | break; |
nothing calls this directly
no outgoing calls
no test coverage detected