524 |
524 |
525 double real() { |
525 double real() { |
526 return real<double>(); |
526 return real<double>(); |
527 } |
527 } |
528 |
528 |
529 /// \brief Returns a random real number |
529 /// \brief Returns a random real number the range [0, b) |
530 /// |
530 /// |
531 /// It returns a random real number from the range [0, b). |
531 /// It returns a random real number from the range [0, b). |
532 template <typename Number> |
532 template <typename Number> |
533 Number real(Number b) { |
533 Number real(Number b) { |
534 return real<Number>() * b; |
534 return real<Number>() * b; |
535 } |
535 } |
536 |
536 |
537 /// \brief Returns a random real number |
537 /// \brief Returns a random real number from the range [a, b) |
538 /// |
538 /// |
539 /// It returns a random real number from the range [a, b). |
539 /// It returns a random real number from the range [a, b). |
540 template <typename Number> |
540 template <typename Number> |
541 Number real(Number a, Number b) { |
541 Number real(Number a, Number b) { |
542 return real<Number>() * (b - a) + a; |
542 return real<Number>() * (b - a) + a; |
543 } |
543 } |
544 |
544 |
545 /// \brief Returns a random real number |
545 /// \brief Returns a random real number from the range [0, 1) |
546 /// |
546 /// |
547 /// It returns a random double from the range [0, 1). |
547 /// It returns a random double from the range [0, 1). |
548 double operator()() { |
548 double operator()() { |
549 return real<double>(); |
549 return real<double>(); |
550 } |
550 } |
551 |
551 |
552 /// \brief Returns a random real number |
552 /// \brief Returns a random real number from the range [0, b) |
553 /// |
553 /// |
554 /// It returns a random real number from the range [0, b). |
554 /// It returns a random real number from the range [0, b). |
555 template <typename Number> |
555 template <typename Number> |
556 Number operator()(Number b) { |
556 Number operator()(Number b) { |
557 return real<Number>() * b; |
557 return real<Number>() * b; |
558 } |
558 } |
559 |
559 |
560 /// \brief Returns a random real number |
560 /// \brief Returns a random real number from the range [a, b) |
561 /// |
561 /// |
562 /// It returns a random real number from the range [a, b). |
562 /// It returns a random real number from the range [a, b). |
563 template <typename Number> |
563 template <typename Number> |
564 Number operator()(Number a, Number b) { |
564 Number operator()(Number a, Number b) { |
565 return real<Number>() * (b - a) + a; |
565 return real<Number>() * (b - a) + a; |