QDpy
Loading...
Searching...
No Matches
centroids.py File Reference

Seeded point generators for nearest-centroid archives. More...

Go to the source code of this file.

Namespaces

namespace  qdpy

Functions

 qdpy.containers.centroids.generate_centroids (count, features_domain, *, method="sobol", seed=0, blue_noise_candidates=32)
 Generate sites for CVTGrid using unit-cube point sampling.

Detailed Description

Seeded point generators for nearest-centroid archives.

See also
https://doi.org/10.1145/3583133.3590726

Definition in file centroids.py.

Function Documentation

◆ generate_centroids()

qdpy.containers.centroids.generate_centroids ( count,
features_domain,
* ,
method = "sobol",
seed = 0,
blue_noise_candidates = 32 )

Generate sites for CVTGrid using unit-cube point sampling.

Parameters
countNumber of distinct sites.
features_domainFinite increasing intervals, one per dimension.
methodSite generator, "sobol", "halton", "blue-noise", or "uniform".
seedSeed for the private NumPy generator.
blue_noise_candidatesPool size for each best-candidate step.
Returns
A float64 site matrix scaled into the requested feature domain.
Generate sites for ``CVTGrid(centroids=...)`` without changing its default geometry.

Scramble Sobol and Halton sequences. Any positive count is supported.
For Sobol, retain the prefix of the next power-of-two block. Blue noise
starts uniformly and repeatedly selects the best-separated candidate
from a fresh uniform pool. Separation is measured in normalized
coordinates before applying the requested physical bounds.

Definition at line 34 of file centroids.py.