NTLib - Number Theory Library 0.9
Loading...
Searching...
No Matches
ntlib::sieve_235< Allocator > Class Template Referenceexport

Classes

class  reference

Public Member Functions

 sieve_235 ()=default
 sieve_235 (std::size_t min_capacity)
void init235 ()
bool operator[] (std::size_t idx) const
reference operator[] (std::size_t idx)
bool empty () const noexcept
std::size_t size () const noexcept
const std::byte * data () const noexcept
std::byte * data () noexcept

Detailed Description

template<class Allocator = std::allocator<std::byte>>
class ntlib::sieve_235< Allocator >

Represents a 235-wheel optimized sieve.

Template Parameters
AllocatorThe allocator to use for the sieve.

Constructor & Destructor Documentation

◆ sieve_235() [1/2]

template<class Allocator = std::allocator<std::byte>>
ntlib::sieve_235< Allocator >::sieve_235 ( )
default

Constructs an empty sieve.

◆ sieve_235() [2/2]

template<class Allocator = std::allocator<std::byte>>
ntlib::sieve_235< Allocator >::sieve_235 ( std::size_t min_capacity)
inline

Constructs the sieve with a capacity at least as big as min_capacity.

Parameters
min_capacityThe minimum required capacity.

Member Function Documentation

◆ data() [1/2]

template<class Allocator = std::allocator<std::byte>>
const std::byte * ntlib::sieve_235< Allocator >::data ( ) const
inlinenodiscardnoexcept

Returns a const pointer to the underlying data array.

Returns
Constant pointer to the underlying data array.

◆ data() [2/2]

template<class Allocator = std::allocator<std::byte>>
std::byte * ntlib::sieve_235< Allocator >::data ( )
inlinenodiscardnoexcept

Returns a pointer to the underlying data array.

Returns
Pointer to the underlying data array.

◆ empty()

template<class Allocator = std::allocator<std::byte>>
bool ntlib::sieve_235< Allocator >::empty ( ) const
inlinenodiscardnoexcept

Tests whehter the sieve is empty.

Returns
Whether the sieve is empty.

◆ init235()

template<class Allocator = std::allocator<std::byte>>
void ntlib::sieve_235< Allocator >::init235 ( )
inline

Initializes the sieve with true everywhere execept for strict multiples of 2, 3 and 5.

◆ operator[]() [1/2]

template<class Allocator = std::allocator<std::byte>>
reference ntlib::sieve_235< Allocator >::operator[] ( std::size_t idx)
inlinenodiscard

Subscript operator for array like access.

Parameters
idxThe index to return.
Returns
A proxy to the element at the given index.

◆ operator[]() [2/2]

template<class Allocator = std::allocator<std::byte>>
bool ntlib::sieve_235< Allocator >::operator[] ( std::size_t idx) const
inlinenodiscard

Subscript operator for constant array like access.

Parameters
idxThe index of the element to return.
Returns
The value at the given index.

◆ size()

template<class Allocator = std::allocator<std::byte>>
std::size_t ntlib::sieve_235< Allocator >::size ( ) const
inlinenodiscardnoexcept

Returns the current size of the sieve.

Returns
The size of the sieve.

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