| 164 | */ |
| 165 | |
| 166 | class CTestOpt : public OPT_CLASS |
| 167 | #if OPT_THREADS |
| 168 | , public CWorkerThread |
| 169 | #endif // OPT_THREADS |
| 170 | { |
| 171 | public: |
| 172 | const CTestFn* fn; ///< Test function. |
| 173 | double CostThreshold; ///< Successful optimization attempt cost threshold. |
| 174 | CSumStats* SumStats; ///< Pointer to summary statistics object. |
| 175 | CFuncStats* FuncStats; ///< Pointer to function's statistics |
| 176 | ///< object. |
| 177 | CBiteRnd rnd; ///< Random number generator. |
| 178 | int Dims; ///< Dimensions in the function. |
| 179 | int MaxIters; ///< Maximal number of iterations per attempt. |
| 180 | int Index; ///< Attempt index. |
| 181 | int* Iters; ///< Pointer to array containing finishing iteration counts |
| 182 | ///< for each attempt. |
| 183 | double* minv; ///< Minimal parameter values. |
| 184 | double* maxv; ///< Maximal parameter values. |
| 185 | double optv; ///< Optimal value. |
| 186 | double* shifts; ///< Shifts to apply to function parameters. |
| 187 | double* signs; ///< Signs or scales to apply to function parameters. |
| 188 | double** rots; ///< Rotation matrix to apply to function parameters, |
| 189 | ///< should be provided externally if DoRandomizeAll == true. |
| 190 | double* tp; ///< Temporary parameter storage. |
| 191 | double* tp2; ///< Temporary parameter storage 2. |
| 192 | bool DoRandomize; ///< Apply value randomization. |
| 193 | bool DoRandomizeAll; ///< Apply all randomizations, "false" only |
| 194 | ///< shift and scale randomizations will be applied. |
| 195 | |
| 196 | #if OPT_STATS |
| 197 | int SumSels[ CBiteOpt :: MaxSelCount ]; ///< Sum of selector choices. |
| 198 | int SumSelIncrs[ CBiteOpt :: MaxSelCount ][ 10 ]; ///< Sum of selector |
| 199 | ///< choice increments. |
| 200 | int SumSelDecrs[ CBiteOpt :: MaxSelCount ][ 10 ]; ///< Sum of selector |
| 201 | ///< choice decrements. |
| 202 | int* Sels[ CBiteOpt :: MaxSelCount ]; ///< Selector choices at each |
| 203 | ///< optimization step. |
| 204 | int SelAlloc; ///< The number of items allocated in each Sels element. |
| 205 | #endif // OPT_STATS |
| 206 | |
| 207 | #if OPT_THREADS && OPT_TIME |
| 208 | double funct; ///< Function evaluation timing. |
| 209 | #endif // OPT_THREADS && OPT_TIME |
| 210 | |
| 211 | CTestOpt() |
| 212 | : Dims( 0 ) |
| 213 | , minv( NULL ) |
| 214 | , maxv( NULL ) |
| 215 | , shifts( NULL ) |
| 216 | , signs( NULL ) |
| 217 | , tp( NULL ) |
| 218 | , tp2( NULL ) |
| 219 | #if OPT_STATS |
| 220 | , SelAlloc( 0 ) |
| 221 | #endif // OPT_STATS |
| 222 | { |
| 223 | #if OPT_STATS |
nothing calls this directly
no outgoing calls
no test coverage detected