Sampler Korobov [Kor59]
Description
Korobov lattices. The generator value should be prime relatively to the number of samples, otherwise the point set will not be projection regular.
For a more precise description of this sampler and its performances in terms of aliasing and discrepancy, please refer to the following web bundle https://liris.cnrs.fr/ldbn/HTML_bundle/index.html.
Files
src/samplers/Korobov.cpp
include/utk/samplers/SamplerKorobov.hpp
Usage
Korobov sampler
Usage: ./Korobov [OPTIONS]
Options:
-h,--help Print this help message and exit
-n UINT REQUIRED Number of points
-d UINT REQUIRED Dimensions
-s,--seed UINT UNUSED ! Here for compatibility with others.
-m UINT [1] Number of pointsets
-o,--out TEXT [out.dat] Output file (format). {i} splits outputs in multiple files and token is replaced by index.
-g,--gen UINT [3] Generator (highly recommended to be prime with N)
--silent Silence UTK logs
#include <utk/utils/PointsetIO.hpp>
#include <utk/utils/Pointset.hpp>
#include <utk/samplers/SamplerKorobov.hpp>
int main()
{
utk::Pointset<double> pts;
utk::SamplerKorobov korobov(2 /* dimension */, 7 /* generator */);
// Check for no errors
if (korobov.generateSamples(pts, 1024 /* Number of points, must be a squared */))
{
write_text_pointset("korobov2d.dat", pts);
}
}
import pyutk
korobov = pyutk.Korobov(
2, # Dimension
7 # Generator value
)
samples = korobov.sample(1024) # This is a numpy array !
Results
License
See Licence.md file.