14-Aug-2022 11:23:01 r8col_test(): MATLAB/Octave version 9.8.0.1380330 (R2020a) Update 2 Test r8col() 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_indicator1_test(): i4vec_indicator1() returns an indicator vector. The "indicator1" vector: 1: 1 2: 2 3: 3 4: 4 5: 5 6: 6 7: 7 8: 8 9: 9 10: 10 i4vec_print_test(): i4vec_print() prints an I4VEC The I4VEC: 1: 91 2: 92 3: 93 4: 94 i4vec_transpose_print_test(): i4vec_transpose_print() prints an integer vector with 5 entries to a row, and a title. Output from I4VEC_PRINT: 1: 1 2: 2 3: 3 4: 4 5: 5 6: 6 7: 7 8: 8 9: 9 10: 10 11: 11 12: 12 My array: 1 2 3 4 5 6 7 8 9 10 11 12 perm1_check_test(): perm1_check() checks a permutation of 1,...,N. Permutation 1: 5 2 3 4 1 Permutation 2: 4 1 3 0 2 PERM1_CHECK - Warning! Permutation is missing the value 5. Permutation 3: 0 2 1 3 2 PERM1_CHECK - Warning! Permutation is missing the value 4. r8col_find_test(): r8col_find() finds a column in a table matching a given set of data. R8COL_FIND returns ICOL = 3 r8col_indicator_test(): r8col_indicator() returns an indicator matrix. Indicator matrix: Col: 1 2 3 4 Row 1 : 11 12 13 14 2 : 21 22 23 24 3 : 31 32 33 34 4 : 41 42 43 44 5 : 51 52 53 54 R8COL_INSERT_TEST 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 2: 7 3: 11 The data was already in column 3 New column: 1: 3 2: 4 3: 18 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 For an R8COL, an array of column vectors; R8COL_MAX computes maximums; The array: Col: 1 2 3 4 Row 1 : 1 2 3 4 2 : 5 6 7 8 3 : 9 10 11 12 Column maximums: 1: 3 2: 3 3: 3 4: 3 R8COL_MEAN_TEST For an R8COL, an array of column vectors; 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 Column means: 1: 5 2: 6 3: 7 4: 8 R8COL_MIN_TEST For an R8COL, an array of column vectors; R8COL_MIN computes minimums; The array: Col: 1 2 3 4 Row 1 : 1 2 3 4 2 : 5 6 7 8 3 : 9 10 11 12 Column minimums: 1: 1 2: 2 3: 3 4: 4 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_PRINT_TEST R8COL_PRINT prints an R8COL. The R8COL matrix of columns: Col: 1 2 3 4 Row 1 : 11 12 13 14 2 : 21 22 23 24 3 : 31 32 33 34 4 : 41 42 43 44 5 : 51 52 53 54 6 : 61 62 63 64 R8COL_PRINT_SOME_TEST R8COL_PRINT_SOME prints some of an R8COL. The R8COL, rows 2:4, cols 1:2: Col: 1 2 Row 2 : 21 22 3 : 31 32 4 : 41 42 R8COL_SORT_HEAP_A_TEST R8COL_SORT_HEAP_A ascending heap sorts a table of 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 2: 7 3: 11 The data was already in column 3 New column: 1: 3 2: 4 3: 18 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_SORT_HEAP_INDEX_A_TEST R8COL_SORT_HEAP_INDEX_A computes an index vector which ascending heap sorts an R8COL. The unsorted R8COL (transposed): Row: 1 2 3 Col 1: 2 6 10 2: 4 8 12 3: 1 5 9 4: 3 7 11 5: 2 6 0 6: 3 4 18 7: 0 0 0 8: 0 6 10 9: 2 6 10 10: 3 7 11 11: 2 0 10 12: 2 6 10 13: 1 5 9 14: 1 5 9.1 15: 1 5.1 9 The (implicitly) sorted R8COL (transposed) 2: 4.000000 8.000000 12.000000 3: 1.000000 5.000000 9.000000 4: 3.000000 7.000000 11.000000 5: 2.000000 6.000000 0.000000 6: 3.000000 4.000000 18.000000 7: 0.000000 0.000000 0.000000 8: 0.000000 6.000000 10.000000 9: 2.000000 6.000000 10.000000 10: 3.000000 7.000000 11.000000 11: 2.000000 0.000000 10.000000 12: 2.000000 6.000000 10.000000 13: 1.000000 5.000000 9.000000 14: 1.000000 5.000000 9.100000 15: 1.000000 5.100000 9.000000 1: 2.000000 6.000000 10.000000 R8COL_SORT_QUICK_A_TEST R8COL_SORT_QUICK_A sorts a table of columns. The unsorted matrix: Col: 1 2 3 4 5 Row 1 : 8.14724 9.13376 2.78498 9.64889 9.57167 2 : 9.05792 6.32359 5.46882 1.57613 4.85376 3 : 1.26987 0.975404 9.57507 9.70593 8.0028 Col: 6 7 8 9 10 Row 1 : 1.41886 7.92207 0.357117 6.78735 3.92227 2 : 4.21761 9.59492 8.49129 7.5774 6.55478 3 : 9.15736 6.55741 9.33993 7.43132 1.71187 The sorted matrix: Col: 1 2 3 4 5 Row 1 : 0.357117 1.41886 2.78498 3.92227 6.78735 2 : 8.49129 4.21761 5.46882 6.55478 7.5774 3 : 9.33993 9.15736 9.57507 1.71187 7.43132 Col: 6 7 8 9 10 Row 1 : 7.92207 8.14724 9.13376 9.57167 9.64889 2 : 9.59492 9.05792 6.32359 4.85376 1.57613 3 : 6.55741 1.26987 0.975404 8.0028 9.70593 R8COL_SORTED_TOL_UNIQUE_TEST R8COL_SORTED_TOL_UNIQUE returns tolerably unique columns in a sorted R8COL. The unsorted R8COL (transposed): Row: 1 2 3 Col 1: 1.9 0 10 2: 2 6 10 3: 4 8 12 4: 1 5 9 5: 3 7 11 6: 2 6 0 7: 2 0 10.1 8: 2 0.1 10 9: 3 4 18 10: 1.9 8 10 11: 0 0 0 12: 0 6 10 13: 2.1 0 10 14: 2 6 10 15: 3 7 11 16: 2 0 10 17: 2 0 10 18: 2 6 10 19: 1 5 9 20: 2 0 10.1 21: 1 5 9.1 22: 1 5.1 9 The sorted R8COL (transposed): Row: 1 2 3 Col 1: 0 0 0 2: 0 6 10 3: 1 5 9 4: 1 5 9 5: 1 5 9.1 6: 1 5.1 9 7: 1.9 0 10 8: 1.9 8 10 9: 2 0 10 10: 2 0 10 11: 2 0 10.1 12: 2 0 10.1 13: 2 0.1 10 14: 2 6 0 15: 2 6 10 16: 2 6 10 17: 2 6 10 18: 2.1 0 10 19: 3 4 18 20: 3 7 11 21: 3 7 11 22: 4 8 12 Equality tolerance set to 2.500000e-01 Number of tolerably unique columns is 10 The tolerably unique sorted R8COL (transposed): Row: 1 2 3 Col 1: 0 0 0 2: 0 6 10 3: 1 5 9 4: 1.9 0 10 5: 1.9 8 10 6: 2 6 0 7: 2 6 10 8: 3 4 18 9: 3 7 11 10: 4 8 12 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.9 0 10 2: 2 6 10 3: 4 8 12 4: 1 5 9 5: 3 7 11 6: 2 6 0 7: 2 0 10.1 8: 2 0.1 10 9: 3 4 18 10: 1.9 8 10 11: 0 0 0 12: 0 6 10 13: 2.1 0 10 14: 2 6 10 15: 3 7 11 16: 2 0 10 17: 2 0 10 18: 2 6 10 19: 1 5 9 20: 2 0 10.1 21: 1 5 9.1 22: 1 5.1 9 The sorted R8COL (transposed): Row: 1 2 3 Col 1: 0 0 0 2: 0 6 10 3: 1 5 9 4: 1 5 9 5: 1 5 9.1 6: 1 5.1 9 7: 1.9 0 10 8: 1.9 8 10 9: 2 0 10 10: 2 0 10 11: 2 0 10.1 12: 2 0 10.1 13: 2 0.1 10 14: 2 6 0 15: 2 6 10 16: 2 6 10 17: 2 6 10 18: 2.1 0 10 19: 3 4 18 20: 3 7 11 21: 3 7 11 22: 4 8 12 Equality tolerance set to 2.500000e-01 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.9 0 10 2: 2 6 10 3: 4 8 12 4: 1 5 9 5: 3 7 11 6: 2 6 0 7: 2 0 10.1 8: 2 0.1 10 9: 3 4 18 10: 1.9 8 10 11: 0 0 0 12: 0 6 10 13: 2.1 0 10 14: 2 6 10 15: 3 7 11 16: 2 0 10 17: 2 0 10 18: 2 6 10 19: 1 5 9 20: 2 0 10.1 21: 1 5 9.1 22: 1 5.1 9 The sorted R8COL (transposed): Row: 1 2 3 Col 1: 0 0 0 2: 0 6 10 3: 1 5 9 4: 1 5 9 5: 1 5 9.1 6: 1 5.1 9 7: 1.9 0 10 8: 1.9 8 10 9: 2 0 10 10: 2 0 10 11: 2 0 10.1 12: 2 0 10.1 13: 2 0.1 10 14: 2 6 0 15: 2 6 10 16: 2 6 10 17: 2 6 10 18: 2.1 0 10 19: 3 4 18 20: 3 7 11 21: 3 7 11 22: 4 8 12 Tolerance for equality is 2.500000e-01 Number of unique entries in X is 10 XDNU points to the representative for each item. UNDX selects the representatives.. 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 0 0 2: 0 6 10 3: 1 5 9 4: 1.9 0 10 5: 1.9 8 10 6: 2 6 0 7: 2 6 10 8: 3 4 18 9: 3 7 11 10: 4 8 12 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 : 7.06046 4.38744 2.76025 2 : 0.318328 3.81558 6.79703 3 : 2.76923 7.65517 6.55098 4 : 0.461714 7.952 1.62612 5 : 0.971318 1.86873 1.18998 6 : 8.23458 4.89764 4.98364 7 : 6.94829 4.45586 9.59744 8 : 3.17099 6.46313 3.40386 9 : 9.50222 7.09365 5.85268 10 : 0.344461 7.54687 2.23812 Sorted array: Col: 1 2 3 Row 1 : 0.971318 1.86873 1.18998 2 : 0.318328 3.81558 6.79703 3 : 7.06046 4.38744 2.76025 4 : 6.94829 4.45586 9.59744 5 : 8.23458 4.89764 4.98364 6 : 3.17099 6.46313 3.40386 7 : 9.50222 7.09365 5.85268 8 : 0.344461 7.54687 2.23812 9 : 2.76923 7.65517 6.55098 10 : 0.461714 7.952 1.62612 R8COL_SUM_TEST For an R8COL, an array of column vectors; 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 2: 18 3: 21 4: 24 R8COL_SWAP_TEST For an R8COL, an array of column vectors; R8COL_SWAP swaps two columns; 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 2: 21 3: 31 4: 12 5: 22 6: 32 7: 13 8: 23 9: 33 10: 14 11: 24 12: 34 R8COL_TOL_UNDEX_TEST R8COL_TOL_UNDEX produces index vectors which create a sorted list of the tolerably unique columns of an (unsorted) R8COL, and a map from the original R8COL to the (implicit) R8COL of sorted unique elements. The unsorted R8COL (transposed): Row: 1 2 3 Col 1: 1.9 0 10 2: 2 6 10 3: 4 8 12 4: 1 5 9 5: 3 7 11 6: 2 6 0 7: 2 0 10.1 8: 2 0.1 10 9: 3 4 18 10: 1.9 8 10 11: 0 0 0 12: 0 6 10 13: 2.1 0 10 14: 2 6 10 15: 3 7 11 16: 2 0 10 17: 2 0 10 18: 2 6 10 19: 1 5 9 20: 2 0 10.1 21: 1 5 9.1 22: 1 5.1 9 Tolerance for equality = 0.250000 Number of unique entries in X is 10 XDNU points to the representative for each item. UNDX selects the representatives.. 1 6 2 2 1 3 3 2 4 4 3 5 5 4 6 6 5 7 7 6 9 8 6 10 9 7 11 10 8 12 11 9 12 10 13 6 14 1 15 4 16 6 17 6 18 1 19 3 20 6 21 3 22 3 The Unique R8COL (transposed): Row: 1 2 3 Col 1: 2 6 10 2: 4 8 12 3: 1 5 9 4: 3 7 11 5: 2 6 0 6: 2 0 10.1 7: 3 4 18 8: 1.9 8 10 9: 0 0 0 10: 0 6 10 R8COL_TRANSPOSE_PRINT_TEST R8COL_TRANSPOSE_PRINT prints an R8COL, transposed. Matrix row order M = 7 Matrix column order N = 12 The transposed matrix A: Row: 1 2 3 4 5 Col 1: 101 201 301 401 501 2: 102 202 302 402 502 3: 103 203 303 403 503 4: 104 204 304 404 504 5: 105 205 305 405 505 6: 106 206 306 406 506 7: 107 207 307 407 507 8: 108 208 308 408 508 9: 109 209 309 409 509 10: 110 210 310 410 510 11: 111 211 311 411 511 12: 112 212 312 412 512 Row: 6 7 Col 1: 601 701 2: 602 702 3: 603 703 4: 604 704 5: 605 705 6: 606 706 7: 607 707 8: 608 708 9: 609 709 10: 610 710 11: 611 711 12: 612 712 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: 1.9 0 10 2: 2 6 10 3: 4 8 12 4: 1 5 9 5: 3 7 11 6: 2 6 0 7: 2 0 10.1 8: 2 0.1 10 9: 3 4 18 10: 1.9 8 10 11: 0 0 0 12: 0 6 10 13: 2.1 0 10 14: 2 6 10 15: 3 7 11 16: 2 0 10 17: 2 0 10 18: 2 6 10 19: 1 5 9 20: 2 0 10.1 21: 1 5 9.1 22: 1 5.1 9 Number of unique entries in X is 16 XDNU points to the representative for each item. UNDX selects the representatives.. 1 21 2 2 1 3 3 2 4 4 3 5 5 4 6 6 5 7 7 6 8 8 7 9 9 8 10 10 9 11 11 10 12 12 11 13 13 12 14 14 13 15 15 14 16 16 15 18 17 15 18 16 19 17 20 18 21 19 22 20 The Unique R8COL (transposed): Row: 1 2 3 Col 1: 2 6 10 2: 4 8 12 3: 1 5 9 4: 3 7 11 5: 2 6 0 6: 2 0 10.1 7: 2 0.1 10 8: 3 4 18 9: 1.9 8 10 10: 0 0 0 11: 0 6 10 12: 2.1 0 10 13: 2 6 10 14: 3 7 11 15: 2 0 10 16: 2 6 10 R8COL_UNIFORM_AB_TEST R8COL_UNIFORM_AB sets an R8COL to random values in [A,B]. The random matrix: Col: 1 2 3 4 Row 1 : 8.01014 9.67433 8.72574 4.79987 2 : 4.04076 6.37772 4.03426 3.57276 3 : 6.04766 3.109 8.51428 4.00867 4 : 7.59261 3.19435 3.9482 6.92836 5 : 9.12723 4.06007 9.43411 5.78631 R8COL_UNIQUE_COUNT_TEST For an R8COL; R8COL_UNIQUE_COUNT counts unique columns. The R8COL (transposed): Row: 1 2 3 Col 1: 2 6 10 2: 4 8 12 3: 1 5 9 4: 3 7 11 5: 2 6 0 6: 3 4 18 7: 0 0 0 8: 0 6 10 9: 2 6 10 10: 3 7 11 11: 2 0 10 12: 2 6 10 13: 1 5 9 14: 1 5 9.1 15: 1 5.1 9 Number of unique columns is 11 R8COL_VARIANCE_TEST For an R8COL, an array of column vectors; R8COL_VARIANCE computes variances; The array: Col: 1 2 3 4 Row 1 : 1 2 3 4 2 : 5 6 7 8 3 : 9 10 11 12 Column variances: 1: 16 2: 16 3: 16 4: 16 R8VEC_PRINT_TEST R8VEC_PRINT prints an R8VEC. The R8VEC: 1: 123.456 2: 5e-06 3: -1e+06 4: 3.14159 SORT_HEAP_EXTERNAL_TEST SORT_HEAP_EXTERNAL sorts objects externally. Unsorted array: 1: 8 2: 17 3: 12 4: 11 5: 19 6: 6 7: 16 8: 16 9: 8 10: 12 11: 2 12: 2 13: 11 14: 16 15: 19 16: 3 17: 12 18: 10 19: 1 20: 7 Sorted array: 1: 1 2: 2 3: 2 4: 3 5: 6 6: 7 7: 8 8: 8 9: 10 10: 11 11: 11 12: 12 13: 12 14: 12 15: 16 16: 16 17: 16 18: 17 19: 19 20: 19 r8col_test() Normal end of execution. 14-Aug-2022 11:23:01