CVT
Centroidal Voronoi Tessellations
CVT is a C++ library, using double precision arithmetic,
for creating Centroidal Voronoi Tessellation (CVT) datasets.
The generation of a CVT dataset is of necessity more complicated than
for a quasirandom sequence. An iteration is involved, so there
must be an initial assignment for the generators, and then a
number of iterations. Moreover, in each iteration, estimates must
be made of the volume and location of the Voronoi cells. This is
typically done by Monte Carlo sampling. The accuracy of the resulting
CVT depends in part on the number of sampling points and the number
of iterations taken.
The library is mostly used to generate a dataset of points
uniformly distributed in the unit hypersquare. However, a user
may be interested in computations with other geometries or
point densities. To do this, the user needs to replace the
USER routine in the CVT library, and then specify
the appropriate values init=3 and sample=3.
The USER routine returns a set of sample points from the
region of interest. The default USER routine samples points
uniformly from the unit circle. But other geometries are
easy to set up. Changing the point density simply requires
weighting the sampling in the region.
Related Data and Programs:
CCVT_BOX
is a C++ program for computing a CVT with some points
forced to lie on the boundary.
CVT is also available in
a FORTRAN90 version and
a MATLAB version.
CVT
is a dataset directory which
contains files describing a number of CVT's.
CVT_DATASET
is an interactive C++ program for creating a CVT dataset.
FAURE
is a C++ library of routines for computing Faure
sequences.
GRID
is a C++ library of routines for computing points on a grid.
HALTON
is a C++ library of routines for computing Halton
sequences.
HAMMERSLEY
is a C++ library of routines for computing Hammersley
sequences.
HEX_GRID
is a C++ library of routines for computing
sets of points in a 2D hexagonal grid.
IHS
is a C++ library of routines for computing
improved Latin Hypercube datasets.
LATIN_CENTER
is a C++ library of routines for computing
Latin square data choosing the center value.
LATIN_EDGE
is a C++ library of routines for computing
Latin square data choosing the edge value.
LATIN_RANDOM
is a C++ library of routines for computing
Latin square data choosing a random value in the square.
NIEDERREITER2
is a C++ library of routines for computing
Niederreiter sequences with base 2.
NORMAL
is a C++ library which computes elements of a
sequence of pseudorandom normally distributed values.
SOBOL
is a C++ library of routines for computing
Sobol sequences.
UNIFORM
is a C++ library of routines for computing
uniform random values.
VAN_DER_CORPUT
is a C++ library of routines for computing
van der Corput sequences.
Reference:
-
Franz Aurenhammer,
Voronoi diagrams -
a study of a fundamental geometric data structure,
ACM Computing Surveys,
Volume 23, Number 3, pages 345-405, September 1991,
../../pdf/aurenhammer.pdf
-
Paul Bratley, Bennett Fox, Linus Schrage,
A Guide to Simulation,
Springer Verlag, pages 201-202, 1983.
-
John Burkardt, Max Gunzburger, Janet Peterson, Rebecca Brannon,
User Manual and Supporting Information for Library of Codes
for Centroidal Voronoi Placement and Associated Zeroth,
First, and Second Moment Determination,
Sandia National Laboratories Technical Report SAND2002-0099,
February 2002.
Online ordering
-
Qiang Du, Vance Faber, Max Gunzburger,
Centroidal Voronoi Tessellations: Applications and Algorithms,
SIAM Review,
Volume 41, 1999, pages 637-676.
-
Bennett Fox,
Algorithm 647:
Implementation and Relative Efficiency of Quasirandom
Sequence Generators,
ACM Transactions on Mathematical Software,
Volume 12, Number 4, pages 362-376, 1986.
-
John Halton,
On the efficiency of certain quasi-random sequences of points
in evaluating multi-dimensional integrals,
Numerische Mathematik,
Volume 2, pages 84-90, 1960.
-
Lili Ju, Qiang Du, Max Gunzburger,
Probabilistic methods for centroidal Voronoi tessellations
and their parallel implementations,
Parallel Computing,
Volume 28, 2002, pages 1477-1500.
Source Code:
Source code files you may copy include:
-
cvt.C, the source code;
-
cvt.H, the include file;
-
cvt.csh,
commands to compile the source code;
Examples and Tests:
-
cvt_prb.C,
a sample calling program.
-
cvt_prb.csh,
commands to compile and run the sample program.
-
cvt_prb.out,
the output from a run of the sample program.
-
cvt_circle.txt,
a set of 100 CVT points in a circle, generated using
the built in USER routine.
-
cvt_circle.png,
a PNG image of
the 100 CVT points in a circle.
List of Routines:
-
CH_CAP capitalizes a single character.
-
CH_EQI is true if two characters are equal, disregarding case.
-
CH_TO_DIGIT returns the integer value of a base 10 digit.
-
CVT computes a Centroidal Voronoi Tessellation.
-
CVT_ENERGY computes the CVT energy of a dataset.
-
CVT_ITERATE takes one step of the CVT iteration.
-
CVT_SAMPLE returns sample points.
-
CVT_WRITE writes a CVT dataset to a file.
-
DATA_READ reads generator coordinate data from a file.
-
DIGIT_TO_CH returns the base 10 digit character corresponding to a digit.
-
FIND_CLOSEST finds the nearest R point to each S point.
-
GET_SEED returns a random seed for the random number generator.
-
HALHAM_LEAP_CHECK checks LEAP for a Halton or Hammersley sequence.
-
HALHAM_N_CHECK checks N for a Halton or Hammersley sequence.
-
HALHAM_DIM_NUM_CHECK checks DIM_NUM for a Halton or Hammersley sequence.
-
HALHAM_SEED_CHECK checks SEED for a Halton or Hammersley sequence.
-
HALHAM_STEP_CHECK checks STEP for a Halton or Hammersley sequence.
-
HALTON_BASE_CHECK checks BASE for a Halton sequence.
-
I4_LOG_10 returns the whole part of the logarithm base 10 of an integer.
-
I4_MAX returns the maximum of two integers.
-
I4_MIN returns the smaller of two integers.
-
I4_TO_HALTON_SEQUENCE computes N elements of a leaped Halton subsequence.
-
I4_TO_S converts an integer to a string.
-
PRIME returns any of the first PRIME_MAX prime numbers.
-
R8_EPSILON returns the R8 round off unit.
-
R8_HUGE returns a "huge" R8.
-
R8MAT_TRANSPOSE_PRINT prints an R8MAT, transposed.
-
R8MAT_TRANSPOSE_PRINT_SOME prints some of an R8MAT, transposed.
-
R8MAT_UNIFORM_01 returns a unit pseudorandom R8MAT.
-
RANDOM_INITIALIZE initializes the RANDOM random number generator.
-
S_EQI reports whether two strings are equal, ignoring case.
-
S_LEN_TRIM returns the length of a string to the last nonblank.
-
S_TO_R8 reads an R8 from a string.
-
S_TO_R8VEC reads an R8VEC from a string.
-
TIMESTAMP prints the current YMDHMS date as a time stamp.
-
TIMESTRING returns the current YMDHMS date as a string.
-
TUPLE_NEXT_FAST computes the next element of a tuple space, "fast".
-
USER samples points in a user-specified region with given density.
You can go up one level to
the C++ source codes.
Last revised on 10 November 2006.