The Original CHomP Software
Public Member Functions | Private Attributes | List of all members
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>

Public Member Functions

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

Private Attributes

int_t n
 The actual prime number stored in this class. More...
 

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 59 of file integer.h.

Constructor & Destructor Documentation

◆ primeint()

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

◆ operator int_t()

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

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

Definition at line 85 of file integer.h.

86{
87 return n;
88} /* primeint::operator int_t */
int_t n
The actual prime number stored in this class.
Definition: integer.h:79

◆ operator=() [1/2]

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

The assignment operator.

Definition at line 90 of file integer.h.

91{
92 n = p. n;
93 return *this;
94} /* primeint::operator = */

References n.

◆ operator=() [2/2]

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

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

Member Data Documentation

◆ n

int_t chomp::homology::primeint::n
private

The actual prime number stored in this class.

Definition at line 79 of file integer.h.

Referenced by operator=().


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