#include <prime_tables.h>
Definition at line 80 of file prime_tables.h.
◆ PreCalculatedPrimeTable()
PreCalculatedPrimeTable::PreCalculatedPrimeTable |
( |
int | max | ) |
|
|
inlineexplicit |
Definition at line 83 of file prime_tables.h.
84 : is_prime_size_(max + 1), is_prime_(new bool[max + 1]) {
85 CalculatePrimesUpTo(max);
86 }
◆ ~PreCalculatedPrimeTable()
virtual PreCalculatedPrimeTable::~PreCalculatedPrimeTable |
( |
| ) |
|
|
inlinevirtual |
◆ GetNextPrime()
virtual int PreCalculatedPrimeTable::GetNextPrime |
( |
int | p | ) |
const |
|
inlinevirtual |
Implements PrimeTable.
Definition at line 93 of file prime_tables.h.
93 {
94 for (
int n =
p + 1; n < is_prime_size_; n++) {
95 if (is_prime_[n]) return n;
96 }
97
98 return -1;
99 }
◆ IsPrime()
virtual bool PreCalculatedPrimeTable::IsPrime |
( |
int | n | ) |
const |
|
inlinevirtual |
Implements PrimeTable.
Definition at line 89 of file prime_tables.h.
89 {
90 return 0 <= n && n < is_prime_size_ && is_prime_[n];
91 }
The documentation for this class was generated from the following file:
- libraries/fc/include/fc/crypto/webauthn_json/thirdparty/gtest/googletest/samples/prime_tables.h