Functions

helper.h File Reference

#include <stdint.h>
#include <cstring>
#include <gmpxx.h>
#include <sqlite3.h>
Include dependency graph for helper.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int64_t readInt64_t (const char *value, int8_t base)
uint64_t readUint64_t (const char *value, int8_t base)
int64_t read_int64_t (mpz_class value)
uint64_t read_uint64_t (mpz_class value)
mpz_class create_mpz (int64_t num)
mpq_class create_mpq (int64_t num, int64_t den)
mpq_class create_mpq_n (int64_t num)
sqlite3 * loadDB (std::string filename)
void execQuery (sqlite3 *db, std::string queryStr)
sqlite3 * createDB (std::string filename)

Function Documentation

mpq_class create_mpq ( int64_t  num,
int64_t  den 
)

create a new GMP rational value out of 2 64 bit values (GMP only supports 32 Bit values)

Parameters:
numThe divident of the rational value
denThe devisor of the rational value
Returns:
the rational value
mpq_class create_mpq_n ( int64_t  num )

create a new GMP rational value out of the 64 bit value (GMP only supports 32 Bit values)

Parameters:
numThe divident of the rational value
Returns:
the rational value
mpz_class create_mpz ( int64_t  num )

create a new GMP integer value out of the 64 bit value (GMP only supports 32 Bit values)

Parameters:
numThe divident of the rational value
Returns:
the rational value
sqlite3* createDB ( std::string  filename )
void execQuery ( sqlite3 *  db,
std::string  queryStr 
)
sqlite3* loadDB ( std::string  filename )
int64_t read_int64_t ( mpz_class  value )

read a signed GMP Integer value and put it in a 64 bit signed value.

Parameters:
valueThe GMP value
Returns:
the 64-bit value
uint64_t read_uint64_t ( mpz_class  value )

read a unsigned GMP Integer value and put it in a 64 bit unsigned value.

Parameters:
valueThe GMP value
Returns:
the 64-bit value
int64_t readInt64_t ( const char *  value,
int8_t  base 
)
uint64_t readUint64_t ( const char *  value,
int8_t  base 
)