14 #if !defined(KRATOS_PRIME_NUMBERS_H_INCLUDED )
15 #define KRATOS_PRIME_NUMBERS_H_INCLUDED
43 static constexpr std::size_t mNumberOfPreCalculatedPrimes = 100000;
45 static constexpr std::size_t mLargestPreCalculatedPrime = 1299689;
87 return mNumberOfPreCalculatedPrimes;
91 return mLargestPreCalculatedPrime;
96 <<
" is larger than Number of precalculated primes " << mNumberOfPreCalculatedPrimes << std::endl;
97 return mPrecalculatedPrimes[
Index];
104 static bool IsPrime(std::size_t TheNumber);
118 static const std::array<std::size_t, mNumberOfPreCalculatedPrimes> mPrecalculatedPrimes;
124 static std::size_t FindGreaterEqualPrecalculatedPrimeNumber(std::size_t TheNumber);
Gives a prime number before or after given number.
Definition: prime_numbers.h:39
static bool IsPrime(std::size_t TheNumber)
Definition: prime_numbers.cpp:32
static std::size_t GetNumberOfPreCalculatedPrimes()
Definition: prime_numbers.h:86
PrimeNumbers(PrimeNumbers const &rOther)=delete
Copy constructor.
PrimeNumbers()
Default constructor.
Definition: prime_numbers.h:57
static std::size_t GetPreCalculatedPrime(std::size_t Index)
Definition: prime_numbers.h:94
PrimeNumbers & operator=(PrimeNumbers const &rOther)=delete
Assignment operator.
std::size_t operator[](std::size_t Index)
Definition: prime_numbers.h:73
static std::size_t LargestPreCalculatedPrime()
Definition: prime_numbers.h:90
virtual ~PrimeNumbers()
Destructor.
Definition: prime_numbers.h:63
#define KRATOS_DEBUG_ERROR_IF(conditional)
Definition: exception.h:171
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21