... | ... |
@@ -688,22 +688,6 @@ |
688 | 688 |
return real<double>(); |
689 | 689 |
} |
690 | 690 |
|
691 |
/// \brief Returns a random real number the range [0, b) |
|
692 |
/// |
|
693 |
/// It returns a random real number from the range [0, b). |
|
694 |
template <typename Number> |
|
695 |
Number real(Number b) { |
|
696 |
return real<Number>() * b; |
|
697 |
} |
|
698 |
|
|
699 |
/// \brief Returns a random real number from the range [a, b) |
|
700 |
/// |
|
701 |
/// It returns a random real number from the range [a, b). |
|
702 |
template <typename Number> |
|
703 |
Number real(Number a, Number b) { |
|
704 |
return real<Number>() * (b - a) + a; |
|
705 |
} |
|
706 |
|
|
707 | 691 |
/// \brief Returns a random real number from the range [0, 1) |
708 | 692 |
/// |
709 | 693 |
/// It returns a random double from the range [0, 1). |
... | ... |
@@ -714,17 +698,15 @@ |
714 | 698 |
/// \brief Returns a random real number from the range [0, b) |
715 | 699 |
/// |
716 | 700 |
/// It returns a random real number from the range [0, b). |
717 |
template <typename Number> |
|
718 |
Number operator()(Number b) { |
|
719 |
|
|
701 |
double operator()(double b) { |
|
702 |
return real<double>() * b; |
|
720 | 703 |
} |
721 | 704 |
|
722 | 705 |
/// \brief Returns a random real number from the range [a, b) |
723 | 706 |
/// |
724 | 707 |
/// It returns a random real number from the range [a, b). |
725 |
template <typename Number> |
|
726 |
Number operator()(Number a, Number b) { |
|
727 |
|
|
708 |
double operator()(double a, double b) { |
|
709 |
return real<double>() * (b - a) + a; |
|
728 | 710 |
} |
729 | 711 |
|
730 | 712 |
/// \brief Returns a random integer from a range |
0 comments (0 inline)