|
1459 | 1459 | \end{enumeratea}
|
1460 | 1460 |
|
1461 | 1461 |
|
| 1462 | +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1463 | +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1464 | +%% |
| 1465 | +%% Header synopsis subclause |
| 1466 | +%% |
| 1467 | +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1468 | +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1469 | + |
| 1470 | + |
| 1471 | +\rSec2[rand.synopsis]{Header \tcode{<random>} synopsis}% |
| 1472 | +\indexhdr{random} |
| 1473 | +\indextext{random number generation!synopsis|(} |
| 1474 | + |
| 1475 | +\begin{codeblock} |
| 1476 | +#include <initializer_list> |
| 1477 | + |
| 1478 | +namespace std { |
| 1479 | + // \ref{rand.req.urng}, concept UniformRandomBitGenerator |
| 1480 | + template <class G> |
| 1481 | + concept UniformRandomBitGenerator = @\seebelow@; |
| 1482 | + |
| 1483 | + // \ref{rand.eng.lcong}, class template \tcode{linear_congruential_engine} |
| 1484 | + template<class UIntType, UIntType a, UIntType c, UIntType m> |
| 1485 | + class linear_congruential_engine; |
| 1486 | + |
| 1487 | + // \ref{rand.eng.mers}, class template \tcode{mersenne_twister_engine} |
| 1488 | + template<class UIntType, size_t w, size_t n, size_t m, size_t r, |
| 1489 | + UIntType a, size_t u, UIntType d, size_t s, |
| 1490 | + UIntType b, size_t t, |
| 1491 | + UIntType c, size_t l, UIntType f> |
| 1492 | + class mersenne_twister_engine; |
| 1493 | + |
| 1494 | + // \ref{rand.eng.sub}, class template \tcode{subtract_with_carry_engine} |
| 1495 | + template<class UIntType, size_t w, size_t s, size_t r> |
| 1496 | + class subtract_with_carry_engine; |
| 1497 | + |
| 1498 | + // \ref{rand.adapt.disc}, class template \tcode{discard_block_engine} |
| 1499 | + template<class Engine, size_t p, size_t r> |
| 1500 | + class discard_block_engine; |
| 1501 | + |
| 1502 | + // \ref{rand.adapt.ibits}, class template \tcode{independent_bits_engine} |
| 1503 | + template<class Engine, size_t w, class UIntType> |
| 1504 | + class independent_bits_engine; |
| 1505 | + |
| 1506 | + // \ref{rand.adapt.shuf}, class template \tcode{shuffle_order_engine} |
| 1507 | + template<class Engine, size_t k> |
| 1508 | + class shuffle_order_engine; |
| 1509 | + |
| 1510 | + // \ref{rand.predef}, engines and engine adaptors with predefined parameters |
| 1511 | + using minstd_rand0 = @\seebelow@; |
| 1512 | + using minstd_rand = @\seebelow@; |
| 1513 | + using mt19937 = @\seebelow@; |
| 1514 | + using mt19937_64 = @\seebelow@; |
| 1515 | + using ranlux24_base = @\seebelow@; |
| 1516 | + using ranlux48_base = @\seebelow@; |
| 1517 | + using ranlux24 = @\seebelow@; |
| 1518 | + using ranlux48 = @\seebelow@; |
| 1519 | + using knuth_b = @\seebelow@; |
| 1520 | + |
| 1521 | + using default_random_engine = @\seebelow@; |
| 1522 | + |
| 1523 | + // \ref{rand.device}, class \tcode{random_device} |
| 1524 | + class random_device; |
| 1525 | + |
| 1526 | + // \ref{rand.util.seedseq}, class \tcode{seed_seq} |
| 1527 | + class seed_seq; |
| 1528 | + |
| 1529 | + // \ref{rand.util.canonical}, function template \tcode{generate_canonical} |
| 1530 | + template<class RealType, size_t bits, class URBG> |
| 1531 | + RealType generate_canonical(URBG& g); |
| 1532 | + |
| 1533 | + // \ref{rand.dist.uni.int}, class template \tcode{uniform_int_distribution} |
| 1534 | + template<class IntType = int> |
| 1535 | + class uniform_int_distribution; |
| 1536 | + |
| 1537 | + // \ref{rand.dist.uni.real}, class template \tcode{uniform_real_distribution} |
| 1538 | + template<class RealType = double> |
| 1539 | + class uniform_real_distribution; |
| 1540 | + |
| 1541 | + // \ref{rand.dist.bern.bernoulli}, class \tcode{bernoulli_distribution} |
| 1542 | + class bernoulli_distribution; |
| 1543 | + |
| 1544 | + // \ref{rand.dist.bern.bin}, class template \tcode{binomial_distribution} |
| 1545 | + template<class IntType = int> |
| 1546 | + class binomial_distribution; |
| 1547 | + |
| 1548 | + // \ref{rand.dist.bern.geo}, class template \tcode{geometric_distribution} |
| 1549 | + template<class IntType = int> |
| 1550 | + class geometric_distribution; |
| 1551 | + |
| 1552 | + // \ref{rand.dist.bern.negbin}, class template \tcode{negative_binomial_distribution} |
| 1553 | + template<class IntType = int> |
| 1554 | + class negative_binomial_distribution; |
| 1555 | + |
| 1556 | + // \ref{rand.dist.pois.poisson}, class template \tcode{poisson_distribution} |
| 1557 | + template<class IntType = int> |
| 1558 | + class poisson_distribution; |
| 1559 | + |
| 1560 | + // \ref{rand.dist.pois.exp}, class template \tcode{exponential_distribution} |
| 1561 | + template<class RealType = double> |
| 1562 | + class exponential_distribution; |
| 1563 | + |
| 1564 | + // \ref{rand.dist.pois.gamma}, class template \tcode{gamma_distribution} |
| 1565 | + template<class RealType = double> |
| 1566 | + class gamma_distribution; |
| 1567 | + |
| 1568 | + // \ref{rand.dist.pois.weibull}, class template \tcode{weibull_distribution} |
| 1569 | + template<class RealType = double> |
| 1570 | + class weibull_distribution; |
| 1571 | + |
| 1572 | + // \ref{rand.dist.pois.extreme}, class template \tcode{extreme_value_distribution} |
| 1573 | + template<class RealType = double> |
| 1574 | + class extreme_value_distribution; |
| 1575 | + |
| 1576 | + // \ref{rand.dist.norm.normal}, class template \tcode{normal_distribution} |
| 1577 | + template<class RealType = double> |
| 1578 | + class normal_distribution; |
| 1579 | + |
| 1580 | + // \ref{rand.dist.norm.lognormal}, class template \tcode{lognormal_distribution} |
| 1581 | + template<class RealType = double> |
| 1582 | + class lognormal_distribution; |
| 1583 | + |
| 1584 | + // \ref{rand.dist.norm.chisq}, class template \tcode{chi_squared_distribution} |
| 1585 | + template<class RealType = double> |
| 1586 | + class chi_squared_distribution; |
| 1587 | + |
| 1588 | + // \ref{rand.dist.norm.cauchy}, class template \tcode{cauchy_distribution} |
| 1589 | + template<class RealType = double> |
| 1590 | + class cauchy_distribution; |
| 1591 | + |
| 1592 | + // \ref{rand.dist.norm.f}, class template \tcode{fisher_f_distribution} |
| 1593 | + template<class RealType = double> |
| 1594 | + class fisher_f_distribution; |
| 1595 | + |
| 1596 | + // \ref{rand.dist.norm.t}, class template \tcode{student_t_distribution} |
| 1597 | + template<class RealType = double> |
| 1598 | + class student_t_distribution; |
| 1599 | + |
| 1600 | + // \ref{rand.dist.samp.discrete}, class template \tcode{discrete_distribution} |
| 1601 | + template<class IntType = int> |
| 1602 | + class discrete_distribution; |
| 1603 | + |
| 1604 | + // \ref{rand.dist.samp.pconst}, class template \tcode{piecewise_constant_distribution} |
| 1605 | + template<class RealType = double> |
| 1606 | + class piecewise_constant_distribution; |
| 1607 | + |
| 1608 | + // \ref{rand.dist.samp.plinear}, class template \tcode{piecewise_linear_distribution} |
| 1609 | + template<class RealType = double> |
| 1610 | + class piecewise_linear_distribution; |
| 1611 | +} |
| 1612 | +\end{codeblock}% |
| 1613 | +\indextext{random number generation!synopsis|)}% |
| 1614 | + |
| 1615 | + |
1462 | 1616 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
1463 | 1617 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
1464 | 1618 | %%
|
|
2518 | 2672 | \indextext{random number generation!requirements|)}
|
2519 | 2673 |
|
2520 | 2674 |
|
2521 |
| -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
2522 |
| -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
2523 |
| -%% |
2524 |
| -%% Header synopsis subclause |
2525 |
| -%% |
2526 |
| -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
2527 |
| -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
2528 |
| - |
2529 |
| - |
2530 |
| -\rSec2[rand.synopsis]{Header \tcode{<random>} synopsis}% |
2531 |
| -\indexhdr{random} |
2532 |
| -\indextext{random number generation!synopsis|(} |
2533 |
| - |
2534 |
| -\begin{codeblock} |
2535 |
| -#include <initializer_list> |
2536 |
| - |
2537 |
| -namespace std { |
2538 |
| - // \ref{rand.req.urng}, concept UniformRandomBitGenerator |
2539 |
| - template <class G> |
2540 |
| - concept UniformRandomBitGenerator = @\seebelow@; |
2541 |
| - |
2542 |
| - // \ref{rand.eng.lcong}, class template \tcode{linear_congruential_engine} |
2543 |
| - template<class UIntType, UIntType a, UIntType c, UIntType m> |
2544 |
| - class linear_congruential_engine; |
2545 |
| - |
2546 |
| - // \ref{rand.eng.mers}, class template \tcode{mersenne_twister_engine} |
2547 |
| - template<class UIntType, size_t w, size_t n, size_t m, size_t r, |
2548 |
| - UIntType a, size_t u, UIntType d, size_t s, |
2549 |
| - UIntType b, size_t t, |
2550 |
| - UIntType c, size_t l, UIntType f> |
2551 |
| - class mersenne_twister_engine; |
2552 |
| - |
2553 |
| - // \ref{rand.eng.sub}, class template \tcode{subtract_with_carry_engine} |
2554 |
| - template<class UIntType, size_t w, size_t s, size_t r> |
2555 |
| - class subtract_with_carry_engine; |
2556 |
| - |
2557 |
| - // \ref{rand.adapt.disc}, class template \tcode{discard_block_engine} |
2558 |
| - template<class Engine, size_t p, size_t r> |
2559 |
| - class discard_block_engine; |
2560 |
| - |
2561 |
| - // \ref{rand.adapt.ibits}, class template \tcode{independent_bits_engine} |
2562 |
| - template<class Engine, size_t w, class UIntType> |
2563 |
| - class independent_bits_engine; |
2564 |
| - |
2565 |
| - // \ref{rand.adapt.shuf}, class template \tcode{shuffle_order_engine} |
2566 |
| - template<class Engine, size_t k> |
2567 |
| - class shuffle_order_engine; |
2568 |
| - |
2569 |
| - // \ref{rand.predef}, engines and engine adaptors with predefined parameters |
2570 |
| - using minstd_rand0 = @\seebelow@; |
2571 |
| - using minstd_rand = @\seebelow@; |
2572 |
| - using mt19937 = @\seebelow@; |
2573 |
| - using mt19937_64 = @\seebelow@; |
2574 |
| - using ranlux24_base = @\seebelow@; |
2575 |
| - using ranlux48_base = @\seebelow@; |
2576 |
| - using ranlux24 = @\seebelow@; |
2577 |
| - using ranlux48 = @\seebelow@; |
2578 |
| - using knuth_b = @\seebelow@; |
2579 |
| - |
2580 |
| - using default_random_engine = @\seebelow@; |
2581 |
| - |
2582 |
| - // \ref{rand.device}, class \tcode{random_device} |
2583 |
| - class random_device; |
2584 |
| - |
2585 |
| - // \ref{rand.util.seedseq}, class \tcode{seed_seq} |
2586 |
| - class seed_seq; |
2587 |
| - |
2588 |
| - // \ref{rand.util.canonical}, function template \tcode{generate_canonical} |
2589 |
| - template<class RealType, size_t bits, class URBG> |
2590 |
| - RealType generate_canonical(URBG& g); |
2591 |
| - |
2592 |
| - // \ref{rand.dist.uni.int}, class template \tcode{uniform_int_distribution} |
2593 |
| - template<class IntType = int> |
2594 |
| - class uniform_int_distribution; |
2595 |
| - |
2596 |
| - // \ref{rand.dist.uni.real}, class template \tcode{uniform_real_distribution} |
2597 |
| - template<class RealType = double> |
2598 |
| - class uniform_real_distribution; |
2599 |
| - |
2600 |
| - // \ref{rand.dist.bern.bernoulli}, class \tcode{bernoulli_distribution} |
2601 |
| - class bernoulli_distribution; |
2602 |
| - |
2603 |
| - // \ref{rand.dist.bern.bin}, class template \tcode{binomial_distribution} |
2604 |
| - template<class IntType = int> |
2605 |
| - class binomial_distribution; |
2606 |
| - |
2607 |
| - // \ref{rand.dist.bern.geo}, class template \tcode{geometric_distribution} |
2608 |
| - template<class IntType = int> |
2609 |
| - class geometric_distribution; |
2610 |
| - |
2611 |
| - // \ref{rand.dist.bern.negbin}, class template \tcode{negative_binomial_distribution} |
2612 |
| - template<class IntType = int> |
2613 |
| - class negative_binomial_distribution; |
2614 |
| - |
2615 |
| - // \ref{rand.dist.pois.poisson}, class template \tcode{poisson_distribution} |
2616 |
| - template<class IntType = int> |
2617 |
| - class poisson_distribution; |
2618 |
| - |
2619 |
| - // \ref{rand.dist.pois.exp}, class template \tcode{exponential_distribution} |
2620 |
| - template<class RealType = double> |
2621 |
| - class exponential_distribution; |
2622 |
| - |
2623 |
| - // \ref{rand.dist.pois.gamma}, class template \tcode{gamma_distribution} |
2624 |
| - template<class RealType = double> |
2625 |
| - class gamma_distribution; |
2626 |
| - |
2627 |
| - // \ref{rand.dist.pois.weibull}, class template \tcode{weibull_distribution} |
2628 |
| - template<class RealType = double> |
2629 |
| - class weibull_distribution; |
2630 |
| - |
2631 |
| - // \ref{rand.dist.pois.extreme}, class template \tcode{extreme_value_distribution} |
2632 |
| - template<class RealType = double> |
2633 |
| - class extreme_value_distribution; |
2634 |
| - |
2635 |
| - // \ref{rand.dist.norm.normal}, class template \tcode{normal_distribution} |
2636 |
| - template<class RealType = double> |
2637 |
| - class normal_distribution; |
2638 |
| - |
2639 |
| - // \ref{rand.dist.norm.lognormal}, class template \tcode{lognormal_distribution} |
2640 |
| - template<class RealType = double> |
2641 |
| - class lognormal_distribution; |
2642 |
| - |
2643 |
| - // \ref{rand.dist.norm.chisq}, class template \tcode{chi_squared_distribution} |
2644 |
| - template<class RealType = double> |
2645 |
| - class chi_squared_distribution; |
2646 |
| - |
2647 |
| - // \ref{rand.dist.norm.cauchy}, class template \tcode{cauchy_distribution} |
2648 |
| - template<class RealType = double> |
2649 |
| - class cauchy_distribution; |
2650 |
| - |
2651 |
| - // \ref{rand.dist.norm.f}, class template \tcode{fisher_f_distribution} |
2652 |
| - template<class RealType = double> |
2653 |
| - class fisher_f_distribution; |
2654 |
| - |
2655 |
| - // \ref{rand.dist.norm.t}, class template \tcode{student_t_distribution} |
2656 |
| - template<class RealType = double> |
2657 |
| - class student_t_distribution; |
2658 |
| - |
2659 |
| - // \ref{rand.dist.samp.discrete}, class template \tcode{discrete_distribution} |
2660 |
| - template<class IntType = int> |
2661 |
| - class discrete_distribution; |
2662 |
| - |
2663 |
| - // \ref{rand.dist.samp.pconst}, class template \tcode{piecewise_constant_distribution} |
2664 |
| - template<class RealType = double> |
2665 |
| - class piecewise_constant_distribution; |
2666 |
| - |
2667 |
| - // \ref{rand.dist.samp.plinear}, class template \tcode{piecewise_linear_distribution} |
2668 |
| - template<class RealType = double> |
2669 |
| - class piecewise_linear_distribution; |
2670 |
| -} |
2671 |
| -\end{codeblock}% |
2672 |
| -\indextext{random number generation!synopsis|)}% |
2673 |
| - |
2674 |
| - |
2675 | 2675 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
2676 | 2676 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
2677 | 2677 | %%
|
|
0 commit comments