LatNet Builder Manual  2.0.1-11
Software Package for Constructing Highly Uniform Point Sets
LatBuilder::CompressTraits< Compress::SYMMETRIC > Struct Template Reference

Symmetric compression. More...

#include <CompressTraits.h>

Public Member Functions

int levelCompressionRatio (uInteger base, Level level) const
 Returns the compression ratio for the elements on level level in base base. More...
 

Static Public Member Functions

static constexpr bool symmetric ()
 
static size_t size (size_t n)
 Returns the internal vector size corresponding to natural size n. More...
 
static size_t compressIndex (size_t i, size_t n)
 Returns the index at which the i -th natural element is stored. More...
 
static constexpr const char * name ()
 Returns "symmetric".
 
static int indexCompressionRatio (size_t i, size_t n)
 Returns the compression ratio of the element at index i for vector size n. More...
 

Detailed Description

template<>
struct LatBuilder::CompressTraits< Compress::SYMMETRIC >

Symmetric compression.

With symmetric compression, the second half of a virtual vector is identical to the first half, but in reverse order. Thus, only the first half is stored in memory, and when an component from the second half is accessed, it is mapped to the identical element from the first half. Modifying one modifies the other.

Member Function Documentation

◆ compressIndex()

static size_t LatBuilder::CompressTraits< Compress::SYMMETRIC >::compressIndex ( size_t  i,
size_t  n 
)
inlinestatic

Returns the index at which the i -th natural element is stored.

This is \( \min(i, n - i) \).

◆ indexCompressionRatio()

static int LatBuilder::CompressTraits< Compress::SYMMETRIC >::indexCompressionRatio ( size_t  i,
size_t  n 
)
inlinestatic

Returns the compression ratio of the element at index i for vector size n.

The first element of a vector is never compressed. The last element of a vector is not compressed when n is even and is compressed by a factor of 2 otherwise. The rest of the elements are compressed by a factor of 2.

◆ levelCompressionRatio()

int LatBuilder::CompressTraits< Compress::SYMMETRIC >::levelCompressionRatio ( uInteger  base,
Level  level 
) const
inline

Returns the compression ratio for the elements on level level in base base.

If base is 2, levels 0 and 1 are not compressed, and higher levels are compressed by a factor of 2.

If base is larger than 2, level 0 is not compressed, and higher levels are compressed by a factor of 2.

◆ size()

static size_t LatBuilder::CompressTraits< Compress::SYMMETRIC >::size ( size_t  n)
inlinestatic

Returns the internal vector size corresponding to natural size n.

Natural points are at \( i / n \) for \(i = 0, \dots, n-1\). All points up to the middle one, inclusively, contain unique information. The middle point is found at \( (n + 1) / 2 \) if \( n \) is odd, and at \( n / 2 + 1 \) if \( n \) is even. This gives the necessary storage size to contain the complete information.


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