Main Page   Compound List   File List   Compound Members   File Members  

biginteger_operator.cc File Reference

C operator for bigintegers. More...

#include "biginteger.h"
#include <Rinternals.h>
#include "stdio.h"

Compounds

struct  mpz_t_sentry

Functions

bigmod operator+ (const bigmod &lhs, const bigmod &rhs)
bigmod operator- (const bigmod &lhs, const bigmod &rhs)
bigmod operator * (const bigmod &lhs, const bigmod &rhs)
bigmod operator/ (const bigmod &lhs, const bigmod &rhs)
bigmod operator% (const bigmod &lhs, const bigmod &rhs)
bigmod pow (const bigmod &base, const bigmod &exp)
bigmod inv (const bigmod &x, const bigmod &m)
bigmod set_modulus (const bigmod &x, const bigmod &m)
bigmod gcd (const bigmod &lhs, const bigmod &rhs)
bigmod lcm (const bigmod &lhs, const bigmod &rhs)


Detailed Description

C operator for bigintegers.

Version:
1
Date:
Created: 27/10/04
Last modified: Time-stamp: <2004-11-27 18:46:51 antoine>
Author:
Immanuel Scholz
Note:
Licence: GPL

Function Documentation

bigmod gcd const bigmod   rhs,
const bigmod   lhs
 

Return the greatest common divisor of both parameters

For modulus description, see operator+(bigmod, bigmod)

bigmod inv const bigmod   x,
const bigmod   m
 

Return the modulo inverse to x mod m. (return = x^-1 % m)

For modulus description, see operator+(bigmod, bigmod)

bigmod lcm const bigmod   rhs,
const bigmod   lhs
 

Return the least common multiply of both parameter.

For modulus description, see operator+(bigmod, bigmod)

bigmod operator * const bigmod   rhs,
const bigmod   lhs
 

Multiply two bigmods.

For modulus description, see operator+(bigmod, bigmod)

bigmod operator% const bigmod   rhs,
const bigmod   lhs
 

Calculate the modulus (remainder) of two bigmods.

The resulting bigmod will have set the intern modulus to the value of lhs, no matter what rhs.modulus or lhs.modulus was before, except if rhs and lhs has both no modulus set, in which case the resulting modulus will be unset too.

bigmod operator+ const bigmod   rhs,
const bigmod   lhs
 

Add two bigmods together.

If only one has a modulus set, the result will have this modulus. If both bigmods disagree with the modulus, the result will not have a modulus set. If none modulus for either bigmod is set, the result will not have a modulus as well.

bigmod operator- const bigmod   rhs,
const bigmod   lhs
 

Subtract two bigmods.

For modulus description, see operator+(bigmod, bigmod)

bigmod operator/ const bigmod   rhs,
const bigmod   lhs
 

Divide two bigmods.

For modulus description, see operator+(bigmod, bigmod)

bigmod pow const bigmod   base,
const bigmod   exp
 

Return the power of "exp" to the base of "base" (return = base^exp).

If both moduli are unset or unequal, this may EAT your memory alive, since then the infinite "pow" is used instead of the modulus "powm". You may not try to pow a value this way with an exponent that does not fit into a long value.

For other modulus description, see operator+(bigmod, bigmod)

bigmod set_modulus const bigmod   x,
const bigmod   m
 

Return a bigmod with value (x % m) and the intern modulus set to m. Intern modulus settings of x and m are ignored.

Do not confuse this with operator%(bigmod, bigmod).


Generated on Sat Nov 27 18:46:53 2004 for GMP-RCdocumentation by doxygen1.2.18