Public Member Functions | Private Attributes

chomp::homology::primeint Class Reference

This is a simple class which is a wrapper for computing the smallest prime number greater or equal to the given integer. More...

#include <integer.h>

List of all members.

Public Member Functions

 primeint (int_t k=0)
 The constructor which computes the smallest prime number greater than or equal to the given one.
primeintoperator= (const primeint &p)
 The assignment operator.
primeintoperator= (int_t k)
 The assignment operator which also rounds up to the nearest prime number.
 operator int_t () const
 The conversion operator to an integer number which extracts the prime number.

Private Attributes

int_t n
 The actual prime number stored in this class.

Detailed Description

This is a simple class which is a wrapper for computing the smallest prime number greater or equal to the given integer.

Definition at line 60 of file integer.h.


Constructor & Destructor Documentation

chomp::homology::primeint::primeint ( int_t  k = 0  ) 

The constructor which computes the smallest prime number greater than or equal to the given one.


Member Function Documentation

chomp::homology::primeint::operator int_t (  )  const [inline]

The conversion operator to an integer number which extracts the prime number.

Definition at line 86 of file integer.h.

References n.

{
        return n;
} /* primeint::operator int_t */

primeint & chomp::homology::primeint::operator= ( const primeint p  )  [inline]

The assignment operator.

Definition at line 91 of file integer.h.

References n.

{
        n = p. n;
        return *this;
} /* primeint::operator = */

primeint& chomp::homology::primeint::operator= ( int_t  k  ) 

The assignment operator which also rounds up to the nearest prime number.


Member Data Documentation

The actual prime number stored in this class.

Definition at line 80 of file integer.h.

Referenced by operator int_t(), and operator=().


The documentation for this class was generated from the following file: