17 November 2004 02:20:37 PM CVT_DATASET (C++ version) Generate a CVT dataset. Compiled on Nov 17 2004 at 14:20:19 This program is meant to be used interactively. It is also possible to prepare a simple input file beforehand and use it in batch mode. The program requests input values from the user: * NDIM, the spatial dimension, * N, the number of points to generate, * SEED, a seed to use for random number generation, * INIT, initialize the points: ** file, read data from a file; ** GRID, by picking points from a grid; ** HALTON, from a Halton sequence; ** RANDOM, using FORTRAN RANDOM function; ** UNIFORM, using a simple uniform RNG; * IT_MAX, the maximum number of iterations. * IT_FIXED, the number of iterative steps to take using a fixed set of sampling points. * SAMPLE, how to conduct the sampling. ** GRID, by picking points from a grid; ** HALTON, from a Halton sequence; ** RANDOM, using FORTRAN RANDOM function; ** UNIFORM, using a simple uniform RNG; * SAMPLE_NUM, the number of sample points. * BATCH, the number of sample points to generate at one time. * OUTPUT, a file to store the data. To indicate that no further computations are desired, it is enough to input a nonsensical value, such as -1. * * * Ready to generate a new dataset: * * Enter NDIM, the spatial dimension: (Try '2' if you have no preference.) (0 or any negative value terminates execution). User input NDIM = 2 Enter N, the number of points to generate: (Try '25' if you have no preference.) (0 or any negative value terminates execution). User input N = 85 Enter SEED, a seed for the random number generator: (Try '123456789' if you have no preference.) (Any negative value terminates execution). User input SEED = 123456789 INIT is the method of initializing the data: file read data from a file; GRID by picking points from a grid; HALTON from a Halton sequence; RANDOM using C++ RANDOM function; UNIFORM using a simple uniform RNG; (Try 'RANDOM' if you have no preference.) (A blank value terminates execution). Enter INIT: User input INIT = "uniform". IT_MAX is the maximum number of iterations. An iteration carries out the following steps: * the Voronoi region associated with each generator is estimated by sampling; * the centroid of each Voronoi region is estimated. * the generator is replaced by the centroid. If "enough" sampling points are used, and "enough" iterations are taken, this process will converge. (Try '50' if you have no preference.) (A negative value terminates execution). Enter IT_MAX: User input IT_MAX = 40 IT_FIXED is the number of consecutive iterations to take with a fixed set of sample points. Setting IT_FIXED to 1 means a new set of sample points is generated on every iterative step; Setting IT_FIXED equal to IT_MAX means a single set of sample points is used for the entire iteration. Any value between 1 and IT_MAX is reasonable. (Try 40 if you have no preference.) (A 0 or negative value terminates execution). Enter IT_FIXED: User input IT_FIXED = 1 SAMPLE is the method of sampling the region: GRID by picking points from a grid; HALTON from a Halton sequence; RANDOM using C++ RANDOM function; UNIFORM using a simple uniform RNG; (Try 'RANDOM' if you have no preference.) (A blank value terminates execution). Enter SAMPLE: User input SAMPLE = "uniform". SAMPLE_NUM is the number of sample points. The Voronoi regions will be explored by generating SAMPLE_NUM points. For each sample point, the nearest generator is found. Using more points gives a better estimate of these regions. SAMPLE_NUM should be much larger than N, the number of generators. (Try '10000' if you have no preference.) (A zero or negative value terminates execution.) Enter SAMPLE_NUM: User input SAMPLE_NUM = 10000 BATCH is the number of sample points to create at one time. BATCH should be between 1 and SAMPLE_NUM. It is FASTER to set BATCH to SAMPLE_NUM; setting BATCH to 1 requires the least memory. (Try 1000 if you have no preference.) (A zero or negative value terminates execution.) Enter BATCH: User input BATCH = 1000 OUTPUT is a file in which to store the data. (Try 'cvt.txt' if you have no preference.) (A blank value terminates execution). Enter OUTPUT: User input OUTPUT = "cvt01.txt". Step SEED L2-Change Energy 1 123456789 2.63343 0.00567678 2 1371189933 1.20676 0.00294377 3 167698528 0.747361 0.0024162 4 810642687 0.608425 0.00230607 5 2115448041 0.525887 0.00223183 6 1014499643 0.492438 0.00217929 7 423849826 0.433648 0.00212113 8 752429792 0.434178 0.00209994 9 298474852 0.411078 0.00212349 10 1918105164 0.368054 0.00209018 11 1911385472 0.36647 0.00209665 12 1687104020 0.368672 0.00207311 13 828010752 0.383287 0.00206387 14 208086644 0.396227 0.00205032 15 575172491 0.432565 0.00201325 16 416769270 0.359755 0.00202457 17 43259990 0.340147 0.00202607 18 1740240183 0.373812 0.00202418 19 1175442812 0.394904 0.00200648 20 247064883 0.370583 0.00201708 21 205095426 0.383315 0.00202107 22 394059613 0.370715 0.00202165 23 1911190393 0.339541 0.00200595 24 754175864 0.379981 0.00199974 25 1202424856 0.351568 0.00199386 26 2022640624 0.356419 0.00200102 27 1183868630 0.339256 0.00197444 28 2079653429 0.36196 0.00199217 29 455306254 0.383877 0.00198746 30 1844645248 0.35801 0.00197974 31 2024616065 0.400992 0.00199815 32 259282600 0.380771 0.00199956 33 1041953342 0.361123 0.00200075 34 748076581 0.352809 0.00198792 35 2037903258 0.370015 0.00197005 36 1677530359 0.380896 0.00198826 37 2043440774 0.350235 0.00199322 38 240211737 0.358982 0.00199813 39 1795085616 0.364725 0.00197572 40 2130219640 0.371167 0.00196883 The data was written to the file "cvt01.txt" * * * Ready to generate a new dataset: * * Enter NDIM, the spatial dimension: (Try '2' if you have no preference.) (0 or any negative value terminates execution). User input NDIM = -1 CVT_DATASET The input value of NDIM = -1 is interpreted as a request for termination. Normal end of execution. 17 November 2004 02:20:39 PM