36#ifndef _CHOMP_STRUCT_INTEGER_H_
37#define _CHOMP_STRUCT_INTEGER_H_
75 operator int_t ()
const;
85inline primeint::operator
int_t ()
const
101 out << static_cast<int_t> (p);
155 int delta (
void)
const;
188 static unsigned invert (
unsigned n,
unsigned q);
203 int num =
p - ((-n) %
p);
248 if ((
long)
num != (long) n)
249 throw "Number out of range at assignment.";
285 if ((
long) result + (long)
num != 0)
286 throw "Number out of range (unary -).";
298 throw "Number out of range (+).";
310 long result = (long)
num * (
long) n.
num;
322 long result = (long)
num * (
long) (n.
num);
324 if ((
long)
num != result)
325 throw "Number out of range (*).";
351 out << (long) n. num;
396 return (
num ? 1 : 0);
413 return (x. num < y. num);
418 return (x. num > y. num);
This class defines integer numbers with overflow control and with some specific properties of an Eucl...
integer operator*(const integer &n) const
friend std::ostream & operator<<(std::ostream &out, const integer &n)
friend bool operator>(const integer &x, const integer &y)
integer operator%(const integer &n) const
static int prime_number(int n)
integer & operator+=(const integer &n)
friend bool operator<(const integer &x, const integer &y)
static const char * ringsymbol()
integer operator-() const
int operator==(const integer &n) const
static int cut_down(int n)
static int is_prime(int n)
integer normalized() const
static const char * ringname()
integer operator+(const integer &n) const
integer & operator=(int n)
integer & operator*=(const integer &n)
static unsigned invert(unsigned n, unsigned q)
integer operator/(const integer &n) const
static int initialize(int n)
This is a simple class which is a wrapper for computing the smallest prime number greater or equal to...
int_t n
The actual prime number stored in this class.
primeint & operator=(const primeint &p)
The assignment operator.
primeint(int_t k=0)
The constructor which computes the smallest prime number greater than or equal to the given one.
This file contains some precompiler definitions which indicate the operating system and/or compiler u...
int int_t
Index type for indexing arrays, counting cubes, etc.
signed short numbertype
The type of number used to store the value of an object of type "integer".
std::ostream & operator<<(std::ostream &out, const bincube< Dim, twoPower > &b)
integer operator-(const integer &n, const integer &m)
bool operator<(const integer &x, const integer &y)
bool operator!=(const typename bincube< Dim, twoPower >::neighborhood_iterator &x1, const typename bincube< Dim, twoPower >::neighborhood_iterator &x2)
std::istream & operator>>(std::istream &in, bincube< Dim, twoPower > &b)
bool operator==(const typename bincube< Dim, twoPower >::neighborhood_iterator &x1, const typename bincube< Dim, twoPower >::neighborhood_iterator &x2)
bool operator>(const integer &x, const integer &y)
This namespace contains the entire CHomP library interface.
This file contains some useful functions related to the text input/output procedures.