Bertini 2 - C++ Core
Software for Numerical Algebraic Geometry
Loading...
Searching...
No Matches
random.hpp File Reference

stuff for generating random numbers More...

#include "bertini2/mpfr_complex.hpp"
#include <boost/random.hpp>
Include dependency graph for random.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

complex bertini::multiprecision::rand ()
 
complex bertini::multiprecision::rand_unit ()
 
template<unsigned long digits = 50>
mpz_int bertini::RandomInt ()
 
template<unsigned int length_in_digits>
mpfr_float bertini::multiprecision::RandomMp ()
 
template<unsigned int length_in_digits>
mpfr_float bertini::RandomMp ()
 
mpfr_float bertini::RandomMp ()
 create a random number, at the current default precision
 
mpfr_float bertini::RandomMp (const mpfr_float &a, const mpfr_float &b)
 create a random number in a given interval, at the current default precision
 
mpfr_float bertini::RandomMp (const mpfr_float &a, const mpfr_float &b, unsigned num_digits)
 create a random number in a given interval, at the specified precision
 
template<unsigned int length_in_digits>
mpfr_float bertini::RandomMp (const mpfr_float &left, const mpfr_float &right)
 
mpfr_float bertini::RandomMp (unsigned num_digits)
 create a random number, at the specified precision
 
template<unsigned int length_in_digits>
void bertini::RandomMpAssign (mpfr_float &a)
 
void bertini::RandomMpAssign (mpfr_float &a, unsigned num_digits)
 Set an existing mpfr_float to a random number, to a given precision.
 
template<unsigned long digits = 50>
mpq_rational bertini::RandomRat ()
 
complex bertini::multiprecision::RandomReal ()
 
complex bertini::multiprecision::RandomReal (unsigned num_digits)
 
void bertini::multiprecision::RandomRealAssign (complex &a, unsigned num_digits)
 

Detailed Description

stuff for generating random numbers

Function Documentation

◆ rand()

complex bertini::multiprecision::rand ( )
inline

Produce a random complex number, to default precision.

◆ rand_unit()

complex bertini::multiprecision::rand_unit ( )
inline

Produce a random unit complex number, to default precision.

◆ RandomInt()

template<unsigned long digits = 50>
mpz_int bertini::RandomInt ( )
inline

Generate a random integer number between -10^digits and 10^digits

◆ RandomMp() [1/7]

template<unsigned int length_in_digits>
mpfr_float bertini::RandomMp ( )

Produce a random number with at length_in_digits non-zero digits.

Template Parameters
length_in_digitsThe length of the desired random number

◆ RandomMp() [2/7]

template<unsigned int length_in_digits>
mpfr_float bertini::RandomMp ( )

Produce a random number with at length_in_digits non-zero digits.

Template Parameters
length_in_digitsThe length of the desired random number

◆ RandomMp() [3/7]

mpfr_float bertini::RandomMp ( )

create a random number, at the current default precision

◆ RandomMp() [4/7]

mpfr_float bertini::RandomMp ( const mpfr_float & a,
const mpfr_float & b )

create a random number in a given interval, at the current default precision

◆ RandomMp() [5/7]

mpfr_float bertini::RandomMp ( const mpfr_float & a,
const mpfr_float & b,
unsigned num_digits )

create a random number in a given interval, at the specified precision

◆ RandomMp() [6/7]

template<unsigned int length_in_digits>
mpfr_float bertini::RandomMp ( const mpfr_float & left,
const mpfr_float & right )

a templated function for producing random numbers in a specified interval, of a given number of digits.

Template Parameters
length_in_digitsThe length of the desired random number
Parameters
aThe left bound.
bThe right bound.

◆ RandomMp() [7/7]

mpfr_float bertini::RandomMp ( unsigned num_digits)

create a random number, at the specified precision

Parameters
num_digitsthe precision that you desire.

◆ RandomMpAssign() [1/2]

template<unsigned int length_in_digits>
void bertini::RandomMpAssign ( mpfr_float & a)

a templated function for producing random numbers in the unit interval, of a given number of digits.

Template Parameters
length_in_digitsThe length of the desired random number
Parameters
athe number which will be assigned in this call

◆ RandomMpAssign() [2/2]

void bertini::RandomMpAssign ( mpfr_float & a,
unsigned num_digits )

Set an existing mpfr_float to a random number, to a given precision.

This function is how to get random numbers at a precision different from the current default.

◆ RandomRat()

template<unsigned long digits = 50>
mpq_rational bertini::RandomRat ( )

Generate a random rational number with numerator and denomenator between -10^digits and 10^digits

◆ RandomReal() [1/2]

complex bertini::multiprecision::RandomReal ( )
inline

Produce a random real number \(\in [-1,\,1]\), to current default precision.

◆ RandomReal() [2/2]

complex bertini::multiprecision::RandomReal ( unsigned num_digits)
inline

Produce a random real number \(\in [-1,\,1]\), to specified precision.

◆ RandomRealAssign()

void bertini::multiprecision::RandomRealAssign ( complex & a,
unsigned num_digits )
inline

Assign to a random real number \(\in [-1,\,1]\), to current default precision.