gmp_utils.h File Reference

Various GMP small utilities. More...

#include <gmp.h>
#include "hashtable.h"

Go to the source code of this file.

Data Structures

struct  struct_mpz_pair_t
 A pair of mpz_t integers. More...

Defines

#define _TIFA_GMP_UTILS_H_

Typedefs

typedef struct struct_mpz_pair_t mpz_pair_t
 Equivalent to struct struct_mpz_pair_t.

Functions

static void init_mpz_pair (mpz_pair_t *pair)
 inits a mpz_pair_t.
static void clear_mpz_pair (mpz_pair_t *pair)
 Clears a mpz_pair_t.
void empty_mpzpair_htable (hashtable_t *const htable)
 Empties a hashtable_t holding mpz_pair_t's.
static void free_mpzpair_htable (hashtable_t *htable)
 Clears a hashtable_t holding mpz_pair_t's.
float mpz_log10 (mpz_t n)
 Logarithm in base 10 of a multi-precision integer.


Detailed Description

Various GMP small utilities.

Author:
Jerome Milan
Date:
Fri Jun 10 2011
Version:
2011-06-10
GMP small utilities' definitions should go here.

Definition in file gmp_utils.h.


Define Documentation

#define _TIFA_GMP_UTILS_H_

Standard include guard.

Definition at line 35 of file gmp_utils.h.


Function Documentation

static void clear_mpz_pair ( mpz_pair_t pair  )  [inline, static]

Clears a mpz_pair_t.

Clears a mpz_pair_t.

Parameters:
[in] pair A pointer to the mpz_pair_t to clear.

Definition at line 87 of file gmp_utils.h.

References struct_mpz_pair_t::x, and struct_mpz_pair_t::y.

void empty_mpzpair_htable ( hashtable_t *const   htable  ) 

Empties a hashtable_t holding mpz_pair_t's.

Empties a hashtable_t holding mpz_pair_t's and clears the memory associated to the keys and their associated data.

Parameters:
[in] htable A pointer to the hashtable_t to empty.

Referenced by free_mpzpair_htable().

static void free_mpzpair_htable ( hashtable_t htable  )  [inline, static]

Clears a hashtable_t holding mpz_pair_t's.

Clears a hashtable_t holding mpz_pair_t's. It clears the memory associated to the keys, their associated data and the hashtable itself.

Parameters:
[in] htable A pointer to the hashtable_t to clear.

Definition at line 111 of file gmp_utils.h.

References empty_mpzpair_htable(), and free_hashtable().

static void init_mpz_pair ( mpz_pair_t pair  )  [inline, static]

inits a mpz_pair_t.

Inits a mpz_pair_t by initializing each of its mpz_t element.

Parameters:
[in] pair A pointer to the mpz_pair_t to init.

Definition at line 75 of file gmp_utils.h.

References struct_mpz_pair_t::x, and struct_mpz_pair_t::y.

float mpz_log10 ( mpz_t  n  ) 

Logarithm in base 10 of a multi-precision integer.

Returns an crude approximation of the logarithm (in base 10) of a positive multi-precision integer n. The approximation is usually valid up to the 4th decimal.

Parameters:
[in] n A positive multi-precision integer.
Returns:
An approximation of log(n) in base 10.


Generated on Fri Jun 17 11:10:12 2011 for TIFA by Doxygen 1.5.5