Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

mp Namespace Reference

Container for all of the library. More...


Classes

union  ieee_double_extract
 Structure to extract bits from the IEEE double type. More...
class  mpf_
 Third level core class that provides floating point numbers to the MP++ library. More...
class  mpf
 User class that provides an interface to use floating point numbers with the MP++ library. More...
class  mpi_
 Second level core class that provides signed integers to the MP++ library. More...
class  mpi
 User class that provides an interface to use signed integers with the MP++ library. More...
class  mpn_
 First level core class that provides natural numbers to the MP++ library. More...

Namespaces

namespace  pi_gen
namespace  prime
 Container for primality testing stuff.
namespace  prng
 Container for PRNG tools.

Unary positive & negative

mpf operator+ (const mpf &x)
mpf operator- (const mpf &x)

Comparison overloads

bool operator== (const mpi &x, int_type y)
bool operator!= (const mpi &x, int_type y)
bool operator< (const mpi &x, int_type y)
bool operator<= (const mpi &x, int_type y)
bool operator> (const mpi &x, int_type y)
bool operator>= (const mpi &x, int_type y)
bool operator== (int_type x, const mpi &y)
bool operator!= (int_type x, const mpi &y)
bool operator< (int_type x, const mpi &y)
bool operator<= (int_type x, const mpi &y)
bool operator> (int_type x, const mpi &y)
bool operator>= (int_type x, const mpi &y)
bool operator== (const mpi &x, const mpi &y)
bool operator!= (const mpi &x, const mpi &y)
bool operator< (const mpi &x, const mpi &y)
bool operator<= (const mpi &x, const mpi &y)
bool operator> (const mpi &x, const mpi &y)
bool operator>= (const mpi &x, const mpi &y)

Unary positive & negative

mpi operator+ (const mpi &x)
mpi operator- (const mpi &x)

Bit shifting

mpi operator>> (const mpi &x, mpi::size_type y)
mpi operator<< (const mpi &x, mpi::size_type y)

Bitwise overloads

mpi operator & (const mpi &x, const mpi &y)
mpi operator| (const mpi &x, const mpi &y)
mpi operator^ (const mpi &x, const mpi &y)

Typedefs

typedef unsigned char byte
 Convenience renaming.
typedef unsigned char radix_type
 String conversion radix number type.
typedef intptr_t size_type
 This is preferred to be signed for comparison reasons.
typedef uint16_t limb_type
 Type of normal limbs.
typedef uint32_t limb_long_type
 Type of double-long limbs.
typedef double float_type
 Basic non-mpf float type.

Enumerations

enum  capability { IS_SIGNED = 0x01, IS_RATIONAL = 0x02, IS_FLOAT = 0x04, CAN_INTERRUPT = 0x10 }

Functions

mpf_ log2 (size_type p)
bool operator== (const mpf &x, const mpf &y)
bool operator!= (const mpf &x, const mpf &y)
bool operator< (const mpf &x, const mpf &y)
bool operator<= (const mpf &x, const mpf &y)
bool operator> (const mpf &x, const mpf &y)
bool operator>= (const mpf &x, const mpf &y)
bool operator== (const mpf &x, const mpi &y)
bool operator!= (const mpf &x, const mpi &y)
bool operator< (const mpf &x, const mpi &y)
bool operator<= (const mpf &x, const mpi &y)
bool operator> (const mpf &x, const mpi &y)
bool operator>= (const mpf &x, const mpi &y)
bool operator== (const mpf &x, int_type y)
bool operator!= (const mpf &x, int_type y)
bool operator< (const mpf &x, int_type y)
bool operator<= (const mpf &x, int_type y)
bool operator> (const mpf &x, int_type y)
bool operator>= (const mpf &x, int_type y)
bool operator== (const mpf &x, float_type y)
bool operator!= (const mpf &x, float_type y)
bool operator< (const mpf &x, float_type y)
bool operator<= (const mpf &x, float_type y)
bool operator> (const mpf &x, float_type y)
bool operator>= (const mpf &x, float_type y)
mpf operator+ (const mpf &x, int_type y)
mpf operator+ (int_type x, const mpf &y)
mpf operator+ (const mpf &x, float_type y)
mpf operator+ (float_type y, const mpf &x)
mpf operator+ (const mpf &x, const mpi &y)
mpf operator+ (const mpi &x, const mpf &y)
mpf operator+ (const mpf &x, const mpf &y)
mpf operator- (const mpf &x, int_type y)
mpf operator- (int_type x, const mpf &y)
mpf operator- (const mpf &x, float_type y)
mpf operator- (float_type x, const mpf &y)
mpf operator- (const mpf &x, const mpi &y)
mpf operator- (const mpi &x, const mpf &y)
mpf operator- (const mpf &x, const mpf &y)
mpf operator * (const mpf &x, int_type y)
mpf operator * (int_type x, const mpf &y)
mpf operator * (const mpf &x, float_type y)
mpf operator * (float_type x, const mpf &y)
mpf operator * (const mpf &x, const mpi &y)
mpf operator * (const mpi &x, const mpf &y)
mpf operator * (const mpf &x, const mpf &y)
mpf operator/ (const mpf &x, int_type y)
mpf operator/ (int_type x, const mpf &y)
mpf operator/ (const mpf &x, float_type y)
mpf operator/ (float_type x, const mpf &y)
mpf operator/ (const mpf &x, const mpi &y)
mpf operator/ (const mpi &x, const mpf &y)
mpf operator/ (const mpf &x, const mpf &y)
mpf operator% (const mpf &x, int_type y)
mpf operator% (int_type x, const mpf &y)
mpf operator% (const mpf &x, float_type y)
mpf operator% (float_type x, const mpf &y)
mpf operator% (const mpf &x, const mpi &y)
mpf operator% (const mpi &x, const mpf &y)
mpf operator% (const mpf &x, const mpf &y)
mpf pi (size_type p)
mpf abs (const mpf &n)
mpf sqr (const mpf &n)
mpf log (const mpf &n, size_type p)
mpf exp (const mpf &n, size_type p)
mpf pow (const mpf &b, const mpf &e, size_type p)
mpf root (const mpf &x, limb_type n, size_type p)
mpf sqrt (const mpf &n, size_type p)
istream & operator>> (istream &is, mpf &n)
ostream & operator<< (ostream &os, const mpf &n)
mpf sin (const mpf &theta, size_type p)
mpf cos (const mpf &theta, size_type p)
void sin_cos (mpf &sin, mpf &cos, const mpf &theta, size_type p)
mpf tan (const mpf &theta, size_type p)
mpf operator+ (float_type x, const mpi &y)
mpf operator- (float_type x, const mpi &y)
mpf operator * (float_type x, const mpi &y)
mpf round (const mpf &x, size_type a)
mpf agm (const mpf &x, const mpf &y, size_type p)
mpf asin (const mpf &x, size_type p=0)
mpf acos (const mpf &x, size_type p=0)
mpf atan (const mpf &x, size_type p=0)
mpi operator+ (const mpi &x, mpi::int_type y)
mpi operator+ (mpi::int_type x, const mpi &y)
mpi operator+ (const mpi &x, const mpi &y)
mpi operator- (const mpi &x, mpi::int_type y)
mpi operator- (mpi::int_type x, const mpi &y)
mpi operator- (const mpi &x, const mpi &y)
mpi operator * (const mpi &x, mpi::int_type y)
mpi operator * (mpi::int_type x, const mpi &y)
mpi operator * (const mpi &x, const mpi &y)
mpi operator/ (const mpi &x, mpi::int_type y)
mpi operator/ (mpi::int_type x, const mpi &y)
mpi operator/ (const mpi &x, const mpi &y)
mpi operator% (const mpi &x, mpi::int_type y)
mpi operator% (mpi::int_type x, const mpi &y)
mpi operator% (const mpi &x, const mpi &y)
mpi abs (const mpi &n)
 Absolute value.
mpi sqr (const mpi &n)
 Squaring.
mpi pow (const mpi &base, int_type p)
mpi pow_mod (const mpi &base, const mpi &p, const mpi &m)
 Modular exponentiation.
mpi euclid (const mpi &x, const mpi &y)
 Euclid's method for.
mpi factorial (const mpi &n)
mpi gcd (const mpi &x, const mpi &y)
 Greatest common divisor.
istream & operator>> (istream &is, mpi &n)
 Stream input.
ostream & operator<< (ostream &os, const mpi &n)
 Stream output.
mpi operator+ (const mpi &x, int_type y)
mpi operator+ (int_type x, const mpi &y)
mpi operator- (const mpi &x, int_type y)
mpi operator- (int_type x, const mpi &y)
mpi operator * (const mpi &x, int_type y)
mpi operator * (int_type x, const mpi &y)
mpi operator/ (const mpi &x, int_type y)
mpi operator/ (int_type x, const mpi &y)
mpi operator% (const mpi &x, int_type y)
mpi operator% (int_type x, const mpi &y)
mpi pow (const mpi &base, const mpi &p)
 Exponentiation.
string::size_type isNum (const string &s, radix_type b)
 Count the number of digits in a valid number.
radix_type guessbase (const string &s, radix_type b)
 Guess the base of a number in a string.
char isPow2 (char b)
void setchunk (mpn_::radix_type b, string::size_type &chunksize, mpn_::limb_type &chunk)
void stringclean (string &s, mpn_::radix_type b, int clear_zero)
 Clean out the strings that will be converted with mpn_::setString().
void setchunk (mpn_::radix_type b, std::string::size_type &chunksize, mpn_::limb_type &chunk)
 Sets the chunk size for a particular base.

Variables

typedef std::vector< byteraw_type
 Raw number I/O type.
class typedef signed int int_type
 Basic non-mpi signed integer type.


Detailed Description

Container for all of the library.

Keeps everything in the MP++ library seperated from the other namespaces.


Typedef Documentation

typedef unsigned char mp::byte
 

Convenience renaming.

typedef double mp::float_type
 

Basic non-mpf float type.

typedef uint32_t mp::limb_long_type
 

Type of double-long limbs.

typedef uint16_t mp::limb_type
 

Type of normal limbs.

typedef unsigned char mp::radix_type
 

String conversion radix number type.

typedef intptr_t mp::size_type
 

This is preferred to be signed for comparison reasons.


Enumeration Type Documentation

enum mp::capability
 

Enumeration values:
IS_SIGNED  Class has sign capability.
IS_RATIONAL  Class has rational number capability.
IS_FLOAT  Class has floating point capability.
CAN_INTERRUPT  Class is interruptable.


Function Documentation

mpi mp::abs const mpi &  n  ) 
 

Absolute value.

Parameters:
n Number to take the absolute value of
Returns:
Result: abs(n)

mpi mp::euclid const mpi &  x,
const mpi &  y
 

Euclid's method for.

mpi mp::factorial const mpi &  n  ) 
 

Parameters:
n Number to take the factorial of
Returns:
Result: n !

mpi mp::gcd const mpi &  x,
const mpi &  y
 

Greatest common divisor.

Parameters:
x First operand
y Second operand
Returns:
Greatest common divisor of x and y

char isPow2 char  b  ) 
 

mpf_ log2 size_type  p  ) 
 

mpi operator * mpi::int_type  x,
const mpi &  y
 

mpi operator * const mpi &  x,
mpi::int_type  y
 

mpf operator * float_type  x,
const mpf &  y
 

mpi operator% mpi::int_type  x,
const mpi &  y
 

mpi operator% const mpi &  x,
mpi::int_type  y
 

mpf operator% const mpi &  x,
const mpf &  y
 

mpf operator% const mpf &  x,
const mpi &  y
 

mpf operator% float_type  x,
const mpf &  y
 

mpf operator% const mpf &  x,
float_type  y
 

mpf operator% int_type  x,
const mpf &  y
 

mpf operator% const mpf &  x,
int_type  y
 

mpi operator+ mpi::int_type  x,
const mpi &  y
 

mpi operator+ const mpi &  x,
mpi::int_type  y
 

mpf operator+ float_type  y,
const mpf &  x
 

mpi operator- mpi::int_type  x,
const mpi &  y
 

mpi operator- const mpi &  x,
mpi::int_type  y
 

mpf operator- float_type  x,
const mpf &  y
 

mpi operator/ mpi::int_type  x,
const mpi &  y
 

mpi operator/ const mpi &  x,
mpi::int_type  y
 

mpi pow const mpi &  base,
const mpi &  p
 

Exponentiation.

Parameters:
base Base of the operation
p Exponant of the operation
Returns:
Result: base ^ p

mpi pow const mpi &  base,
int_type  p
 

mpi mp::pow_mod const mpi &  base,
const mpi &  p,
const mpi &  mod
 

Modular exponentiation.

Parameters:
base Base of the operation
p Exponant of the operation
mod Divisor of the operation
Returns:
Result: (base ^ p) % mod

void setchunk mpn_::radix_type  b,
string::size_type chunksize,
mpn_::limb_type chunk
 

mpi mp::sqr const mpi &  n  ) 
 

Squaring.

Parameters:
n Number to square
Returns:
Result: n ^ 2


Variable Documentation

class class typedef signed int mp::int_type
 

Basic non-mpi signed integer type.

class typedef std::vector<byte> mp::raw_type
 

Raw number I/O type.


Generated on Fri Feb 4 16:17:55 2005 for LibMP++ by  doxygen 1.4.1