Contains a large set of operations for calculations with the mpf_t data type. More...
Functions | |
mpf_t * | Abs (const mpf_t *x) |
Calculates the absolute value of the supplied value. More... | |
mpf_t * | Add (const mpf_t *a, const mpf_t *b) |
Performs an addition of the two values. More... | |
mpf_t * | Arccos (mpf_t *x) |
Calculates the arccosine function of the supplied value. More... | |
mpf_t * | Arcsin (mpf_t *x) |
Calculates the arcsine function of the supplied value. More... | |
mpf_t * | Arctan (mpf_t *x) |
Calculates the arctangent function of the supplied value. More... | |
mpf_t * | Ceil (mpf_t *value) |
Calculates the smallest integral value greater or equal than the supplied value. More... | |
void | ChangeNumberOfMpftValuesCached (int change) |
Changes the number of mpf_t values currently in cache by the specified number. More... | |
mpf_t * | Clone (const mpf_t *value) |
Creates a copy of the supplied value. More... | |
int | Compare (const mpf_t *a, const mpf_t *b) |
Compares the two parameters. More... | |
int | Compare (const double a, const mpf_t *b) |
Compares the two parameters. More... | |
int | Compare (const mpf_t *a, double b) |
Compares the two parameters. More... | |
mpf_t * | Cos (mpf_t *x) |
Calculates the cosine function of the supplied value. More... | |
mpf_t * | Divide (const mpf_t *a, const mpf_t *b) |
Performs a division of the two values. More... | |
mpf_t * | Exp (mpf_t *a) |
Calculates the exponential function of the input. More... | |
mpf_t * | Floor (mpf_t *value) |
Calculates the largest integral value less or equal than the supplied value. More... | |
mpf_t * | GetE () |
Calculates the value of E. More... | |
mpf_t * | GetGaussianRandomMpft (double mu, double sigma, RandomNumberGenerator *random) |
Calculates a random value with normal distribution (gaussian distribution). More... | |
mpf_t * | GetGaussianRandomMpft (double mu, double sigma) |
Calculates a random value with normal distribution (gaussian distribution). More... | |
mpf_t * | GetMinusInfinity () |
Calculates the representation of -infinity. More... | |
int | GetNumberOfMpftValuesCached () |
Getter function for the number of mpf_t values which are currently cached. More... | |
int | GetNumberOfMpftValuesInUse () |
Getter function for the number of mpf_t values which are currently in use. More... | |
mpf_t * | GetPi () |
Calculates the value of Pi. More... | |
mpf_t * | GetPlusInfinity () |
Calculates the representation of +infinity. More... | |
mpf_t * | GetRandomMpft (RandomNumberGenerator *random) |
Calculates a random mpf_t value in the range [0,1] with the supplied random number generator. More... | |
mpf_t * | GetRandomMpft () |
Calculates a random mpf_t value in the range [0,1] with the specified standard random number generator for this execution. More... | |
mpf_t * | GetResultPointer () |
Prepares an mpf_t value for using it. More... | |
mpf_t * | GetUndefined () |
Calculates the representation of an undefined value. More... | |
void | IncreasePrecision () |
Increases the precision instantly to a higher value. More... | |
bool | IsInfinite (const mpf_t *value) |
Checks whether the supplied value is the representation of +infinity or -infinity. More... | |
bool | IsMinusInfinity (const mpf_t *value) |
Checks whether the supplied value is the representation of -infinity. More... | |
bool | IsPlusInfinity (const mpf_t *value) |
Checks whether the supplied value is the representation of +infinity. More... | |
bool | IsUndefined (const mpf_t *value) |
Checks whether the supplied value is the representation of an undefined value. More... | |
mpf_t * | LoadMpft (std::ifstream *stream) |
Recovers a mpf_t value from an input stream. More... | |
double | Log2Double (mpf_t *value) |
Calculates the base 2 logarithm of the specified value. More... | |
mpf_t * | LogE (mpf_t *value) |
Calculates the base E logarithm of the specified value. More... | |
mpf_t * | Max (mpf_t *a, mpf_t *b) |
Calculates the maximum of the two values. More... | |
mpf_t * | Min (mpf_t *a, mpf_t *b) |
Calculates the minimum of the two values. More... | |
double | MpftToDouble (mpf_t *value) |
Converts an mpf_t value to a double value. More... | |
std::string | MpftToString (const mpf_t *value) |
Converts an mpf_t value to a string representation of it. More... | |
mpf_t * | Multiply (const mpf_t *a, const mpf_t *b) |
Performs a multiplication of the two values. More... | |
mpf_t * | Multiply (const mpf_t *a, const double b) |
Performs a multiplication of the two values. More... | |
mpf_t * | Multiply2Exp (const mpf_t *a, int p) |
Multiplies the value of parameter a by a factor of 2p. More... | |
mpf_t * | Negate (const mpf_t *x) |
Calculates the negation of the supplied value. More... | |
mpf_t * | Pow (mpf_t *value, int exponent) |
Calculates the value to the power of the specified exponent. More... | |
mpf_t * | Pow (mpf_t *value, double exponent) |
Calculates the value to the power of the specified exponent. More... | |
mpf_t * | Pow (mpf_t *value, mpf_t *exponent) |
Calculates the value to the power of the specified exponent. More... | |
mpf_t * | Randomize (mpf_t *value) |
Multiplies the supplied value by a random value in the interval [0,1]. More... | |
mpf_t * | Randomize (mpf_t *value, RandomNumberGenerator *random) |
Multiplies the supplied value by a random value in the interval [0,1]. More... | |
void | ReleaseValue (mpf_t *a) |
Releases the reserved memory for the supplied mpf_t. More... | |
mpf_t * | Sin (mpf_t *x) |
Calculates the sine function of the supplied value. More... | |
mpf_t * | Sqrt (mpf_t *value) |
Calculates the square root of the specified value. More... | |
void | StatisticalCalculationsEnd () |
Signals the end of statistical calculations. More... | |
void | StatisticalCalculationsStart () |
Signals the start of statistical calculations. More... | |
void | StoreMpft (mpf_t *value, std::ofstream *stream) |
Writes the content of a mpf_t value to the given stream such that it can completely recovered. More... | |
mpf_t * | Subtract (const mpf_t *a, const mpf_t *b) |
Performs a subtraction of the two values. More... | |
mpf_t * | Tan (mpf_t *x) |
Calculates the tangent function of the supplied value. More... | |
mpf_t * | ToMpft (double value) |
Converts the supplied double value to its mpf_t representation. More... | |
mpf_t * | ToMpft (long long value) |
Converts the supplied long long value to its mpf_t representation. More... | |
mpf_t * | ToMpft (unsigned long long value) |
Converts the supplied unsigned long long value to its mpf_t representation. More... | |
mpf_t * | ToMpft (int value) |
Converts the supplied int value to its mpf_t representation. More... | |
mpf_t * | ToMpft (unsigned int value) |
Converts the supplied unsigned int value to its mpf_t representation. More... | |
Detailed Description
Contains a large set of operations for calculations with the mpf_t data type.
Function Documentation
mpf_t* arbitraryprecisioncalculation::mpftoperations::Abs | ( | const mpf_t * | x | ) |
Calculates the absolute value of the supplied value.
- Parameters
-
x The supplied value.
- Returns
- abs( x )
mpf_t* arbitraryprecisioncalculation::mpftoperations::Add | ( | const mpf_t * | a, |
const mpf_t * | b | ||
) |
Performs an addition of the two values.
- Parameters
-
a The first value. b The second value.
- Returns
- a + b
mpf_t* arbitraryprecisioncalculation::mpftoperations::Arccos | ( | mpf_t * | x | ) |
Calculates the arccosine function of the supplied value.
- Parameters
-
x The supplied value.
- Returns
- arccos( x )
mpf_t* arbitraryprecisioncalculation::mpftoperations::Arcsin | ( | mpf_t * | x | ) |
Calculates the arcsine function of the supplied value.
- Parameters
-
x The supplied value.
- Returns
- arcsin( x )
mpf_t* arbitraryprecisioncalculation::mpftoperations::Arctan | ( | mpf_t * | x | ) |
Calculates the arctangent function of the supplied value.
- Parameters
-
x The supplied value.
- Returns
- arctan( x )
mpf_t* arbitraryprecisioncalculation::mpftoperations::Ceil | ( | mpf_t * | value | ) |
Calculates the smallest integral value greater or equal than the supplied value.
The supplied value will be rounded up to the next integral value.
- Parameters
-
value The supplied value.
- Returns
- The rounded value.
void arbitraryprecisioncalculation::mpftoperations::ChangeNumberOfMpftValuesCached | ( | int | change | ) |
Changes the number of mpf_t values currently in cache by the specified number.
If any class stores values for later usage then this needs to be announced here. Otherwise an error may occur. If the parameter is negative the number of mpf_t in cache decreases. If the parameter is positive the number of mpf_t in cache increases.
- Parameters
-
change The change of the number of mpf_t in cache.
mpf_t* arbitraryprecisioncalculation::mpftoperations::Clone | ( | const mpf_t * | value | ) |
Creates a copy of the supplied value.
The result value can be stored for later use.
- Parameters
-
value The supplied value.
- Returns
- A clone of the supplied value.
int arbitraryprecisioncalculation::mpftoperations::Compare | ( | const mpf_t * | a, |
const mpf_t * | b | ||
) |
Compares the two parameters.
- Parameters
-
a The first parameter. b The second parameter.
- Return values
-
< 0 if the first parameter is less than the second parameter. 0 if the two parameters are equal. > 0 if the first parameter is greater than the second parameter.
int arbitraryprecisioncalculation::mpftoperations::Compare | ( | const double | a, |
const mpf_t * | b | ||
) |
Compares the two parameters.
- Parameters
-
a The first parameter. b The second parameter.
- Return values
-
< 0 if the first parameter is less than the second parameter. 0 if the two parameters are equal. > 0 if the first parameter is greater than the second parameter.
int arbitraryprecisioncalculation::mpftoperations::Compare | ( | const mpf_t * | a, |
double | b | ||
) |
Compares the two parameters.
- Parameters
-
a The first parameter. b The second parameter.
- Return values
-
< 0 if the first parameter is less than the second parameter. 0 if the two parameters are equal. > 0 if the first parameter is greater than the second parameter.
mpf_t* arbitraryprecisioncalculation::mpftoperations::Cos | ( | mpf_t * | x | ) |
Calculates the cosine function of the supplied value.
- Parameters
-
x The supplied value.
- Returns
- cos( x )
mpf_t* arbitraryprecisioncalculation::mpftoperations::Divide | ( | const mpf_t * | a, |
const mpf_t * | b | ||
) |
Performs a division of the two values.
- Parameters
-
a The first value. b The second value.
- Returns
- a / b
mpf_t* arbitraryprecisioncalculation::mpftoperations::Exp | ( | mpf_t * | a | ) |
Calculates the exponential function of the input.
- Parameters
-
a The input.
- Returns
- exp( a )
mpf_t* arbitraryprecisioncalculation::mpftoperations::Floor | ( | mpf_t * | value | ) |
Calculates the largest integral value less or equal than the supplied value.
The supplied value will be rounded down to the next integral value.
- Parameters
-
value The supplied value.
- Returns
- The rounded value.
mpf_t* arbitraryprecisioncalculation::mpftoperations::GetE | ( | ) |
Calculates the value of E.
- Returns
- E.
mpf_t* arbitraryprecisioncalculation::mpftoperations::GetGaussianRandomMpft | ( | double | mu, |
double | sigma, | ||
RandomNumberGenerator * | random | ||
) |
Calculates a random value with normal distribution (gaussian distribution).
- Parameters
-
mu The expectation of the normal distribution. sigma The standard deviation of the normal distribution (this is the square root of the variance). random The random number generator.
- Returns
- The calculated random number.
mpf_t* arbitraryprecisioncalculation::mpftoperations::GetGaussianRandomMpft | ( | double | mu, |
double | sigma | ||
) |
Calculates a random value with normal distribution (gaussian distribution).
- Parameters
-
mu The expectation of the normal distribution. sigma The standard deviation of the normal distribution (this is the square root of the variance).
- Returns
- The calculated random number.
mpf_t* arbitraryprecisioncalculation::mpftoperations::GetMinusInfinity | ( | ) |
Calculates the representation of -infinity.
- Returns
- -infinity.
int arbitraryprecisioncalculation::mpftoperations::GetNumberOfMpftValuesCached | ( | ) |
Getter function for the number of mpf_t values which are currently cached.
- Returns
- The number of mpf_t values in cache.
int arbitraryprecisioncalculation::mpftoperations::GetNumberOfMpftValuesInUse | ( | ) |
Getter function for the number of mpf_t values which are currently in use.
- Returns
- The number of mpf_t values in use.
mpf_t* arbitraryprecisioncalculation::mpftoperations::GetPi | ( | ) |
Calculates the value of Pi.
- Returns
- Pi.
mpf_t* arbitraryprecisioncalculation::mpftoperations::GetPlusInfinity | ( | ) |
Calculates the representation of +infinity.
- Returns
- +infinity.
mpf_t* arbitraryprecisioncalculation::mpftoperations::GetRandomMpft | ( | RandomNumberGenerator * | random | ) |
Calculates a random mpf_t value in the range [0,1] with the supplied random number generator.
- Parameters
-
random The random number generator.
- Returns
- The calculated random number.
mpf_t* arbitraryprecisioncalculation::mpftoperations::GetRandomMpft | ( | ) |
Calculates a random mpf_t value in the range [0,1] with the specified standard random number generator for this execution.
- Returns
- The calculated random number.
mpf_t* arbitraryprecisioncalculation::mpftoperations::GetResultPointer | ( | ) |
Prepares an mpf_t value for using it.
- Returns
- The pointer to the prepared mpf_t.
mpf_t* arbitraryprecisioncalculation::mpftoperations::GetUndefined | ( | ) |
Calculates the representation of an undefined value.
- Returns
- The representation of an undefined value.
void arbitraryprecisioncalculation::mpftoperations::IncreasePrecision | ( | ) |
Increases the precision instantly to a higher value.
bool arbitraryprecisioncalculation::mpftoperations::IsInfinite | ( | const mpf_t * | value | ) |
Checks whether the supplied value is the representation of +infinity or -infinity.
- Parameters
-
value The supplied value.
- Return values
-
true If the supplied value is a representation of +infinity or -infinity. false otherwise.
bool arbitraryprecisioncalculation::mpftoperations::IsMinusInfinity | ( | const mpf_t * | value | ) |
Checks whether the supplied value is the representation of -infinity.
- Parameters
-
value The supplied value.
- Return values
-
true If the supplied value is a representation of -infinity. false otherwise.
bool arbitraryprecisioncalculation::mpftoperations::IsPlusInfinity | ( | const mpf_t * | value | ) |
Checks whether the supplied value is the representation of +infinity.
- Parameters
-
value The supplied value.
- Return values
-
true If the supplied value is a representation of +infinity. false otherwise.
bool arbitraryprecisioncalculation::mpftoperations::IsUndefined | ( | const mpf_t * | value | ) |
Checks whether the supplied value is the representation of an undefined value.
- Parameters
-
value The supplied value.
- Return values
-
true If the supplied value is a representation of undefined value. false otherwise.
mpf_t* arbitraryprecisioncalculation::mpftoperations::LoadMpft | ( | std::ifstream * | stream | ) |
Recovers a mpf_t value from an input stream.
- Parameters
-
stream The stream.
- Returns
- The recovered value.
double arbitraryprecisioncalculation::mpftoperations::Log2Double | ( | mpf_t * | value | ) |
Calculates the base 2 logarithm of the specified value.
- Parameters
-
value The value.
- Returns
- The base 2 logarithm of the specified value.
mpf_t* arbitraryprecisioncalculation::mpftoperations::LogE | ( | mpf_t * | value | ) |
Calculates the base E logarithm of the specified value.
- Parameters
-
value The value.
- Returns
- The base E logarithm of the specified value.
mpf_t* arbitraryprecisioncalculation::mpftoperations::Max | ( | mpf_t * | a, |
mpf_t * | b | ||
) |
Calculates the maximum of the two values.
- Parameters
-
a The first value. b The second value.
- Returns
- max ( a , b )
mpf_t* arbitraryprecisioncalculation::mpftoperations::Min | ( | mpf_t * | a, |
mpf_t * | b | ||
) |
Calculates the minimum of the two values.
- Parameters
-
a The first value. b The second value.
- Returns
- min ( a , b )
double arbitraryprecisioncalculation::mpftoperations::MpftToDouble | ( | mpf_t * | value | ) |
Converts an mpf_t value to a double value.
- Parameters
-
value The mpf_t value.
- Returns
- The converted value.
std::string arbitraryprecisioncalculation::mpftoperations::MpftToString | ( | const mpf_t * | value | ) |
Converts an mpf_t value to a string representation of it.
- Parameters
-
value The value which should be converted.
- Returns
- The string representation.
mpf_t* arbitraryprecisioncalculation::mpftoperations::Multiply | ( | const mpf_t * | a, |
const mpf_t * | b | ||
) |
Performs a multiplication of the two values.
- Parameters
-
a The first value. b The second value.
- Returns
- a · b.
mpf_t* arbitraryprecisioncalculation::mpftoperations::Multiply | ( | const mpf_t * | a, |
const double | b | ||
) |
Performs a multiplication of the two values.
- Parameters
-
a The first value. b The second value.
- Returns
- a · b.
mpf_t* arbitraryprecisioncalculation::mpftoperations::Multiply2Exp | ( | const mpf_t * | a, |
int | p | ||
) |
Multiplies the value of parameter a by a factor of 2p.
- Parameters
-
a The factor. p The exponent.
- Returns
- a · 2p.
mpf_t* arbitraryprecisioncalculation::mpftoperations::Negate | ( | const mpf_t * | x | ) |
Calculates the negation of the supplied value.
- Parameters
-
x The supplied value.
- Returns
- -x
mpf_t* arbitraryprecisioncalculation::mpftoperations::Pow | ( | mpf_t * | value, |
int | exponent | ||
) |
Calculates the value to the power of the specified exponent.
- Parameters
-
value The value. exponent The exponent.
- Returns
- value to the power of exponent.
mpf_t* arbitraryprecisioncalculation::mpftoperations::Pow | ( | mpf_t * | value, |
double | exponent | ||
) |
Calculates the value to the power of the specified exponent.
- Parameters
-
value The value. exponent The exponent.
- Returns
- value to the power of exponent.
mpf_t* arbitraryprecisioncalculation::mpftoperations::Pow | ( | mpf_t * | value, |
mpf_t * | exponent | ||
) |
Calculates the value to the power of the specified exponent.
- Parameters
-
value The value. exponent The exponent.
- Returns
- value to the power of exponent.
mpf_t* arbitraryprecisioncalculation::mpftoperations::Randomize | ( | mpf_t * | value | ) |
Multiplies the supplied value by a random value in the interval [0,1].
- Parameters
-
value The supplied value.
- Returns
- The result of the multiplication.
mpf_t* arbitraryprecisioncalculation::mpftoperations::Randomize | ( | mpf_t * | value, |
RandomNumberGenerator * | random | ||
) |
Multiplies the supplied value by a random value in the interval [0,1].
- Parameters
-
value The supplied value. random The used random number generator.
- Returns
- The result of the multiplication.
void arbitraryprecisioncalculation::mpftoperations::ReleaseValue | ( | mpf_t * | a | ) |
Releases the reserved memory for the supplied mpf_t.
The supplied mpf_t object will be reused soon.
- Parameters
-
a The supplied mpf_t.
mpf_t* arbitraryprecisioncalculation::mpftoperations::Sin | ( | mpf_t * | x | ) |
Calculates the sine function of the supplied value.
- Parameters
-
x The supplied value.
- Returns
- sin( x )
mpf_t* arbitraryprecisioncalculation::mpftoperations::Sqrt | ( | mpf_t * | value | ) |
Calculates the square root of the specified value.
- Parameters
-
value The value
- Returns
- The square root of the specified value.
void arbitraryprecisioncalculation::mpftoperations::StatisticalCalculationsEnd | ( | ) |
Signals the end of statistical calculations.
If currently statistical calculations are running then (if specified) the check whether the precision needs to be increased is not executed.
void arbitraryprecisioncalculation::mpftoperations::StatisticalCalculationsStart | ( | ) |
Signals the start of statistical calculations.
If currently statistical calculations are running then (if specified) the check whether the precision needs to be increased is not executed.
void arbitraryprecisioncalculation::mpftoperations::StoreMpft | ( | mpf_t * | value, |
std::ofstream * | stream | ||
) |
Writes the content of a mpf_t value to the given stream such that it can completely recovered.
- Parameters
-
value The mpf_t value. stream The stream.
mpf_t* arbitraryprecisioncalculation::mpftoperations::Subtract | ( | const mpf_t * | a, |
const mpf_t * | b | ||
) |
Performs a subtraction of the two values.
- Parameters
-
a The first value. b The second value.
- Returns
- a - b
mpf_t* arbitraryprecisioncalculation::mpftoperations::Tan | ( | mpf_t * | x | ) |
Calculates the tangent function of the supplied value.
- Parameters
-
x The supplied value.
- Returns
- tan( x )
mpf_t* arbitraryprecisioncalculation::mpftoperations::ToMpft | ( | double | value | ) |
Converts the supplied double value to its mpf_t representation.
- Parameters
-
value The supplied value.
- Returns
- The mpf_t representation of the supplied value.
mpf_t* arbitraryprecisioncalculation::mpftoperations::ToMpft | ( | long long | value | ) |
Converts the supplied long long value to its mpf_t representation.
- Parameters
-
value The supplied value.
- Returns
- The mpf_t representation of the supplied value.
mpf_t* arbitraryprecisioncalculation::mpftoperations::ToMpft | ( | unsigned long long | value | ) |
Converts the supplied unsigned long long value to its mpf_t representation.
- Parameters
-
value The supplied value.
- Returns
- The mpf_t representation of the supplied value.
mpf_t* arbitraryprecisioncalculation::mpftoperations::ToMpft | ( | int | value | ) |
Converts the supplied int value to its mpf_t representation.
- Parameters
-
value The supplied value.
- Returns
- The mpf_t representation of the supplied value.
mpf_t* arbitraryprecisioncalculation::mpftoperations::ToMpft | ( | unsigned int | value | ) |
Converts the supplied unsigned int value to its mpf_t representation.
- Parameters
-
value The supplied value.
- Returns
- The mpf_t representation of the supplied value.