14 September 2021 10:27:45.724 AM R8COL_TEST FORTRAN90 version Test the R8COL library. I4_LOG_10_TEST I4_LOG_10: whole part of log base 10, X, I4_LOG_10 0 0 1 0 2 0 3 0 9 0 10 1 11 1 99 1 101 2 -1 0 -2 0 -3 0 -9 0 I4VEC_PRINT_TEST I4VEC_PRINT prints an I4VEC The I4VEC: 1: 91 2: 92 3: 93 4: 94 R8COL_FIND_TEST For an R8COL; R8COL_FIND seeks a column matching given data. R8COL_FIND returns ICOL = 3 R8COL_INSERT_TEST For an R8COL; R8COL_INSERT inserts new columns. The unsorted matrix: Col 1 2 3 4 Row 1: 2. 4. 1. 3. 2: 6. 8. 5. 7. 3: 10. 12. 9. 11. The sorted matrix: Col 1 2 3 4 Row 1: 1. 2. 3. 4. 2: 5. 6. 7. 8. 3: 9. 10. 11. 12. New column: 1: 3.0000000 2: 7.0000000 3: 11.000000 The data was already in column 3 New column: 1: 3.0000000 2: 4.0000000 3: 18.000000 The updated matrix: Col 1 2 3 4 5 Row 1: 1. 2. 3. 3. 4. 2: 5. 6. 4. 7. 8. 3: 9. 10. 18. 11. 12. R8COL_MAX_TEST R8COL_MAX computes maximums of an R8COL; The array: Col 1 2 3 4 Row 1: 1. 2. 3. 4. 2: 5. 6. 7. 8. 3: 9. 10. 11. 12. The column maximums: 1: 9.0000000 2: 10.000000 3: 11.000000 4: 12.000000 R8COL_MEAN_TEST For an R8COL; R8COL_MEAN computes means; The array: Col 1 2 3 4 Row 1: 1. 2. 3. 4. 2: 5. 6. 7. 8. 3: 9. 10. 11. 12. The column means: 1: 5.0000000 2: 6.0000000 3: 7.0000000 4: 8.0000000 R8COL_MIN_TEST R8COL_MIN computes minimums of an R8COL; The array: Col 1 2 3 4 Row 1: 1. 2. 3. 4. 2: 5. 6. 7. 8. 3: 9. 10. 11. 12. The column minimums: 1: 1.0000000 2: 2.0000000 3: 3.0000000 4: 4.0000000 R8COL_PART_QUICK_A_TEST For an R8COL; R8COL_PART_QUICK_A partitions the matrix. The matrix: Col 1 2 3 4 5 Row 1: 2. 8. 6. 0. 10. 2: 4. 8. 2. 2. 6. Col 6 7 8 Row 1: 10. 0. 5. 2: 0. 6. 8. L = 2 R = 4 The partitioned matrix: Col 1 2 3 4 5 Row 1: 0. 0. 2. 10. 10. 2: 6. 2. 4. 6. 0. Col 6 7 8 Row 1: 6. 5. 8. 2: 2. 8. 8. R8COL_PERMUTE_TEST R8COL_PERMUTE permutes an R8COL in place. A (unpermuted) Col 1 2 3 4 5 Row 1: 11. 12. 13. 14. 15. 2: 21. 22. 23. 24. 25. 3: 31. 32. 33. 34. 35. The (column) permutation vector: 1: 2 2: 4 3: 5 4: 1 5: 3 A (permuted) Col 1 2 3 4 5 Row 1: 12. 14. 15. 11. 13. 2: 22. 24. 25. 21. 23. 3: 32. 34. 35. 31. 33. R8COL_SORT_HEAP_A_TEST For an R8COL; R8COL_SORT_HEAP_A does an ascending heap sort The unsorted matrix: Col 1 2 3 4 Row 1: 2. 4. 1. 3. 2: 6. 8. 5. 7. 3: 10. 12. 9. 11. The sorted matrix: Col 1 2 3 4 Row 1: 1. 2. 3. 4. 2: 5. 6. 7. 8. 3: 9. 10. 11. 12. R8COL_SORT_HEAP_INDEX_A_TEST R8COL_SORT_HEAP_INDEX_A computes an index vector which ascending sorts an R8COL. The unsorted R8COL (transposed): Row 1 2 3 Col 1: 2.00000 6.00000 10.0000 2: 4.00000 8.00000 12.0000 3: 1.00000 5.00000 9.00000 4: 3.00000 7.00000 11.0000 5: 2.00000 6.00000 0.00000 6: 3.00000 4.00000 18.0000 7: 0.00000 0.00000 0.00000 8: 0.00000 6.00000 10.0000 9: 2.00000 6.00000 10.0000 10: 3.00000 7.00000 11.0000 11: 2.00000 0.00000 10.0000 12: 2.00000 6.00000 10.0000 13: 1.00000 5.00000 9.00000 14: 1.00000 5.00000 9.10000 15: 1.00000 5.10000 9.00000 The implicitly sorted R8COL (transposed) 7: 0.0 0.0 0.0 8: 0.0 6.0 10.0 13: 1.0 5.0 9.0 3: 1.0 5.0 9.0 14: 1.0 5.0 9.1 15: 1.0 5.1 9.0 11: 2.0 0.0 10.0 5: 2.0 6.0 0.0 12: 2.0 6.0 10.0 9: 2.0 6.0 10.0 1: 2.0 6.0 10.0 6: 3.0 4.0 18.0 10: 3.0 7.0 11.0 4: 3.0 7.0 11.0 2: 4.0 8.0 12.0 R8COL_SORT_QUICK_A_TEST For an R8COL; R8COL_SORT_QUICK_A does a quicksort. The unsorted matrix: Col 1 2 3 4 5 Row 1: 1.50585 4.90937 9.34793 6.64983 2.94263 2: 0.853304 9.87915 9.61539 6.64787 1.36917 3: 2.36845 7.20653 7.54403 5.13943 6.45996 Col 6 7 8 9 10 Row 1: 6.64313 5.19252 5.34818 4.42663 3.92025 2: 4.76009 8.22025 4.36331 9.95145 7.13322 3: 0.638773 4.05604 4.77394 0.956224E-01 6.36350 The sorted matrix: Col 1 2 3 4 5 Row 1: 1.50585 2.94263 3.92025 4.42663 4.90937 2: 0.853304 1.36917 7.13322 9.95145 9.87915 3: 2.36845 6.45996 6.36350 0.956224E-01 7.20653 Col 6 7 8 9 10 Row 1: 5.19252 5.34818 6.64313 6.64983 9.34793 2: 8.22025 4.36331 4.76009 6.64787 9.61539 3: 4.05604 4.77394 0.638773 5.13943 7.54403 R8COL_SORTED_TOL_UNIQUE_TEST R8COL_SORTED_TOL_UNIQUE finds tolerably unique columns in a sorted R8COL. The unsorted R8COL (transposed): Row 1 2 3 Col 1: 1.90000 0.00000 10.0000 2: 2.00000 6.00000 10.0000 3: 4.00000 8.00000 12.0000 4: 1.00000 5.00000 9.00000 5: 3.00000 7.00000 11.0000 6: 2.00000 6.00000 0.00000 7: 2.00000 0.00000 10.1000 8: 2.00000 0.100000 10.0000 9: 3.00000 4.00000 18.0000 10: 1.90000 8.00000 10.0000 11: 0.00000 0.00000 0.00000 12: 0.00000 6.00000 10.0000 13: 2.10000 0.00000 10.0000 14: 2.00000 6.00000 10.0000 15: 3.00000 7.00000 11.0000 16: 2.00000 0.00000 10.0000 17: 2.00000 0.00000 10.0000 18: 2.00000 6.00000 10.0000 19: 1.00000 5.00000 9.00000 20: 2.00000 0.00000 10.1000 21: 1.00000 5.00000 9.10000 22: 1.00000 5.10000 9.00000 The sorted R8COL (transposed): Row 1 2 3 Col 1: 0.00000 0.00000 0.00000 2: 0.00000 6.00000 10.0000 3: 1.00000 5.00000 9.00000 4: 1.00000 5.00000 9.00000 5: 1.00000 5.00000 9.10000 6: 1.00000 5.10000 9.00000 7: 1.90000 0.00000 10.0000 8: 1.90000 8.00000 10.0000 9: 2.00000 0.00000 10.0000 10: 2.00000 0.00000 10.0000 11: 2.00000 0.00000 10.1000 12: 2.00000 0.00000 10.1000 13: 2.00000 0.100000 10.0000 14: 2.00000 6.00000 0.00000 15: 2.00000 6.00000 10.0000 16: 2.00000 6.00000 10.0000 17: 2.00000 6.00000 10.0000 18: 2.10000 0.00000 10.0000 19: 3.00000 4.00000 18.0000 20: 3.00000 7.00000 11.0000 21: 3.00000 7.00000 11.0000 22: 4.00000 8.00000 12.0000 Using tolerance = 0.250000 Number of tolerably unique columns is 10 The sorted tolerably unique R8COL (transposed): Row 1 2 3 Col 1: 0.00000 0.00000 0.00000 2: 0.00000 6.00000 10.0000 3: 1.00000 5.00000 9.00000 4: 1.90000 0.00000 10.0000 5: 1.90000 8.00000 10.0000 6: 2.00000 6.00000 0.00000 7: 2.00000 6.00000 10.0000 8: 3.00000 4.00000 18.0000 9: 3.00000 7.00000 11.0000 10: 4.00000 8.00000 12.0000 R8COL_SORTED_TOL_UNIQUE_COUNT_TEST R8COL_SORTED_TOL_UNIQUE_COUNT counts tolerably unique columns in a sorted R8COL. The unsorted R8COL (transposed): Row 1 2 3 Col 1: 1.90000 0.00000 10.0000 2: 2.00000 6.00000 10.0000 3: 4.00000 8.00000 12.0000 4: 1.00000 5.00000 9.00000 5: 3.00000 7.00000 11.0000 6: 2.00000 6.00000 0.00000 7: 2.00000 0.00000 10.1000 8: 2.00000 0.100000 10.0000 9: 3.00000 4.00000 18.0000 10: 1.90000 8.00000 10.0000 11: 0.00000 0.00000 0.00000 12: 0.00000 6.00000 10.0000 13: 2.10000 0.00000 10.0000 14: 2.00000 6.00000 10.0000 15: 3.00000 7.00000 11.0000 16: 2.00000 0.00000 10.0000 17: 2.00000 0.00000 10.0000 18: 2.00000 6.00000 10.0000 19: 1.00000 5.00000 9.00000 20: 2.00000 0.00000 10.1000 21: 1.00000 5.00000 9.10000 22: 1.00000 5.10000 9.00000 The sorted R8COL (transposed): Row 1 2 3 Col 1: 0.00000 0.00000 0.00000 2: 0.00000 6.00000 10.0000 3: 1.00000 5.00000 9.00000 4: 1.00000 5.00000 9.00000 5: 1.00000 5.00000 9.10000 6: 1.00000 5.10000 9.00000 7: 1.90000 0.00000 10.0000 8: 1.90000 8.00000 10.0000 9: 2.00000 0.00000 10.0000 10: 2.00000 0.00000 10.0000 11: 2.00000 0.00000 10.1000 12: 2.00000 0.00000 10.1000 13: 2.00000 0.100000 10.0000 14: 2.00000 6.00000 0.00000 15: 2.00000 6.00000 10.0000 16: 2.00000 6.00000 10.0000 17: 2.00000 6.00000 10.0000 18: 2.10000 0.00000 10.0000 19: 3.00000 4.00000 18.0000 20: 3.00000 7.00000 11.0000 21: 3.00000 7.00000 11.0000 22: 4.00000 8.00000 12.0000 Using tolerance = 0.250000 Number of tolerably unique columns is 10 R8COL_SORTED_TOL_UNDEX_TEST R8COL_SORTED_TOL_UNDEX produces index vectors which create a sorted list of the tolerably unique columns of a sorted R8COL, and a map from the original R8COL to the (implicit) R8COL of sorted tolerably unique elements. The unsorted R8COL (transposed): Row 1 2 3 Col 1: 1.90000 0.00000 10.0000 2: 2.00000 6.00000 10.0000 3: 4.00000 8.00000 12.0000 4: 1.00000 5.00000 9.00000 5: 3.00000 7.00000 11.0000 6: 2.00000 6.00000 0.00000 7: 2.00000 0.00000 10.1000 8: 2.00000 0.100000 10.0000 9: 3.00000 4.00000 18.0000 10: 1.90000 8.00000 10.0000 11: 0.00000 0.00000 0.00000 12: 0.00000 6.00000 10.0000 13: 2.10000 0.00000 10.0000 14: 2.00000 6.00000 10.0000 15: 3.00000 7.00000 11.0000 16: 2.00000 0.00000 10.0000 17: 2.00000 0.00000 10.0000 18: 2.00000 6.00000 10.0000 19: 1.00000 5.00000 9.00000 20: 2.00000 0.00000 10.1000 21: 1.00000 5.00000 9.10000 22: 1.00000 5.10000 9.00000 The sorted R8COL (transposed): Row 1 2 3 Col 1: 0.00000 0.00000 0.00000 2: 0.00000 6.00000 10.0000 3: 1.00000 5.00000 9.00000 4: 1.00000 5.00000 9.00000 5: 1.00000 5.00000 9.10000 6: 1.00000 5.10000 9.00000 7: 1.90000 0.00000 10.0000 8: 1.90000 8.00000 10.0000 9: 2.00000 0.00000 10.0000 10: 2.00000 0.00000 10.0000 11: 2.00000 0.00000 10.1000 12: 2.00000 0.00000 10.1000 13: 2.00000 0.100000 10.0000 14: 2.00000 6.00000 0.00000 15: 2.00000 6.00000 10.0000 16: 2.00000 6.00000 10.0000 17: 2.00000 6.00000 10.0000 18: 2.10000 0.00000 10.0000 19: 3.00000 4.00000 18.0000 20: 3.00000 7.00000 11.0000 21: 3.00000 7.00000 11.0000 22: 4.00000 8.00000 12.0000 Tolerance for equality = 0.250000 Number of tolerably unique columns is 10 XDNU points to the representative for each item. UNDX selects the representatives. I XDNU UNDX 1 1 1 2 2 2 3 3 3 4 3 7 5 3 8 6 3 14 7 4 15 8 5 19 9 4 20 10 4 22 11 4 12 4 13 4 14 6 15 7 16 7 17 7 18 4 19 8 20 9 21 9 22 10 The tolerably unique R8COL (transposed): Row 1 2 3 Col 1: 0.00000 0.00000 0.00000 2: 0.00000 6.00000 10.0000 3: 1.00000 5.00000 9.00000 4: 1.90000 0.00000 10.0000 5: 1.90000 8.00000 10.0000 6: 2.00000 6.00000 0.00000 7: 2.00000 6.00000 10.0000 8: 3.00000 4.00000 18.0000 9: 3.00000 7.00000 11.0000 10: 4.00000 8.00000 12.0000 R8COL_SORTR_A_TEST R8COL_SORTR_A is given an array, and reorders it so that a particular column is sorted. Here, the special column is 2 Unsorted array: Col 1 2 3 Row 1: 3.43208 3.90138 1.20554 2: 7.82456 9.32683 5.20520 3: 2.60880 0.594310 2.00087 4: 0.947926 2.00868 1.96245 5: 1.28408 2.32851 0.765612 6: 7.52655 9.17168 0.847828 7: 9.01119 2.53937 4.39430 8: 7.88288 9.06828 1.43825 9: 6.18142 0.841361 0.263702 10: 1.45228 4.81168 0.760004 Sorted array: Col 1 2 3 Row 1: 2.60880 0.594310 2.00087 2: 6.18142 0.841361 0.263702 3: 0.947926 2.00868 1.96245 4: 1.28408 2.32851 0.765612 5: 9.01119 2.53937 4.39430 6: 3.43208 3.90138 1.20554 7: 1.45228 4.81168 0.760004 8: 7.88288 9.06828 1.43825 9: 7.52655 9.17168 0.847828 10: 7.82456 9.32683 5.20520 R8COL_SUM_TEST For an R8COL; R8COL_SUM computes sums; The array: Col 1 2 3 4 Row 1: 1. 2. 3. 4. 2: 5. 6. 7. 8. 3: 9. 10. 11. 12. The column sums: 1: 15.000000 2: 18.000000 3: 21.000000 4: 24.000000 R8COL_SWAP_TEST R8COL_SWAP swaps two columns of an R8COL; The array: Col 1 2 3 4 Row 1: 11. 12. 13. 14. 2: 21. 22. 23. 24. 3: 31. 32. 33. 34. Swap columns 1 and 3 The updated matrix: Col 1 2 3 4 Row 1: 13. 12. 11. 14. 2: 23. 22. 21. 24. 3: 33. 32. 31. 34. R8COL_TO_R8VEC_TEST R8COL_TO_R8VEC converts an array of columns to a vector. The array of columns: Col 1 2 3 4 Row 1: 11. 12. 13. 14. 2: 21. 22. 23. 24. 3: 31. 32. 33. 34. The resulting vector of columns: 1: 11.000000 2: 21.000000 3: 31.000000 4: 12.000000 5: 22.000000 6: 32.000000 7: 13.000000 8: 23.000000 9: 33.000000 10: 14.000000 11: 24.000000 12: 34.000000 R8COL_TOL_UNDEX_TEST R8COL_TOL_UNDEX produces index vectors which create a sorted list of the tolerably unique columns of an R8COL, and a map from the original R8COL to the (implicit) R8COL of sorted tolerably unique elements. The unsorted R8COL (transposed): Row 1 2 3 Col 1: 1.90000 0.00000 10.0000 2: 2.00000 6.00000 10.0000 3: 4.00000 8.00000 12.0000 4: 1.00000 5.00000 9.00000 5: 3.00000 7.00000 11.0000 6: 2.00000 6.00000 0.00000 7: 2.00000 0.00000 10.1000 8: 2.00000 0.100000 10.0000 9: 3.00000 4.00000 18.0000 10: 1.90000 8.00000 10.0000 11: 0.00000 0.00000 0.00000 12: 0.00000 6.00000 10.0000 13: 2.10000 0.00000 10.0000 14: 2.00000 6.00000 10.0000 15: 3.00000 7.00000 11.0000 16: 2.00000 0.00000 10.0000 17: 2.00000 0.00000 10.0000 18: 2.00000 6.00000 10.0000 19: 1.00000 5.00000 9.00000 20: 2.00000 0.00000 10.1000 21: 1.00000 5.00000 9.10000 22: 1.00000 5.10000 9.00000 Tolerance for equality = 0.250000 Number of tolerably unique columns is 10 XDNU points to the representative for each item. UNDX selects the representatives. I XDNU UNDX 1 4 11 2 7 12 3 10 19 4 3 1 5 9 10 6 6 6 7 4 14 8 4 9 9 8 15 10 5 3 11 1 12 2 13 4 14 7 15 9 16 4 17 4 18 7 19 3 20 4 21 3 22 3 The tolerably unique R8COL (transposed): Row 1 2 3 Col 1: 0.00000 0.00000 0.00000 2: 0.00000 6.00000 10.0000 3: 1.00000 5.00000 9.00000 4: 1.90000 0.00000 10.0000 5: 1.90000 8.00000 10.0000 6: 2.00000 6.00000 0.00000 7: 2.00000 6.00000 10.0000 8: 3.00000 4.00000 18.0000 9: 3.00000 7.00000 11.0000 10: 4.00000 8.00000 12.0000 R8COL_UNDEX_TEST R8COL_UNDEX produces index vectors which create a sorted list of the unique columns of an (unsorted) R8COL, and a map from the original R8COL to the (implicit) R8COL of sorted unique elements. The R8COL (transposed): Row 1 2 3 Col 1: 2.00000 6.00000 10.0000 2: 4.00000 8.00000 12.0000 3: 1.00000 5.00000 9.00000 4: 3.00000 7.00000 11.0000 5: 2.00000 6.00000 0.00000 6: 3.00000 4.00000 18.0000 7: 0.00000 0.00000 0.00000 8: 0.00000 6.00000 10.0000 9: 2.00000 6.00000 10.0000 10: 3.00000 7.00000 11.0000 11: 2.00000 0.00000 10.0000 12: 2.00000 6.00000 10.0000 13: 1.00000 5.00000 9.00000 14: 1.00000 5.00000 9.10000 15: 1.00000 5.10000 9.00000 Number of unique columns is 11 XDNU points to the representative for each item. UNDX selects the representatives. I XDNU UNDX 1 8 7 2 11 8 3 3 13 4 10 14 5 7 15 6 9 11 7 1 5 8 2 12 9 8 6 10 10 10 11 6 2 12 8 13 3 14 4 15 5 The Unique R8COL (transposed): Row 1 2 3 Col 1: 0.00000 0.00000 0.00000 2: 0.00000 6.00000 10.0000 3: 1.00000 5.00000 9.00000 4: 1.00000 5.00000 9.10000 5: 1.00000 5.10000 9.00000 6: 2.00000 0.00000 10.0000 7: 2.00000 6.00000 0.00000 8: 2.00000 6.00000 10.0000 9: 3.00000 4.00000 18.0000 10: 3.00000 7.00000 11.0000 11: 4.00000 8.00000 12.0000 R8COL_UNIQUE_COUNT_TEST R8COL_UNIQUE_COUNT counts unique columns in an unsorted R8COL. The R8COL (transposed): Row 1 2 3 Col 1: 2.00000 6.00000 10.0000 2: 4.00000 8.00000 12.0000 3: 1.00000 5.00000 9.00000 4: 3.00000 7.00000 11.0000 5: 2.00000 6.00000 0.00000 6: 3.00000 4.00000 18.0000 7: 0.00000 0.00000 0.00000 8: 0.00000 6.00000 10.0000 9: 2.00000 6.00000 10.0000 10: 3.00000 7.00000 11.0000 11: 2.00000 0.00000 10.0000 12: 2.00000 6.00000 10.0000 13: 1.00000 5.00000 9.00000 14: 1.00000 5.00000 9.10000 15: 1.00000 5.10000 9.00000 Number of unique columns is 11 R8COL_VARIANCE_TEST R8COL_VARIANCE computes variances of an R8COL; The array: Col 1 2 3 4 Row 1: 1. 2. 3. 4. 2: 5. 6. 7. 8. 3: 9. 10. 11. 12. Column variance: 1 16.0000 2 16.0000 3 16.0000 4 16.0000 R8COL_TEST Normal end of execution. 14 September 2021 10:27:45.725 AM