18 December 2011 08:28:58 AM BINS_PRB C++ version Test the BINS library. TEST0676 R8_TO_BIN_EVEN2 puts a number into a bin. BIN_TO_R8_EVEN2 returns the bin limits. The bins are equally spaced between A and B. A = 10 B = 20 Total number of bins = 5 Generate some random values C and put them in bins. C Bin Bin_Min Bin_Max 17.6433 4 16 18 22.8375 5 18 20 21.8272 5 18 20 21.4913 5 18 20 16.5724 4 16 18 8.97934 1 10 12 12.8361 2 12 14 18.2768 5 18 20 19.8176 5 18 20 12.0413 2 12 14 10.2809 1 10 12 17.6143 4 16 18 15.9996 3 14 16 12.3925 2 12 14 18.4331 5 18 20 22.6731 5 18 20 18.8742 5 18 20 11.0632 1 10 12 11.3932 1 10 12 22.3005 5 18 20 11.3896 1 10 12 21.9336 5 18 20 9.91444 1 10 12 9.07007 1 10 12 22.6114 5 18 20 16.5208 4 16 18 11.2883 1 10 12 13.6938 2 12 14 19.4336 5 18 20 22.1056 5 18 20 TEST0835 R82VEC_PART_QUICK_A reorders an R2 vector as part of a quick sort. Using initial random number seed = 123456789 Before rearrangment: 0 2.18418 2.95632 1 8.29509 2.5617 2 4.15307 2.06612 3 2.57578 2.10996 4 0.43829 2.63397 5 0.617272 2.44954 6 4.01306 2.75467 7 7.97287 2.00184 8 8.97504 2.35075 9 0.945448 2.01362 10 8.59097 2.84085 11 1.23104 2.00751 Rearranged array Left index = 4 Key index = 5 Right index = 6 Left half: 0 1.23104 2.00751 1 0.945448 2.01362 2 0.617272 2.44954 3 0.43829 2.63397 Key: 0 2.18418 2.95632 Right half: 0 4.01306 2.75467 1 7.97287 2.00184 2 8.97504 2.35075 3 2.57578 2.10996 4 8.59097 2.84085 5 4.15307 2.06612 6 8.29509 2.5617 TEST0836 D2VEC_SORT_QUICK_A sorts an R2 vector as part of a quick sort. Using initial random number seed = 123456789 Before sorting: 0 2.18418 2.95632 1 8.29509 2.5617 2 0.43829 2.06612 3 1.23104 2.10996 4 0.43829 2.63397 5 0.617272 2.44954 6 8.59097 2.84085 7 7.97287 2.00184 8 8.97504 2.35075 9 0.945448 2.01362 10 8.59097 2.84085 11 1.23104 2.00751 Sorted array: 0 0.43829 2.06612 1 0.43829 2.63397 2 0.617272 2.44954 3 0.945448 2.01362 4 1.23104 2.00751 5 1.23104 2.10996 6 2.18418 2.95632 7 7.97287 2.00184 8 8.29509 2.5617 9 8.59097 2.84085 10 8.59097 2.84085 11 8.97504 2.35075 TEST180 SORT_HEAP_EXTERNAL sorts objects externally. Unsorted array: 0 5 1 20 2 17 3 12 4 9 5 2 6 6 7 3 8 1 9 13 10 2 11 9 12 9 13 16 14 16 15 1 16 18 17 8 18 2 19 1 Sorted array: 0 5 1 0 2 1 3 1 4 1 5 2 6 2 7 2 8 3 9 6 10 8 11 9 12 9 13 9 14 12 15 13 16 16 17 16 18 17 19 18 BINS_PRB Normal end of execution. 18 December 2011 08:28:58 AM