| 95 | */ |
| 96 | |
| 97 | void init( CBiteRnd& rnd, const double* const InitParams = NULL, |
| 98 | const double InitRadius = 1.0 ) |
| 99 | { |
| 100 | initCommonVars( rnd ); |
| 101 | |
| 102 | double* const xx = x[ 0 ]; |
| 103 | int i; |
| 104 | int j; |
| 105 | |
| 106 | if( InitParams != NULL ) |
| 107 | { |
| 108 | copyParams( xx, InitParams ); |
| 109 | } |
| 110 | else |
| 111 | { |
| 112 | for( i = 0; i < N; i++ ) |
| 113 | { |
| 114 | xx[ i ] = MinValues[ i ] + DiffValues[ i ] * 0.5; |
| 115 | } |
| 116 | } |
| 117 | |
| 118 | xlo = 0; |
| 119 | |
| 120 | const double sd = 0.25 * InitRadius; |
| 121 | |
| 122 | for( j = 1; j < M; j++ ) |
| 123 | { |
| 124 | double* const xj = x[ j ]; |
| 125 | |
| 126 | for( i = 0; i < N; i++ ) |
| 127 | { |
| 128 | xj[ i ] = xx[ i ] + DiffValues[ i ] * rnd.getGaussian() * sd; |
| 129 | } |
| 130 | } |
| 131 | |
| 132 | State = stReflection; |
| 133 | } |
| 134 | |
| 135 | /** |
| 136 | * Function performs the parameter optimization iteration that involves 1 |
nothing calls this directly
no test coverage detected