07-Jan-2022 17:58:18 ccvt_reflect_test(): MATLAB/Octave version 9.8.0.1380330 (R2020a) Update 2. Test ccvt_reflect(). ccvt_reflect(): MATLAB/Octave version 9.8.0.1380330 (R2020a) Update 2 Generate and animate a CVT dataset. 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, * INIT_STRING, initialize the points: ** file, read data from a file; ** 'GRID', by picking points from a grid; ** 'RAND', using MATLAB's RAND 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_STRING, how to conduct the sampling. ** 'GRID', by picking points from a grid; ** 'RAND', using MATLAB's RAND function; ** 'UNIFORM', using a simple uniform RNG; * SAMPLE_NUM, the number of sample points; * BATCH, the number of sampling points to create at one time; * MOVIE_NAME is the name of the file in which the movie is stored; * OUTPUT, a file into which the data is stored. 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: * * NDIM is the spatial dimension. NDIM = 2 N is the number of points to generate. User input N = 100 INIT_STRING is the method of initializing the data: file read data from a file; 'GRID' by picking points from a grid; 'RAND' using MATLAB's RAND function; 'UNIFORM' using a simple uniform RNG; User input INIT_STRING = "rand". User input INIT = "-1". 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. User input IT_MAX = 50 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. User input IT_FIXED = 1 SAMPLE_STRING is the method of sampling the region: 'GRID' by picking points from a grid; 'RAND' using MATLAB's RAND function; 'UNIFORM' using a simple uniform RNG; User input SAMPLE_STRING = "rand". Numeric value of SAMPLE = -1 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. User input SAMPLE_NUM = 100000 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. BATCH = 1000 MOVIE_NAME is the name of the file in which the movie is stored; User input MOVIE_NAME = ccvt_reflect_test.avi Deleting old copy of ccvt_reflect_test.avi FILE_DELETE: Deleting old version of "ccvt_reflect_test.avi". OUTPUT is a file into which the data is stored; OUTPUT = "generators.txt". Step Energy 0 3.356648e-03 FILE_DELETE: Deleting old version of "initial.eps". 0 3.359808e-03 1 2.322757e-03 2 2.065712e-03 3 1.947403e-03 4 1.896111e-03 5 1.853133e-03 6 1.826084e-03 7 1.813655e-03 8 1.796222e-03 9 1.786675e-03 10 1.786345e-03 11 1.787524e-03 12 1.785676e-03 13 1.775877e-03 14 1.781182e-03 15 1.775009e-03 16 1.772122e-03 17 1.776284e-03 18 1.771332e-03 19 1.765726e-03 20 1.767166e-03 21 1.771006e-03 22 1.775312e-03 23 1.772391e-03 24 1.767440e-03 25 1.771410e-03 26 1.766887e-03 27 1.774520e-03 28 1.771025e-03 29 1.773657e-03 30 1.766182e-03 31 1.771156e-03 32 1.770039e-03 33 1.771684e-03 34 1.765255e-03 35 1.772551e-03 36 1.776761e-03 37 1.778724e-03 38 1.777031e-03 39 1.772542e-03 40 1.782588e-03 41 1.776090e-03 42 1.770394e-03 43 1.775075e-03 44 1.773745e-03 45 1.775588e-03 46 1.774098e-03 47 1.772158e-03 48 1.771956e-03 49 1.775840e-03 50 1.779848e-03 The data was written to the file "generators.txt". FILE_DELETE: Deleting old version of "final.eps". ccvt_reflect(): Normal end of execution. ccvt_reflect_test(): Normal end of execution. 07-Jan-2022 17:59:06