| 1426 | */ |
| 1427 | |
| 1428 | void generateSol11( CBiteRnd& rnd ) |
| 1429 | { |
| 1430 | ptype* const Params = TmpParams; |
| 1431 | |
| 1432 | const ptype* const rp0 = getParamsOrdered( |
| 1433 | rnd.getInt( CurPopSize )); |
| 1434 | |
| 1435 | const ptype* const rp1 = getParamsOrdered( |
| 1436 | rnd.getPowInt( 4.0, CurPopSize )); |
| 1437 | |
| 1438 | const ptype* const rp2 = getParamsOrdered( |
| 1439 | rnd.getSqrIntInv( CurPopSize )); |
| 1440 | |
| 1441 | double s1 = 1e-300; |
| 1442 | double s2 = 1e-300; |
| 1443 | double d; |
| 1444 | int i; |
| 1445 | |
| 1446 | for( i = 0; i < ParamCount; i++ ) |
| 1447 | { |
| 1448 | d = (double) ( rp1[ i ] - rp2[ i ]); |
| 1449 | s1 += d * d; |
| 1450 | |
| 1451 | NewValues[ i ] = rnd.get() - 0.5; |
| 1452 | s2 += NewValues[ i ] * NewValues[ i ]; |
| 1453 | } |
| 1454 | |
| 1455 | const double m1 = sqrt( ParamCountI ) * 0.5; |
| 1456 | const double m0 = 1.0 - m1; |
| 1457 | d = sqrt( s1 * ParamCountI / s2 ) * 2.0; |
| 1458 | |
| 1459 | for( i = 0; i < ParamCount; i++ ) |
| 1460 | { |
| 1461 | Params[ i ] = (ptype) ( rp0[ i ] * m0 + rp1[ i ] * m1 + |
| 1462 | NewValues[ i ] * d ); |
| 1463 | } |
| 1464 | } |
| 1465 | |
| 1466 | /** |
| 1467 | * Solution generator that estimates population's standard deviation using |
nothing calls this directly
no test coverage detected