Poisson sphere tiling for importance sampling.
More...
#include <sampling.h>
|
| | SphereTile (const Random &=Random(239)) |
| | Empty.
|
| | SphereTile (const double &, const double &, int, const Random &=Random(239)) |
| | Create a poisson sampling in a square domain.
|
|
| ~SphereTile () |
| | Empty.
|
| void | Relaxation (const double &=1.0/4.0) |
| | Perform a relaxation step in the Poisson vertex distribution.
|
| Vector | Vertex (int) const |
| | Getter on the i-th sample.
|
| Sphere | At (int) const |
| | Getter on the i-th sample as a sphere.
|
|
const QVector< Vector > | GetSet () const |
| | Return the vector containing the samples.
|
|
int | Size () const |
| | Return the number of samples.
|
|
Box | GetBox () const |
| | Return the box.
|
|
| static bool | Check (const Vector &, const QVector< Vector > &, double) |
| | Performs a poisson sphere check on a set of point and a candidate position.
|
|
| void | Generate (int) |
| | Generate the poisson sampling of the domain.
|
|
|
double | a = 0.0 |
| | Size.
|
|
double | r = 0.0 |
| | Radius.
|
|
double | e = 0.0 |
| | Squared radius with small epsilon tolerance.
|
|
QVector< Vector > | p |
| | Array of samples.
|
|
Random | random |
| | Random number generator.
|
Poisson sphere tiling for importance sampling.
- See also
- DiscTile
◆ SphereTile() [1/2]
Empty.
Initialize a poisson sphere tiling.
- Parameters
-
| r | Random number generator. |
◆ SphereTile() [2/2]
| SphereTile::SphereTile |
( |
const double & | a, |
|
|
const double & | r, |
|
|
int | n, |
|
|
const Random & | ra = Random(239) ) |
|
explicit |
Create a poisson sampling in a square domain.
- Parameters
-
| a | Size of the side of the square. |
| r | Radius of the samples. |
| n | Maximum number of samples in the dart throwing process. Note that the number of samples will be different. |
| ra | Random number generator. |
◆ At()
| Sphere SphereTile::At |
( |
int | i | ) |
const |
|
inline |
Getter on the i-th sample as a sphere.
- Parameters
-
◆ Check()
| bool SphereTile::Check |
( |
const Vector & | p, |
|
|
const QVector< Vector > & | s, |
|
|
double | r ) |
|
static |
Performs a poisson sphere check on a set of point and a candidate position.
Returns true if the candidate intersects with the distribution, false otherwise.
- Parameters
-
| p | Candidate position |
| s | Set of point |
| r | Poisson sphere radius. |
◆ Generate()
| void SphereTile::Generate |
( |
int | n | ) |
|
|
protected |
Generate the poisson sampling of the domain.
Collisions are detected with a periodic grid. The cells of the grid are small enough, the diagonal of a cell is not larger than the minimum distance 2r between two samples, so that they contain at most one sample, and the range of the search covers the distance below which a candidate is rejected.
- Parameters
-
| n | Number of darts thrown on the domain. |
Note that the number of generated samples will be less than n.
◆ Relaxation()
| void SphereTile::Relaxation |
( |
const double & | c = 1.0 / 4.0 | ) |
|
Perform a relaxation step in the Poisson vertex distribution.
The samples are pushed away from their neighbors, which lie within four times the radius of the Poisson distribution. Neighbors are found with a grid whose cells are small enough to contain at most one sample, as the minimum distance between two samples is twice the radius, and whose range of search covers the radius of influence of the samples. The tile is periodic: the samples that leave the tile are brought back inside.
- Parameters
-
| c | Relaxation coefficient, it the fraction of the radius of the Poisson distribution. |
◆ Vertex()
| Vector SphereTile::Vertex |
( |
int | i | ) |
const |
|
inline |
Getter on the i-th sample.
- Parameters
-