14 September 2021 10:27:47.992 AM r8lib_test() FORTRAN90 version Test r8lib(). I4INT_TO_R8INT_TEST For data in an interval, I4INT_TO_R8INT converts an integer to a real; Integer interval: 1 11 Real interval: 100.000 200.000 R I(R) R(I(R)) 214.381 12 210.000 121.538 3 120.000 184.221 9 180.000 91.8160 0 90.0000 146.612 6 150.000 199.162 11 200.000 85.9724 0 90.0000 99.6305 1 100.000 147.056 6 150.000 93.2489 0 90.0000 PERM0_CHECK_TEST PERM0_CHECK checks a permutation of 0,...,N-1. Permutation 1: 5 2 3 4 1 PERM0_CHECK - Fatal error! Permutation is missing value 0 Permutation 2: 4 1 3 0 2 Permutation 3: 0 2 1 3 2 PERM0_CHECK - Fatal error! Permutation is missing value 4 PERM0_UNIFORM_TEST PERM0_UNIFORM randomly selects a permutation of 0...N-1 6 3 4 8 2 1 0 9 7 5 6 8 1 3 2 0 4 9 5 7 0 2 4 5 7 3 9 6 8 1 5 0 9 4 3 1 8 6 2 7 3 5 6 8 4 9 2 1 7 0 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 - Fatal error! Permutation is missing value 5 Permutation 3: 0 2 1 3 2 PERM1_CHECK - Fatal error! Permutation is missing value 4 PERM1_UNIFORM_TEST PERM1_UNIFORM randomly selects a permutation of 1...N 8 1 7 6 2 9 4 5 3 10 1 6 4 3 10 7 9 5 2 8 3 7 5 9 10 1 8 4 2 6 7 10 6 9 3 2 4 1 5 8 7 2 10 9 5 3 1 8 6 4 R8_ABS_TEST R8_ABS returns the absolute value of an R8. X R8_ABS(X) 4.470453 4.470453 -3.112488 3.112488 1.763441 1.763441 3.886044 3.886044 2.487332 2.487332 -4.161371 4.161371 3.497772 3.497772 4.095484 4.095484 0.815441 0.815441 4.079866 4.079866 R8_ACOS_TEST R8_ACOS computes the arc-cosine of an angle. C R8_ACOS(C) ACOS(C) -1.16667 3.14159 -1.00000 3.14159 3.14159 -0.833333 2.55591 2.55591 -0.666667 2.30052 2.30052 -0.500000 2.09440 2.09440 -0.333333 1.91063 1.91063 -0.166667 1.73824 1.73824 0.00000 1.57080 1.57080 0.166667 1.40335 1.40335 0.333333 1.23096 1.23096 0.500000 1.04720 1.04720 0.666667 0.841069 0.841069 0.833333 0.585686 0.585686 1.00000 0.00000 0.00000 1.16667 0.00000 R8_ACOSH_TEST R8_ACOSH computes the arc-hyperbolic-cosine of an angle. X A=R8_ACOSH(X) COSH(A) 1.00000 0.00000 1.00000 1.50000 0.962424 1.50000 2.00000 1.31696 2.00000 2.50000 1.56680 2.50000 3.00000 1.76275 3.00000 3.50000 1.92485 3.50000 4.00000 2.06344 4.00000 4.50000 2.18464 4.50000 5.00000 2.29243 5.00000 R8_ASIN_TEST R8_ASIN computes the inverse sine of a given value. X R8_ASIN(X) SIN(R8_ASIN(X)) 1.00000 1.57080 1.00000 1.20000 1.57080 1.00000 1.40000 1.57080 1.00000 1.60000 1.57080 1.00000 1.80000 1.57080 1.00000 2.00000 1.57080 1.00000 2.20000 1.57080 1.00000 2.40000 1.57080 1.00000 2.60000 1.57080 1.00000 2.80000 1.57080 1.00000 3.00000 1.57080 1.00000 R8_ASINH_TEST R8_ASINH computes the inverse hyperbolic sine of a given value. X R8_ASINH(X) SINH(R8_ASINH(X)) 1.00000 0.881374 1.00000 1.20000 1.01597 1.20000 1.40000 1.13798 1.40000 1.60000 1.24898 1.60000 1.80000 1.35044 1.80000 2.00000 1.44364 2.00000 2.20000 1.52966 2.20000 2.40000 1.60944 2.40000 2.60000 1.68374 2.60000 2.80000 1.75323 2.80000 3.00000 1.81845 3.00000 R8_ATAN_TEST R8_ATAN computes the arc-tangent given Y and X; ATAN2 is the system version of this routine. X Y ATAN2(Y,X) R8_ATAN(Y,X) 1.00000 0.00000 0.00000 0.00000 1.00000 1.00000 0.785398 0.785398 0.00000 1.00000 1.57080 1.57080 -1.00000 1.00000 2.35619 2.35619 -1.00000 0.00000 3.14159 3.14159 -1.00000 -1.00000 -2.35619 3.92699 0.00000 -1.00000 -1.57080 4.71239 1.00000 -1.00000 -0.785398 5.49779 R8_ATANH_TEST R8_ATANH computes the inverse hyperbolic tangent of a given value. X R8_ATANH(X) TANH(R8_ATANH(X)) -0.200000 -0.202733 -0.200000 -0.100000 -0.100335 -0.100000 0.00000 0.00000 0.00000 0.100000 0.100335 0.100000 0.200000 0.202733 0.200000 0.300000 0.309520 0.300000 0.400000 0.423649 0.400000 0.500000 0.549306 0.500000 0.600000 0.693147 0.600000 0.700000 0.867301 0.700000 0.800000 1.09861 0.800000 0.900000 1.47222 0.900000 R8_BIG_TEST: R8_BIG returns a "big" R8; R8_BIG ( ) = 0.1000000000000000E+31 HUGE ( 1.0D+00 ) = 0.1797693134862316+309 R8_CAS_TEST R8_CAS evaluates the casine of a number. X R8_CAS ( X ) 0.00000 1.00000 0.261799 1.22474 0.523599 1.36603 0.785398 1.41421 1.04720 1.36603 1.30900 1.22474 1.57080 1.00000 1.83260 0.707107 2.09440 0.366025 2.35619 0.111022E-15 2.61799 -0.366025 2.87979 -0.707107 3.14159 -1.00000 R8_CEILING_TEST R8_CEILING rounds a value up. X R8_CEILING(X) -1.20000 -1.00000 -1.00000 -1.00000 -0.800000 0.00000 -0.600000 0.00000 -0.400000 0.00000 -0.200000 0.00000 0.00000 0.00000 0.200000 1.00000 0.400000 1.00000 0.600000 1.00000 0.800000 1.00000 1.00000 1.00000 1.20000 2.00000 R8_CHOOSE_TEST R8_CHOOSE evaluates C(N,K). N K CNK 0 0 1.00000 1 0 1.00000 1 1 1.00000 2 0 1.00000 2 1 2.00000 2 2 1.00000 3 0 1.00000 3 1 3.00000 3 2 3.00000 3 3 1.00000 4 0 1.00000 4 1 4.00000 4 2 6.00000 4 3 4.00000 4 4 1.00000 5 0 1.00000 5 1 5.00000 5 2 10.0000 5 3 10.0000 5 4 5.00000 5 5 1.00000 R8_CHOP_TEST R8_CHOP truncates an R8 to a given number of binary places. Places R8 0 0.000000000000000 1 2.000000000000000 2 3.000000000000000 3 3.000000000000000 4 3.000000000000000 5 3.125000000000000 6 3.125000000000000 7 3.125000000000000 8 3.140625000000000 9 3.140625000000000 10 3.140625000000000 11 3.140625000000000 12 3.140625000000000 13 3.141113281250000 14 3.141357421875000 15 3.141479492187500 16 3.141540527343750 17 3.141571044921875 18 3.141586303710938 19 3.141586303710938 20 3.141590118408203 21 3.141592025756836 22 3.141592025756836 23 3.141592502593994 24 3.141592502593994 25 3.141592621803284 26 3.141592621803284 27 3.141592651605606 28 3.141592651605606 29 3.141592651605606 30 3.141592651605606 31 3.141592653468251 R8_COSD_TEST R8_COSD computes the cosine of an angle given in degrees. ANGLE R8_COSD(ANGLE) 0.00 1.00000 15.00 0.965926 30.00 0.866025 45.00 0.707107 60.00 0.500000 75.00 0.258819 90.00 0.612323E-16 105.00 -0.258819 120.00 -0.500000 135.00 -0.707107 150.00 -0.866025 165.00 -0.965926 180.00 -1.00000 195.00 -0.965926 210.00 -0.866025 225.00 -0.707107 240.00 -0.500000 255.00 -0.258819 270.00 -0.183697E-15 285.00 0.258819 300.00 0.500000 315.00 0.707107 330.00 0.866025 345.00 0.965926 360.00 1.00000 R8_COT_TEST R8_COT computes the cotangent of an angle. ANGLE R8_COT(ANGLE) 0.00 Undefined 0.26 3.73205 0.52 1.73205 0.79 1.00000 1.05 0.577350 1.31 0.267949 1.57 0.612323E-16 1.83 -0.267949 2.09 -0.577350 2.36 -1.00000 2.62 -1.73205 2.88 -3.73205 3.14 Undefined 3.40 3.73205 3.67 1.73205 3.93 1.00000 4.19 0.577350 4.45 0.267949 4.71 0.183697E-15 4.97 -0.267949 5.24 -0.577350 5.50 -1.00000 5.76 -1.73205 6.02 -3.73205 6.28 Undefined R8_COTD_TEST R8_COTD computes the cotangent of an angle given in degrees. ANGLE R8_COTD(ANGLE) 0.00 Undefined 15.00 3.73205 30.00 1.73205 45.00 1.00000 60.00 0.577350 75.00 0.267949 90.00 0.612323E-16 105.00 -0.267949 120.00 -0.577350 135.00 -1.00000 150.00 -1.73205 165.00 -3.73205 180.00 Undefined 195.00 3.73205 210.00 1.73205 225.00 1.00000 240.00 0.577350 255.00 0.267949 270.00 0.183697E-15 285.00 -0.267949 300.00 -0.577350 315.00 -1.00000 330.00 -1.73205 345.00 -3.73205 360.00 Undefined R8_CSC_TEST R8_CSC computes the cosecant of an angle. ANGLE R8_CSC(ANGLE) 0.00 Undefined 0.26 3.86370 0.52 2.00000 0.79 1.41421 1.05 1.15470 1.31 1.03528 1.57 1.00000 1.83 1.03528 2.09 1.15470 2.36 1.41421 2.62 2.00000 2.88 3.86370 3.14 Undefined 3.40 -3.86370 3.67 -2.00000 3.93 -1.41421 4.19 -1.15470 4.45 -1.03528 4.71 -1.00000 4.97 -1.03528 5.24 -1.15470 5.50 -1.41421 5.76 -2.00000 6.02 -3.86370 6.28 Undefined R8_CSCD_TEST R8_CSCD computes the cosecant of an angle given in degrees. ANGLE R8_CSCD(ANGLE) 0.00 Undefined 15.00 3.86370 30.00 2.00000 45.00 1.41421 60.00 1.15470 75.00 1.03528 90.00 1.00000 105.00 1.03528 120.00 1.15470 135.00 1.41421 150.00 2.00000 165.00 3.86370 180.00 Undefined 195.00 -3.86370 210.00 -2.00000 225.00 -1.41421 240.00 -1.15470 255.00 -1.03528 270.00 -1.00000 285.00 -1.03528 300.00 -1.15470 315.00 -1.41421 330.00 -2.00000 345.00 -3.86370 360.00 Undefined r8_cube_root_test(): r8_cube_root() computes the cube root of an R8. X Y Y^3 -7.32687 -1.94225 -7.32687 -2.48122 -1.35380 -2.48122 -9.51293 -2.11887 -9.51293 8.26006 2.02144 8.26006 -4.94462 -1.70364 -4.94462 -3.17658 -1.47001 -3.17658 1.40568 1.12020 1.40568 -3.10846 -1.45943 -3.10846 1.13848 1.04418 1.13848 8.11698 2.00970 8.11698 R8_DEGREES_TEST R8_DEGREES converts an angle from radians to degrees. ANGLE R8_DEGREES(ANGLE) 0.00000 0.00000 0.261799 15.0000 0.523599 30.0000 0.785398 45.0000 1.04720 60.0000 1.30900 75.0000 1.57080 90.0000 1.83260 105.000 2.09440 120.000 2.35619 135.000 2.61799 150.000 2.87979 165.000 3.14159 180.000 3.40339 195.000 3.66519 210.000 3.92699 225.000 4.18879 240.000 4.45059 255.000 4.71239 270.000 4.97419 285.000 5.23599 300.000 5.49779 315.000 5.75959 330.000 6.02139 345.000 6.28319 360.000 R8_DIFF_TEST R8_DIFF computes a difference X-Y to a given number of binary places. For this test, we use 3 binary places. X Y X-Y R8_DIFF(X,Y) 1.0000 0.0625 0.9375 0.8750 1.0000 0.1250 0.8750 0.8750 1.0000 0.2500 0.7500 0.7500 1.0000 0.5000 0.5000 0.5000 1.0000 0.8740 0.1260 0.1250 1.0000 0.8760 0.1240 0.1250 1.0000 0.9000 0.1000 0.1250 1.0000 0.9500 0.0500 0.0000 1.0000 0.9900 0.0100 0.0000 1.0000 1.0000 0.0000 0.0000 1.0000 1.0100 -0.0100 0.0000 1.0000 1.0500 -0.0500 0.0000 1.0000 1.1000 -0.1000 -0.1375 1.0000 3.0000 -2.0000 -1.8750 1.0000 10.0000 -9.0000 -8.7500 R8_DIGIT_TEST R8_DIGIT extracts decimal digits. Here, we get digits of 3.141592653589793 -2 -1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 0 0 0 3 1 4 1 5 9 2 6 5 3 5 8 9 7 9 3 1 1 5 9 R8_DIVIDE_I4_TEST R8_DIVIDE_I4 computes an integer ratio using real arithmetic. I1 I2 R8_DIVIDE_I4 -41 -43 0.953488 16 66 0.242424 -87 -95 0.915789 -95 -94 1.01064 -22 -57 0.385965 41 88 0.465909 68 -56 -1.21429 59 75 0.786667 -51 24 -2.12500 -56 53 -1.05660 R8_E_TEST R8_E returns the value of E. Compare E to (1+1/n)^n R8_E = 2.718281828459045 N Estimate Error 1 2.00000 0.718282 2 2.25000 0.468282 4 2.44141 0.276876 8 2.56578 0.152497 16 2.63793 0.803533E-01 32 2.67699 0.412917E-01 64 2.69734 0.209369E-01 128 2.70774 0.105428E-01 256 2.71299 0.529020E-02 512 2.71563 0.264983E-02 1024 2.71696 0.132610E-02 2048 2.71762 0.663346E-03 4096 2.71795 0.331747E-03 8192 2.71812 0.165892E-03 16384 2.71820 0.829507E-04 32768 2.71824 0.414765E-04 65536 2.71826 0.207386E-04 131072 2.71827 0.103694E-04 262144 2.71828 0.518469E-05 524288 2.71828 0.259234E-05 1048576 2.71828 0.129618E-05 R8_EPSILON_TEST R8_EPSILON returns the R8 machine precision. R = R8_EPSILON() = 0.2220446049250313E-15 ( 1 + R ) - 1 = 0.2220446049250313E-15 ( 1 + (R/2) ) - 1 = 0.000000000000000 R8_EPSILON_COMPUTE_TEST R8_EPSILON_COMPUTE computes the R8 machine precision. R = R8_EPSILON_COMPUTE() = 0.2220446049250313E-15 ( 1 + R ) - 1 = 0.2220446049250313E-15 ( 1 + (R/2) ) - 1 = 0.000000000000000 R8_EXP_TEST R8_EXP evaluates the exponential function of R8. It truncates very small or large arguments. X R8_EXP(X) ********** .00000 ********** .00000 ********** ********** ********** ********** ********** ********** .00000 ********** ********** ********** ********** ********** ********** ********** ********** ********** ********** ********** R8_FACTORIAL_TEST R8_FACTORIAL computes the factorial function. N Exact Computed 0 1.000000000000000 1.000000000000000 1 1.000000000000000 1.000000000000000 2 2.000000000000000 2.000000000000000 3 6.000000000000000 6.000000000000000 4 24.00000000000000 24.00000000000000 5 120.0000000000000 120.0000000000000 6 720.0000000000000 720.0000000000000 7 5040.000000000000 5040.000000000000 8 40320.00000000000 40320.00000000000 9 362880.0000000000 362880.0000000000 10 3628800.000000000 3628800.000000000 11 39916800.00000000 39916800.00000000 12 479001600.0000000 479001600.0000000 13 6227020800.000000 6227020800.000000 14 87178291200.00000 87178291200.00000 15 1307674368000.000 1307674368000.000 16 20922789888000.00 20922789888000.00 17 355687428096000.0 355687428096000.0 18 6402373705728000. 6402373705728000. 19 0.1216451004088320E+18 0.1216451004088320E+18 20 0.2432902008176640E+19 0.2432902008176640E+19 25 0.1551121004333099E+26 0.1551121004333099E+26 50 0.3041409320171338E+65 0.3041409320171338E+65 100 0.9332621544394415+158 0.9332621544394410+158 150 0.5713383956445855+263 0.5713383956445850+263 R8_FACTORIAL_STIRLING_TEST R8_FACTORIAL_STIRLING computes Stirling's approximate factorial function; N Factorial Factorial Stirling 1 1.00227 1.00000 2 2.00065 2.00000 3 6.00060 6.00000 4 24.0010 24.0000 5 120.003 120.000 6 720.009 720.000 7 5040.04 5040.00 8 40320.2 40320.0 9 362881. 362880. 10 0.362881E+07 0.362880E+07 11 0.399169E+08 0.399168E+08 12 0.479002E+09 0.479002E+09 13 0.622703E+10 0.622702E+10 14 0.871784E+11 0.871783E+11 15 0.130768E+13 0.130767E+13 16 0.209228E+14 0.209228E+14 17 0.355688E+15 0.355687E+15 18 0.640238E+16 0.640237E+16 19 0.121645E+18 0.121645E+18 20 0.243290E+19 0.243290E+19 R8_FACTORIAL2_TEST R8_FACTORIAL2 computes the double factorial function. N Exact Computed 0 1.000000000000000 1.000000000000000 1 1.000000000000000 1.000000000000000 2 2.000000000000000 2.000000000000000 3 3.000000000000000 3.000000000000000 4 8.000000000000000 8.000000000000000 5 15.00000000000000 15.00000000000000 6 48.00000000000000 48.00000000000000 7 105.0000000000000 105.0000000000000 8 384.0000000000000 384.0000000000000 9 945.0000000000000 945.0000000000000 10 3840.000000000000 3840.000000000000 11 10395.00000000000 10395.00000000000 12 46080.00000000000 46080.00000000000 13 135135.0000000000 135135.0000000000 14 645120.0000000000 645120.0000000000 15 2027025.000000000 2027025.000000000 R8_FALL_TEST R8_FALL computes the falling factorial function. X N Exact Computed 5.0000 4 120.0000000000000 120.0000000000000 5.2500 4 163.1601562500000 163.1601562500000 5.5000 4 216.5625000000000 216.5625000000000 5.7500 4 281.6601562500000 281.6601562500000 6.0000 4 360.0000000000000 360.0000000000000 7.5000 0 1.000000000000000 1.000000000000000 7.5000 1 7.500000000000000 7.500000000000000 7.5000 2 48.75000000000000 48.75000000000000 7.5000 3 268.1250000000000 268.1250000000000 7.5000 4 1206.562500000000 1206.562500000000 7.5000 5 4222.968750000000 4222.968750000000 7.5000 6 10557.42187500000 10557.42187500000 7.5000 7 15836.13281250000 15836.13281250000 7.5000 8 7918.066406250000 7918.066406250000 7.5000 9 -3959.033203125000 -3959.033203125000 R8_FLOOR_TEST R8_FLOOR rounds a value down. X R8_FLOOR(X) -1.20000 -2.00000 -1.00000 -1.00000 -0.800000 -1.00000 -0.600000 -1.00000 -0.400000 -1.00000 -0.200000 -1.00000 0.00000 0.00000 0.200000 0.00000 0.400000 0.00000 0.600000 0.00000 0.800000 0.00000 1.00000 1.00000 1.20000 1.00000 R8_FRACTIONAL_TEST R8_FRACTIONAL returns the fractional part of an R8. X R8_FRACTIONAL(X) 3.566672 0.566672 -2.936460 0.936460 -1.844057 0.844057 3.194385 0.194385 -1.905576 0.905576 -1.547973 0.547973 1.065863 0.065863 -0.151777 0.151777 1.081232 0.081232 0.216234 0.216234 R8_GAMMA_TEST: R8_GAMMA computes the Gamma functions. X GAMMA(X) R8_GAMMA(X) -0.500000 -3.544907701811032 -3.544907701811032 -0.010000 -100.5871979644108 -100.5871979644108 0.010000 99.43258511915060 99.43258511915060 0.100000 9.513507698668732 9.513507698668731 0.200000 4.590843711998803 4.590843711998803 0.400000 2.218159543757688 2.218159543757688 0.500000 1.772453850905516 1.772453850905516 0.600000 1.489192248812817 1.489192248812817 0.800000 1.164229713725303 1.164229713725303 1.000000 1.000000000000000 1.000000000000000 1.100000 0.9513507698668732 0.9513507698668732 1.200000 0.9181687423997607 0.9181687423997607 1.300000 0.8974706963062772 0.8974706963062772 1.400000 0.8872638175030753 0.8872638175030754 1.500000 0.8862269254527581 0.8862269254527581 1.600000 0.8935153492876903 0.8935153492876903 1.700000 0.9086387328532904 0.9086387328532904 1.800000 0.9313837709802427 0.9313837709802427 1.900000 0.9617658319073874 0.9617658319073874 2.000000 1.000000000000000 1.000000000000000 3.000000 2.000000000000000 2.000000000000000 4.000000 6.000000000000000 6.000000000000000 10.000000 362880.0000000000 362880.0000000000 20.000000 0.1216451004088320E+18 0.1216451004088321E+18 30.000000 0.8841761993739702E+31 0.8841761993739751E+31 R8_GAMMA_LOG_TEST: R8_GAMMA_LOG computes the Log(Gamma()) function. X GAMMA_LOG(X) R8_GAMMA_LOG(X) 0.200000 1.524063822430784 1.524063822430784 0.400000 0.7966778177017837 0.7966778177017837 0.600000 0.3982338580692348 0.3982338580692349 0.800000 0.1520596783998375 0.1520596783998376 1.000000 0.000000000000000 0.000000000000000 1.100000 -0.4987244125983972E-01 -0.4987244125983976E-01 1.200000 -0.8537409000331583E-01 -0.8537409000331585E-01 1.300000 -0.1081748095078604 -0.1081748095078605 1.400000 -0.1196129141723712 -0.1196129141723713 1.500000 -0.1207822376352452 -0.1207822376352453 1.600000 -0.1125917656967557 -0.1125917656967558 1.700000 -0.9580769740706586E-01 -0.9580769740706586E-01 1.800000 -0.7108387291437215E-01 -0.7108387291437215E-01 1.900000 -0.3898427592308333E-01 -0.3898427592308337E-01 2.000000 0.000000000000000 0.000000000000000 3.000000 0.6931471805599453 0.6931471805599454 4.000000 1.791759469228055 1.791759469228055 10.000000 12.80182748008147 12.80182748008147 20.000000 39.33988418719949 39.33988418719949 30.000000 71.25703896716801 71.25703896716800 R8_HUGE_TEST R8_HUGE returns a "huge" R8; R8_HUGE ( ) = 0.1797693134862316+309 HUGE ( 1.0D+00 ) = 0.1797693134862316+309 R8_LOG_2_TEST R8_LOG_2 computes the logarithm base 2. X R8_LOG_2 0.00000 -0.179769+309 1.00000 0.00000 2.00000 1.00000 3.00000 1.58496 9.00000 3.16993 10.0000 3.32193 11.0000 3.45943 99.0000 6.62936 101.000 6.65821 -1.00000 0.00000 -2.00000 1.00000 -3.00000 1.58496 -9.00000 3.16993 0.500000 -1.00000 0.330000 -1.59946 0.250000 -2.00000 0.200000 -2.32193 0.100000E-01 -6.64386 R8_LOG_10_TEST R8_LOG_10 computes the logarithm base 10. X R8_LOG_10 0.00000 -0.179769+309 1.00000 0.00000 2.00000 0.301030 3.00000 0.477121 9.00000 0.954243 10.0000 1.00000 11.0000 1.04139 99.0000 1.99564 101.000 2.00432 -1.00000 0.00000 -2.00000 0.301030 -3.00000 0.477121 -9.00000 0.954243 0.500000 -0.301030 0.330000 -0.481486 0.250000 -0.602060 0.200000 -0.698970 0.100000E-01 -2.00000 R8_LOG_B_TEST R8_LOG_B computes the logarithm base B. X B R8_LOG_B 16.0000 2.00000 4.00000 16.0000 3.00000 2.52372 16.0000 4.00000 2.00000 16.0000 5.00000 1.72271 16.0000 6.00000 1.54741 16.0000 7.00000 1.42483 16.0000 8.00000 1.33333 16.0000 16.0000 1.00000 16.0000 32.0000 0.800000 16.0000 256.000 0.500000 R8_MANT_TEST R8_MANT decomposes a value. Number to be decomposed: -314.159 R8_MANT: X = -1 * 1.22718 * 2 ^ 8 R8_MAX_TEST R8_MAX returns the maximum of two R8's. A B C=R8_MAX(A,B) -1.4952 4.8354 4.8354 0.4384 -4.6664 0.4384 0.1173 4.8566 4.8566 4.6350 4.0256 4.6350 3.4737 2.3725 3.4737 -0.4940 -0.4959 -0.4940 2.9570 1.0691 2.9570 1.6150 -3.9234 1.6150 1.9200 -0.3095 1.9200 2.3772 4.4485 4.4485 R8_MIN_TEST R8_MIN returns the minimum of two R8's. A B C=R8_MIN(A,B) 2.9865 0.0386 0.0386 -3.8918 3.8973 -3.8918 -2.0636 -2.8983 -2.8983 4.0319 -4.2613 -4.2613 4.0046 2.0702 2.0702 0.8652 2.9542 0.8652 -4.8467 4.8655 -4.8467 -0.6178 0.6002 -0.6178 -2.8273 4.9992 -2.8273 -1.1349 -0.9572 -1.1349 R8_MOD_TEST R8_MOD returns the remainder after division. X Y MOD(X,Y) R8_MOD(X,Y) -0.4356 9.0084 -0.4356 -0.4356 -7.1880 6.3844 -0.8036 -0.8036 6.8528 7.0367 6.8528 6.8528 -5.5517 -0.4294 -0.3987 -0.3987 -0.5296 8.9926 -0.5296 -0.5296 -1.2010 3.1983 -1.2010 -1.2010 -2.8646 -3.2876 -2.8646 -2.8646 -9.5288 5.5970 -3.9317 -3.9317 4.9673 -4.4354 0.5320 0.5320 -9.7168 -9.3952 -0.3216 -0.3216 R8_MODP_TEST R8_MODP returns the remainder after division. Unlike the FORTRAN MOD, R8_MODP ( X, Y ) is positive. X Y MOD(X,Y) R8_MODP(X,Y) 1.6761 5.6404 1.6761 1.6761 5.2681 4.9717 0.2963 0.2963 -9.2648 8.6894 -0.5754 8.1140 8.7143 4.8568 3.8575 3.8575 -8.9363 -3.2933 -2.3497 0.9437 -9.3566 1.8298 -0.2078 1.6220 5.6370 7.0178 5.6370 5.6370 -1.1611 -6.3285 -1.1611 5.1673 -1.1648 7.4314 -1.1648 6.2666 -3.7448 -4.0626 -3.7448 0.3178 R8_MOP_TEST R8_MOP evaluates (-1.0)^I4 as an R8. I4 R8_MOP(I4) -74 1.0 8 1.0 71 -1.0 58 1.0 25 -1.0 39 -1.0 67 -1.0 -45 -1.0 51 -1.0 60 1.0 R8_NINT_TEST R8_NINT produces the nearest integer to an R8. X R8_NINT(X) 3.3005 3 -6.3494 -6 8.4885 8 5.6253 6 -5.7621 -6 -1.6255 -2 6.4920 6 9.9855 10 0.0436 0 3.6694 4 R8_NORMAL_01_TEST R8_NORMAL_01 generates normally distributed random values. -0.264615 0.785429 0.925571 -0.725442 1.60994 -1.19239 1.24306 -1.41841 -0.661575 -0.829932 -0.627640 0.401801 -1.35979 0.854217 0.155863 -0.207401 -0.978437 0.847364 0.374869 -1.46788 R8_NORMAL_AB_TEST R8_NORMAL_AB generates normally distributed random values with mean MU and standard deviation SIGMA. MU = 10.0000 SIGMA = 4.00000 14.2030 16.2638 10.4850 10.7757 -1.63715 14.1897 8.20547 10.4392 17.1465 12.1191 4.85161 7.08274 10.3106 10.1600 7.38358 6.74935 13.9939 13.1156 9.54508 13.6534 R8_PI_TEST R8_PI returns the value of PI. R8_PI = 3.141592653589793 4*atan(1) = 3.141592653589793 R8_POWER_TEST R8_POWER computes R^P. R P R^P 2.00000 -5 0.312500E-01 2.00000 -4 0.625000E-01 2.00000 -3 0.125000 2.00000 -2 0.250000 2.00000 -1 0.500000 2.00000 0 1.00000 2.00000 1 2.00000 2.00000 2 4.00000 2.00000 3 8.00000 2.00000 4 16.0000 2.00000 5 32.0000 R8_POWER_FAST_TEST R8_POWER_FAST computes R^P, economizing on multiplications. R P R^P Mults 2.00000 -10 0.976562E-03 7 2.00000 -9 0.195312E-02 7 2.00000 -8 0.390625E-02 6 2.00000 -7 0.781250E-02 7 2.00000 -6 0.156250E-01 6 2.00000 -5 0.312500E-01 6 2.00000 -4 0.625000E-01 5 2.00000 -3 0.125000 5 2.00000 -2 0.250000 4 2.00000 -1 0.500000 1 2.00000 0 1.00000 0 2.00000 1 2.00000 0 2.00000 2 4.00000 3 2.00000 3 8.00000 4 2.00000 4 16.0000 4 2.00000 5 32.0000 5 2.00000 6 64.0000 5 2.00000 7 128.000 6 2.00000 8 256.000 5 2.00000 9 512.000 6 2.00000 10 1024.00 6 2.00000 11 2048.00 7 2.00000 12 4096.00 6 2.00000 13 8192.00 7 2.00000 14 16384.0 7 2.00000 15 32768.0 8 2.00000 16 65536.0 6 2.00000 17 131072. 7 2.00000 18 262144. 7 2.00000 19 524288. 8 2.00000 20 0.104858E+07 7 2.00000 21 0.209715E+07 8 2.00000 22 0.419430E+07 8 2.00000 23 0.838861E+07 9 2.00000 24 0.167772E+08 7 2.00000 25 0.335544E+08 8 2.00000 26 0.671089E+08 8 2.00000 27 0.134218E+09 9 2.00000 28 0.268435E+09 8 2.00000 29 0.536871E+09 9 2.00000 30 0.107374E+10 9 2.00000 31 0.214748E+10 10 2.00000 32 0.429497E+10 7 2.00000 33 0.858993E+10 8 2.00000 34 0.171799E+11 8 2.00000 35 0.343597E+11 9 2.00000 36 0.687195E+11 8 2.00000 37 0.137439E+12 9 2.00000 38 0.274878E+12 9 2.00000 39 0.549756E+12 10 2.00000 40 0.109951E+13 8 R8_RADIANS_TEST R8_RADIANS converts an angle from degrees to radians. ANGLE R8_RADIANS(ANGLE) 0.00000 0.00000 15.0000 0.261799 30.0000 0.523599 45.0000 0.785398 60.0000 1.04720 75.0000 1.30900 90.0000 1.57080 105.000 1.83260 120.000 2.09440 135.000 2.35619 150.000 2.61799 165.000 2.87979 180.000 3.14159 195.000 3.40339 210.000 3.66519 225.000 3.92699 240.000 4.18879 255.000 4.45059 270.000 4.71239 285.000 4.97419 300.000 5.23599 315.000 5.49779 330.000 5.75959 345.000 6.02139 360.000 6.28319 R8_RELU_TEST R8_RELU evaluates the ReLU function of an R8. This is max(x,0). X R8_RELU(X) -500.000 0.00000 -50.0000 0.00000 -5.00000 0.00000 -4.00000 0.00000 -3.00000 0.00000 -2.00000 0.00000 -1.00000 0.00000 -0.500000 0.00000 -0.500000E-01 0.00000 -0.500000E-02 0.00000 -0.500000E-03 0.00000 0.00000 0.00000 0.500000E-03 0.500000E-03 0.500000E-02 0.500000E-02 0.500000E-01 0.500000E-01 0.500000 0.500000 1.00000 1.00000 2.00000 2.00000 3.00000 3.00000 4.00000 4.00000 5.00000 5.00000 50.0000 50.0000 500.000 500.000 5000.00 5000.00 50000.0 50000.0 R8_RISE_TEST R8_RISE computes the rising factorial function. X N Exact Computed 5.0000 4 1680.000000000000 1680.000000000000 5.2500 4 1962.597656250000 1962.597656250000 5.5000 4 2279.062500000000 2279.062500000000 5.7500 4 2631.972656250000 2631.972656250000 6.0000 4 3024.000000000000 3024.000000000000 7.5000 0 1.000000000000000 1.000000000000000 7.5000 1 7.500000000000000 7.500000000000000 7.5000 2 63.75000000000000 63.75000000000000 7.5000 3 605.6250000000000 605.6250000000000 7.5000 4 6359.062500000000 6359.062500000000 7.5000 5 73129.21875000000 73129.21875000000 7.5000 6 914115.2343750000 914115.2343750000 7.5000 7 12340555.66406250 12340555.66406250 7.5000 8 178938057.1289063 178938057.1289062 7.5000 9 2773539885.498047 2773539885.498047 R8_ROUND2_TEST R8_ROUND2 rounds a number to a specified number of base 2 digits. Test effect on PI: X = 3.141592653589793 NPLACE XROUND 0 0.000000000000000 1 2.000000000000000 2 3.000000000000000 3 3.000000000000000 4 3.000000000000000 5 3.125000000000000 6 3.125000000000000 7 3.125000000000000 8 3.140625000000000 9 3.140625000000000 10 3.140625000000000 11 3.140625000000000 12 3.140625000000000 13 3.141113281250000 14 3.141357421875000 15 3.141479492187500 16 3.141540527343750 17 3.141571044921875 18 3.141586303710938 19 3.141586303710938 20 3.141590118408203 R8_ROUNDB_TEST R8_ROUNDB rounds a number to a specified number of base BASE digits. Here, we will use BASE = 3 Test effect on PI: X = 3.141592653589793 NPLACE XROUND 0 0.000000000000000 1 3.000000000000000 2 3.000000000000000 3 3.000000000000000 4 3.111111111111111 5 3.111111111111111 6 3.135802469135802 7 3.139917695473252 8 3.141289437585734 9 3.141289437585734 10 3.141441853376010 11 3.141543463902860 12 3.141577334078477 13 3.141588624137016 14 3.141592387489863 15 3.141592387489863 16 3.141592596565021 17 3.141592596565021 18 3.141592643026167 19 3.141592650769691 20 3.141592653350866 Try with a negative base: Input quantity is X = 121.0000000000000 to be rounded in base -3 Output value to 1 places is 81.00000000000000 Output value to 2 places is 108.0000000000000 Output value to 3 places is 117.0000000000000 Output value to 4 places is 120.0000000000000 Output value to 5 places is 121.0000000000000 R8_ROUNDX_TEST R8_ROUNDX rounds a number to a specified number of decimal digits. Test effect on PI: X = 3.141592653589793 NPLACE XROUND 0 0.000000000000000 1 3.000000000000000 2 3.100000000000000 3 3.140000000000000 4 3.141000000000000 5 3.141500000000000 6 3.141590000000000 7 3.141592000000000 8 3.141592600000000 9 3.141592650000000 10 3.141592653000000 Test effect on random values: NPLACE X XROUND 0 0.3162847129555735 0.000000000000000 2 0.3162847129555735 0.3100000000000000 4 0.3162847129555735 0.3162000000000000 6 0.3162847129555735 0.3162840000000000 8 0.3162847129555735 0.3162847100000000 10 0.3162847129555735 0.3162847129000000 0 0.5920066958569108 0.000000000000000 2 0.5920066958569108 0.5900000000000000 4 0.5920066958569108 0.5920000000000001 6 0.5920066958569108 0.5920059999999999 8 0.5920066958569108 0.5920066900000001 10 0.5920066958569108 0.5920066958000000 0 0.8512671396605742E-01 0.000000000000000 2 0.8512671396605742E-01 0.8500000000000001E-01 4 0.8512671396605742E-01 0.8512000000000000E-01 6 0.8512671396605742E-01 0.8512670000000000E-01 8 0.8512671396605742E-01 0.8512671300000001E-01 10 0.8512671396605742E-01 0.8512671395999999E-01 0 0.4644020865136813 0.000000000000000 2 0.4644020865136813 0.4600000000000000 4 0.4644020865136813 0.4644000000000000 6 0.4644020865136813 0.4644020000000000 8 0.4644020865136813 0.4644020800000000 10 0.4644020865136813 0.4644020865000000 0 0.2664036371613964 0.000000000000000 2 0.2664036371613964 0.2600000000000000 4 0.2664036371613964 0.2664000000000000 6 0.2664036371613964 0.2664030000000000 8 0.2664036371613964 0.2664036300000000 10 0.2664036371613964 0.2664036371000000 R8_SECD_TEST R8_SECD computes the secant of an angle given in degrees. ANGLE R8_SECD(ANGLE) 0.00 1.00000 15.00 1.03528 30.00 1.15470 45.00 1.41421 60.00 2.00000 75.00 3.86370 90.00 Undefined 105.00 -3.86370 120.00 -2.00000 135.00 -1.41421 150.00 -1.15470 165.00 -1.03528 180.00 -1.00000 195.00 -1.03528 210.00 -1.15470 225.00 -1.41421 240.00 -2.00000 255.00 -3.86370 270.00 Undefined 285.00 3.86370 300.00 2.00000 315.00 1.41421 330.00 1.15470 345.00 1.03528 360.00 1.00000 R8_SECH_TEST R8_SECH computes the hyperbolic secant. X R8_SECH(X) -1.00 0.648054 -0.90 0.697795 -0.80 0.747700 -0.70 0.796705 -0.60 0.843551 -0.50 0.886819 -0.40 0.925007 -0.30 0.956628 -0.20 0.980328 -0.10 0.995021 0.00 1.00000 0.10 0.995021 0.20 0.980328 0.30 0.956628 0.40 0.925007 0.50 0.886819 0.60 0.843551 0.70 0.796705 0.80 0.747700 0.90 0.697795 1.00 0.648054 r8_sigmoid_test r8_sigmoid evaluates the sigmoid function of R8. X R8_SIGMOID(L,B,M,X) -4.00000 0.179862E-01 -2.00000 0.119203 -1.00000 0.268941 -0.500000 0.377541 -0.250000 0.437823 0.00000 0.500000 0.250000 0.562177 0.500000 0.622459 1.00000 0.731059 2.00000 0.880797 4.00000 0.982014 R8_SIGN_TEST R8_SIGN returns the sign of an R8. R8 R8_SIGN(R8) -1.2500 -1. -0.2500 -1. 0.0000 1. 0.5000 1. 9.0000 1. R8_SIGN_MATCH_TEST R8_SIGN_MATCH reports whether signs match R1 R2 R8_SIGN_MATCH(R1,R2) -0.4601 2.9917 F 2.2893 -4.9352 F 4.1824 -3.0473 F -0.3543 3.2084 F -1.3970 -2.2878 T -1.5855 -0.5579 T 4.5798 0.8701 T 4.9227 1.6424 T -0.0124 1.4328 F -2.5176 4.9969 F R8_SIGN3_TEST R8_SIGN3 returns the three-way sign of an R8. R8 R8_SIGN3(R8) -1.2500 -1. -0.2500 -1. 0.0000 0. 0.5000 1. 9.0000 1. R8_SINCOS_SUM_TEST R8_SINCOS_SUM simplifies a linear sine and cosine sum 1.990 * sin ( -4.936 * x ) + 3.408 * cos ( -4.936 * x ) = 3.946 * sin ( -4.936 * x + 1.042 ) = 3.946 * cos ( -4.936 * x + -0.5284 ) I X form 1 form 2 form 3 0 0.0000 3.40796 3.40796 3.40796 1 0.3142 -1.92122 -1.92122 -1.92122 2 0.6283 -3.48462 -3.48462 -3.48462 3 0.9425 1.78217 1.78217 1.78217 4 1.2566 3.55574 3.55574 3.55574 5 1.5708 -1.64028 -1.64028 -1.64028 6 1.8850 -3.62120 -3.62120 -3.62120 7 2.1991 1.49577 1.49577 1.49577 8 2.5133 3.68088 3.68088 3.68088 9 2.8274 -1.34888 -1.34888 -1.34888 10 3.1416 -3.73471 -3.73471 -3.73471 R8_SIND_TEST R8_SIND computes the sine of an angle given in degrees. ANGLE R8_SIND(ANGLE) 0.00 0.00000 15.00 0.258819 30.00 0.500000 45.00 0.707107 60.00 0.866025 75.00 0.965926 90.00 1.00000 105.00 0.965926 120.00 0.866025 135.00 0.707107 150.00 0.500000 165.00 0.258819 180.00 0.122465E-15 195.00 -0.258819 210.00 -0.500000 225.00 -0.707107 240.00 -0.866025 255.00 -0.965926 270.00 -1.00000 285.00 -0.965926 300.00 -0.866025 315.00 -0.707107 330.00 -0.500000 345.00 -0.258819 360.00 -0.244929E-15 R8_SOFTPLUS_TEST R8_SOFTPLUS evaluates the softplus function of an R8. This is a smoothed version of max(x,0). X R8_SOFTPLUS(X) -500.000 0.00000 -50.0000 0.00000 -5.00000 0.671535E-02 -4.00000 0.181499E-01 -3.00000 0.485874E-01 -2.00000 0.126928 -1.00000 0.313262 -0.500000 0.474077 -0.500000E-01 0.668460 -0.500000E-02 0.690650 -0.500000E-03 0.692897 0.00000 0.693147 0.500000E-03 0.693397 0.500000E-02 0.695650 0.500000E-01 0.718460 0.500000 0.974077 1.00000 1.31326 2.00000 2.12693 3.00000 3.04859 4.00000 4.01815 5.00000 5.00672 50.0000 50.0000 500.000 500.000 5000.00 5000.00 50000.0 50000.0 R8_SWAP_TEST R8_SWAP swaps two reals. Before swapping: X = 1.00000 Y = 3.14159 After swapping: X = 3.14159 Y = 1.00000 R8_SWAP3_TEST R8_SWAP3 swaps three reals. X Y Z Before: 1.00000 3.14159 1952.00 Swap 1 3.14159 1952.00 1.00000 Swap 2 1952.00 1.00000 3.14159 Swap 3 1.00000 3.14159 1952.00 R8_TAND_TEST R8_TAND computes the tangent of an angle given in degrees. ANGLE R8_TAND(ANGLE) 0.00 0.00000 15.00 0.267949 30.00 0.577350 45.00 1.00000 60.00 1.73205 75.00 3.73205 90.00 Undefined 105.00 -3.73205 120.00 -1.73205 135.00 -1.00000 150.00 -0.577350 165.00 -0.267949 180.00 -0.122465E-15 195.00 0.267949 210.00 0.577350 225.00 1.00000 240.00 1.73205 255.00 3.73205 270.00 Undefined 285.00 -3.73205 300.00 -1.73205 315.00 -1.00000 330.00 -0.577350 345.00 -0.267949 360.00 -0.244929E-15 R8_TINY_TEST R8_TINY returns a "tiny" R8; R8_TINY ( ) = 0.2225073858507201-307 TINY ( 1.0D+00 ) = 0.2225073858507201-307 R8_TO_I4_TEST R8_TO_I4 finds an integer IX in [IXMIN,IXMAX] corresponding to X in [XMIN,XMAX]. XMIN 2.50000 X = 3.50000 XMAX = 5.50000 IXMIN 10 IX = 20 IXMAX = 40 R8_TO_R8_DISCRETE_TEST R8_TO_R8_DISCRETE maps numbers to a discrete set of equally spaced numbers in an interval. Number of discrete values = 19 Real interval: 1.00000 10.0000 R RD -0.394281 1.00000 0.848374 1.00000 9.90642 10.0000 8.76232 8.57895 7.79045 7.63158 2.46805 2.42105 2.21979 2.42105 10.5837 10.0000 3.87113 3.84211 10.9653 10.0000 7.74192 7.63158 7.38171 7.15789 3.97627 3.84211 -0.816940 1.00000 2.38643 2.42105 R8_UNIFORM_AB_TEST R8_UNIFORM returns random values in a given range: [ B, C ] For this problem: B = 10.0000 C = 20.0000 16.3101 12.6609 15.0082 19.5006 16.6621 12.5654 15.3615 15.4306 17.6354 18.5120 R8_WALSH_1D_TEST R8_WALSH_1D evaluates 1D Walsh functions: X W(+2) W(+1) W(0) W(-1) W(-2) W(-3) 0.000000 0.0 0.0 0.0 0.0 0.0 0.0 0.250000 0.0 0.0 0.0 0.0 1.0 0.0 0.500000 0.0 0.0 0.0 1.0 0.0 0.0 0.750000 0.0 0.0 0.0 1.0 1.0 0.0 1.000000 0.0 0.0 1.0 0.0 0.0 0.0 1.250000 0.0 0.0 1.0 0.0 1.0 0.0 1.500000 0.0 0.0 1.0 1.0 0.0 0.0 1.750000 0.0 0.0 1.0 1.0 1.0 0.0 2.000000 0.0 1.0 0.0 0.0 0.0 0.0 2.250000 0.0 1.0 0.0 0.0 1.0 0.0 2.500000 0.0 1.0 0.0 1.0 0.0 0.0 2.750000 0.0 1.0 0.0 1.0 1.0 0.0 3.000000 0.0 1.0 1.0 0.0 0.0 0.0 3.250000 0.0 1.0 1.0 0.0 1.0 0.0 3.500000 0.0 1.0 1.0 1.0 0.0 0.0 3.750000 0.0 1.0 1.0 1.0 1.0 0.0 4.000000 1.0 0.0 0.0 0.0 0.0 0.0 4.250000 1.0 0.0 0.0 0.0 1.0 0.0 4.500000 1.0 0.0 0.0 1.0 0.0 0.0 4.750000 1.0 0.0 0.0 1.0 1.0 0.0 5.000000 1.0 0.0 1.0 0.0 0.0 0.0 5.250000 1.0 0.0 1.0 0.0 1.0 0.0 5.500000 1.0 0.0 1.0 1.0 0.0 0.0 5.750000 1.0 0.0 1.0 1.0 1.0 0.0 6.000000 1.0 1.0 0.0 0.0 0.0 0.0 6.250000 1.0 1.0 0.0 0.0 1.0 0.0 6.500000 1.0 1.0 0.0 1.0 0.0 0.0 6.750000 1.0 1.0 0.0 1.0 1.0 0.0 7.000000 1.0 1.0 1.0 0.0 0.0 0.0 7.250000 1.0 1.0 1.0 0.0 1.0 0.0 7.500000 1.0 1.0 1.0 1.0 0.0 0.0 7.750000 1.0 1.0 1.0 1.0 1.0 0.0 8.000000 0.0 0.0 0.0 0.0 0.0 0.0 R8_WRAP_TEST R8_WRAP "wraps" an R8 to lie within an interval: Wrapping interval is 3.00000 , 6.50000 R R8_WRAP ( R ) -1.28573 5.71427 10.2041 3.20408 0.322538 3.82254 1.93125 5.43125 10.7839 3.78393 1.93603 5.43603 9.79564 6.29564 1.97593 5.47593 10.7659 3.76592 6.15865 6.15865 2.29172 5.79172 2.10462 5.60462 6.90523 3.40523 7.65916 4.15916 4.63842 4.63842 10.8105 3.81046 1.37516 4.87516 0.899677 4.39968 2.33204 5.83204 9.85016 6.35016 R82COL_PRINT_PART_TEST R82COL_PRINT_PART prints part of an R82COL. Output with MAX_PRINT = 2 1: 11.0000 12.0000 2: 21.0000 22.0000 ...more entries... Output with MAX_PRINT = 5 1: 11.0000 12.0000 2: 21.0000 22.0000 3: 31.0000 32.0000 ........ .............. .............. 10: 101.000 102.000 Output with MAX_PRINT = 25 1: 11.0000 12.0000 2: 21.0000 22.0000 3: 31.0000 32.0000 4: 41.0000 42.0000 5: 51.0000 52.0000 6: 61.0000 62.0000 7: 71.0000 72.0000 8: 81.0000 82.0000 9: 91.0000 92.0000 10: 101.000 102.000 R82ROW_ORDER_TYPE_TEST R82ROW_ORDER_TYPE classifies a R8VEC as -1: no order 0: all equal; 1: ascending; 2: strictly ascending; 3: descending; 4: strictly descending. Order type = -1 1 1.00000 2.00000 2 1.00000 3.00000 3 3.00000 2.00000 4 2.00000 1.00000 Order type = -1 1 1.00000 0.00000 2 0.00000 1.00000 3 3.00000 1.00000 4 1.00000 3.00000 Order type = -1 1 2.00000 2.00000 2 2.00000 3.00000 3 1.00000 0.00000 4 1.00000 2.00000 Order type = 3 1 1.00000 3.00000 2 1.00000 2.00000 3 1.00000 1.00000 4 1.00000 1.00000 Order type = -1 1 0.00000 3.00000 2 1.00000 1.00000 3 2.00000 3.00000 4 2.00000 2.00000 Order type = -1 1 2.00000 1.00000 2 1.00000 2.00000 3 2.00000 3.00000 4 1.00000 0.00000 Order type = -1 1 2.00000 2.00000 2 2.00000 0.00000 3 1.00000 2.00000 4 3.00000 2.00000 Order type = -1 1 2.00000 1.00000 2 0.00000 3.00000 3 1.00000 3.00000 4 0.00000 1.00000 Order type = -1 1 2.00000 1.00000 2 2.00000 2.00000 3 3.00000 0.00000 4 1.00000 1.00000 Order type = -1 1 1.00000 1.00000 2 2.00000 3.00000 3 1.00000 1.00000 4 3.00000 1.00000 R82ROW_PART_QUICK_A_TEST R82ROW_PART_QUICK_A reorders an R82ROW as part of a quick sort. Before rearrangement: 1 8.56564 7.30344 2 7.83917 7.98965 3 3.43927 4.92428 4 0.238175 9.13007 5 8.89286 7.17337 6 4.03035 6.84523 7 2.53551 3.97345 8 7.47825 1.66543 9 6.19620 6.58503 10 1.87830 4.41055 11 6.88934 9.90945 12 0.904807 6.38311 Rearranged array Left index = 10 Key index = 11 Right index = 12 Left half: 1 7.83917 7.98965 2 3.43927 4.92428 3 0.238175 9.13007 4 0.904807 6.38311 5 4.03035 6.84523 6 2.53551 3.97345 7 7.47825 1.66543 8 6.19620 6.58503 9 1.87830 4.41055 10 6.88934 9.90945 Key: 1 8.56564 7.30344 Right half: 1 8.89286 7.17337 R82ROW_PRINT_PART_TEST R82ROW_PRINT_PART prints part of an R82ROW as a list of columns (that is, transposed). Output with MAX_PRINT = 2 1: 11.0000 21.0000 2: 12.0000 22.0000 ...more entries... Output with MAX_PRINT = 5 1: 11.0000 21.0000 2: 12.0000 22.0000 3: 13.0000 23.0000 ........ .............. .............. 10: 20.0000 30.0000 Output with MAX_PRINT = 25 1: 11.0000 21.0000 2: 12.0000 22.0000 3: 13.0000 23.0000 4: 14.0000 24.0000 5: 15.0000 25.0000 6: 16.0000 26.0000 7: 17.0000 27.0000 8: 18.0000 28.0000 9: 19.0000 29.0000 10: 20.0000 30.0000 R82ROW_SORT_HEAP_INDEX_A_TEST R82ROW_SORT_HEAP_INDEX_A index sorts an R82ROW using heapsort. Before rearrangement: 1 6.84983 3.43287 2 7.39472 9.51492 3 6.27897 9.52816 4 5.78457 9.96385 5 6.27897 4.50309 6 2.26164 3.43287 7 4.50105 5.85586 8 4.61145 0.957237 9 9.30400 9.51492 10 7.55563 2.84051 11 4.50105 5.85586 12 5.78457 8.86153 I Index A(Index) 1 6 2.26164 3.43287 2 11 4.50105 5.85586 3 7 4.50105 5.85586 4 8 4.61145 0.957237 5 12 5.78457 8.86153 6 4 5.78457 9.96385 7 5 6.27897 4.50309 8 3 6.27897 9.52816 9 1 6.84983 3.43287 10 2 7.39472 9.51492 11 10 7.55563 2.84051 12 9 9.30400 9.51492 After rearrangement by R82ROW_PERMUTE: 1 2.26164 3.43287 2 4.50105 5.85586 3 4.50105 5.85586 4 4.61145 0.957237 5 5.78457 8.86153 6 5.78457 9.96385 7 6.27897 4.50309 8 6.27897 9.52816 9 6.84983 3.43287 10 7.39472 9.51492 11 7.55563 2.84051 12 9.30400 9.51492 R82ROW_SORT_QUICK_A_TEST R82ROW_SORT_QUICK_A sorts an R82ROW using quick sort. Before rearrangement: 1 9.53229 8.44081 2 2.84414 7.80900 3 6.42768 8.67897 4 5.42023 5.83066 5 6.42768 1.34671 6 8.48464 8.44081 7 3.59992 6.66522 8 3.16265 1.35663 9 1.63287 7.80900 10 8.96368 5.02428 11 3.59992 6.66522 12 5.42023 7.20035 Sorted array: 1 1.63287 7.80900 2 2.84414 7.80900 3 3.16265 1.35663 4 3.59992 6.66522 5 3.59992 6.66522 6 5.42023 5.83066 7 5.42023 7.20035 8 6.42768 1.34671 9 6.42768 8.67897 10 8.48464 8.44081 11 8.96368 5.02428 12 9.53229 8.44081 R83COL_PRINT_PART_TEST R83COL_PRINT_PART prints part of an R83COL. Output with MAX_PRINT = 2 1: 11.0000 12.0000 13.0000 2: 21.0000 22.0000 23.0000 ...more entries... Output with MAX_PRINT = 5 1: 11.0000 12.0000 13.0000 2: 21.0000 22.0000 23.0000 3: 31.0000 32.0000 33.0000 ........ .............. .............. .............. 10: 101.000 102.000 103.000 Output with MAX_PRINT = 25 1: 11.0000 12.0000 13.0000 2: 21.0000 22.0000 23.0000 3: 31.0000 32.0000 33.0000 4: 41.0000 42.0000 43.0000 5: 51.0000 52.0000 53.0000 6: 61.0000 62.0000 63.0000 7: 71.0000 72.0000 73.0000 8: 81.0000 82.0000 83.0000 9: 91.0000 92.0000 93.0000 10: 101.000 102.000 103.000 R83ROW_PRINT_PART_TEST R83ROW_PRINT_PART prints part of an R83ROW as a list of columns (that is, transposed). Output with MAX_PRINT = 2 1: 11.0000 21.0000 31.0000 2: 12.0000 22.0000 32.0000 ...more entries... Output with MAX_PRINT = 5 1: 11.0000 21.0000 31.0000 2: 12.0000 22.0000 32.0000 3: 13.0000 23.0000 33.0000 ........ .............. .............. .............. 10: 20.0000 30.0000 40.0000 Output with MAX_PRINT = 25 1: 11.0000 21.0000 31.0000 2: 12.0000 22.0000 32.0000 3: 13.0000 23.0000 33.0000 4: 14.0000 24.0000 34.0000 5: 15.0000 25.0000 35.0000 6: 16.0000 26.0000 36.0000 7: 17.0000 27.0000 37.0000 8: 18.0000 28.0000 38.0000 9: 19.0000 29.0000 39.0000 10: 20.0000 30.0000 40.0000 R8BLOCK_EXPAND_LINEAR_TEST R8BLOCK_EXPAND_LINEAR linearly interpolates new data between old values in a 3D block. Original block: K = 1 1 2 3 1 1.00000 1.00000 1.00000 2 2.00000 4.00000 8.00000 3 3.00000 9.00000 27.0000 4 4.00000 16.0000 64.0000 K = 2 1 2 3 1 2.00000 2.00000 2.00000 2 4.00000 8.00000 16.0000 3 6.00000 18.0000 54.0000 4 8.00000 32.0000 128.000 LFAT = 1 MFAT = 2 NFAT = 1 Fattened block: K = 1 1 2 3 4 5 1 1.00000 1.00000 1.00000 1.00000 1.00000 2 1.50000 1.83333 2.16667 2.50000 3.16667 3 2.00000 2.66667 3.33333 4.00000 5.33333 4 2.50000 3.83333 5.16667 6.50000 10.1667 5 3.00000 5.00000 7.00000 9.00000 15.0000 6 3.50000 6.50000 9.50000 12.5000 23.5000 7 4.00000 8.00000 12.0000 16.0000 32.0000 6 7 1 1.00000 1.00000 2 3.83333 4.50000 3 6.66667 8.00000 4 13.8333 17.5000 5 21.0000 27.0000 6 34.5000 45.5000 7 48.0000 64.0000 K = 2 1 2 3 4 5 1 1.50000 1.50000 1.50000 1.50000 1.50000 2 2.25000 2.75000 3.25000 3.75000 4.75000 3 3.00000 4.00000 5.00000 6.00000 8.00000 4 3.75000 5.75000 7.75000 9.75000 15.2500 5 4.50000 7.50000 10.5000 13.5000 22.5000 6 5.25000 9.75000 14.2500 18.7500 35.2500 7 6.00000 12.0000 18.0000 24.0000 48.0000 6 7 1 1.50000 1.50000 2 5.75000 6.75000 3 10.0000 12.0000 4 20.7500 26.2500 5 31.5000 40.5000 6 51.7500 68.2500 7 72.0000 96.0000 K = 3 1 2 3 4 5 1 2.00000 2.00000 2.00000 2.00000 2.00000 2 3.00000 3.66667 4.33333 5.00000 6.33333 3 4.00000 5.33333 6.66667 8.00000 10.6667 4 5.00000 7.66667 10.3333 13.0000 20.3333 5 6.00000 10.0000 14.0000 18.0000 30.0000 6 7.00000 13.0000 19.0000 25.0000 47.0000 7 8.00000 16.0000 24.0000 32.0000 64.0000 6 7 1 2.00000 2.00000 2 7.66667 9.00000 3 13.3333 16.0000 4 27.6667 35.0000 5 42.0000 54.0000 6 69.0000 91.0000 7 96.0000 128.000 R8BLOCK_PRINT_TEST R8BLOCK_PRINT prints an R8BLOCK. The 3D array: K = 1 1 2 3 1 1.00000 1.00000 1.00000 2 2.00000 4.00000 8.00000 3 3.00000 9.00000 27.0000 4 4.00000 16.0000 64.0000 K = 2 1 2 3 1 2.00000 2.00000 2.00000 2 4.00000 8.00000 16.0000 3 6.00000 18.0000 54.0000 4 8.00000 32.0000 128.000 R8R8VEC_INDEX_INSERT_UNIQUE_TEST R8R8VEC_INDEX_INSERT_UNIQUE inserts unique values into an index sorted array. Generate 30 random values: Index XVAL YVAL 1 1.00 3.00 2 2.00 2.00 3 3.00 1.00 4 2.00 3.00 3 3.00 1.00 4 2.00 3.00 5 4.00 3.00 5 4.00 3.00 1 1.00 3.00 3 3.00 1.00 2 2.00 2.00 2 2.00 2.00 4 2.00 3.00 5 4.00 3.00 6 3.00 2.00 6 3.00 2.00 7 3.00 3.00 8 4.00 1.00 9 1.00 2.00 2 2.00 2.00 7 3.00 3.00 10 1.00 1.00 5 4.00 3.00 3 3.00 1.00 10 1.00 1.00 10 1.00 1.00 11 2.00 1.00 3 3.00 1.00 6 3.00 2.00 2 2.00 2.00 Vector of unique X Y values: I X(I) Y(I) 1 1.00 3.00 2 2.00 2.00 3 3.00 1.00 4 2.00 3.00 5 4.00 3.00 6 3.00 2.00 7 3.00 3.00 8 4.00 1.00 9 1.00 2.00 10 1.00 1.00 11 2.00 1.00 X, Y sorted by index I INDX(I) X(INDX(I)) Y(INDX(I)) 1 10 1.00 1.00 2 9 1.00 2.00 3 1 1.00 3.00 4 11 2.00 1.00 5 2 2.00 2.00 6 4 2.00 3.00 7 3 3.00 1.00 8 6 3.00 2.00 9 7 3.00 3.00 10 8 4.00 1.00 11 5 4.00 3.00 R8R8R8VEC_INDEX_INSERT_UNIQUE_TEST R8R8R8VEC_INDEX_INSERT_UNIQUE inserts unique values into an index sorted array. Number of random values to generate = 30 XVAL YVAL ZVAL Index 1 3.00 2.00 3.00 2 1.00 1.00 3.00 3 4.00 3.00 1.00 1 3.00 2.00 3.00 4 2.00 3.00 3.00 5 3.00 1.00 2.00 6 2.00 2.00 4.00 7 1.00 2.00 2.00 8 4.00 2.00 3.00 9 2.00 2.00 2.00 10 1.00 3.00 3.00 11 1.00 3.00 2.00 12 2.00 1.00 4.00 13 4.00 3.00 4.00 14 4.00 1.00 4.00 8 4.00 2.00 3.00 15 3.00 2.00 2.00 16 2.00 2.00 3.00 17 3.00 1.00 4.00 15 3.00 2.00 2.00 9 2.00 2.00 2.00 18 4.00 2.00 4.00 1 3.00 2.00 3.00 16 2.00 2.00 3.00 19 2.00 1.00 2.00 20 3.00 3.00 1.00 14 4.00 1.00 4.00 21 2.00 1.00 3.00 12 2.00 1.00 4.00 22 2.00 3.00 2.00 Vector of unique X Y Z values: I X(I) Y(I) Z(I) 1 3.00 2.00 3.00 2 1.00 1.00 3.00 3 4.00 3.00 1.00 4 2.00 3.00 3.00 5 3.00 1.00 2.00 6 2.00 2.00 4.00 7 1.00 2.00 2.00 8 4.00 2.00 3.00 9 2.00 2.00 2.00 10 1.00 3.00 3.00 11 1.00 3.00 2.00 12 2.00 1.00 4.00 13 4.00 3.00 4.00 14 4.00 1.00 4.00 15 3.00 2.00 2.00 16 2.00 2.00 3.00 17 3.00 1.00 4.00 18 4.00 2.00 4.00 19 2.00 1.00 2.00 20 3.00 3.00 1.00 21 2.00 1.00 3.00 22 2.00 3.00 2.00 X Y Z sorted by index: I INDX(I) X(I) X(INDX(I)) 1 2 1.00 1.00 3.00 2 7 1.00 2.00 2.00 3 11 1.00 3.00 2.00 4 10 1.00 3.00 3.00 5 19 2.00 1.00 2.00 6 21 2.00 1.00 3.00 7 12 2.00 1.00 4.00 8 9 2.00 2.00 2.00 9 16 2.00 2.00 3.00 10 6 2.00 2.00 4.00 11 22 2.00 3.00 2.00 12 4 2.00 3.00 3.00 13 5 3.00 1.00 2.00 14 17 3.00 1.00 4.00 15 15 3.00 2.00 2.00 16 1 3.00 2.00 3.00 17 20 3.00 3.00 1.00 18 14 4.00 1.00 4.00 19 8 4.00 2.00 3.00 20 18 4.00 2.00 4.00 21 3 4.00 3.00 1.00 22 13 4.00 3.00 4.00 R8INT_TO_I4INT_TEST For data in an interval, R8INT_TO_I4INT converts a real to an integer. Integer interval: 1 11 Real interval: 100.000 200.000 R I(R) R(I(R)) 170.856 8 170.000 131.446 4 130.000 147.275 6 150.000 91.9620 0 90.0000 187.490 10 190.000 193.378 10 190.000 210.620 12 210.000 208.663 12 210.000 138.505 5 140.000 207.510 12 210.000 R8MAT_CHOLESKY_FACTOR_TEST R8MAT_CHOLESKY_FACTOR determines the lower triangular Cholesky factorization of a positive definite symmetric matrix, Matrix to be factored: Col 1 2 3 4 5 Row 1: 2.00000 -1.00000 0.00000 0.00000 0.00000 2: -1.00000 2.00000 -1.00000 0.00000 0.00000 3: 0.00000 -1.00000 2.00000 -1.00000 0.00000 4: 0.00000 0.00000 -1.00000 2.00000 -1.00000 5: 0.00000 0.00000 0.00000 -1.00000 2.00000 Cholesky factor L: Col 1 2 3 4 5 Row 1: 1.41421 0.00000 0.00000 0.00000 0.00000 2: -0.707107 1.22474 0.00000 0.00000 0.00000 3: 0.00000 -0.816497 1.15470 0.00000 0.00000 4: 0.00000 0.00000 -0.866025 1.11803 0.00000 5: 0.00000 0.00000 0.00000 -0.894427 1.09545 Product L * L': Col 1 2 3 4 5 Row 1: 2.00000 -1.00000 0.00000 0.00000 0.00000 2: -1.00000 2.00000 -1.00000 0.00000 0.00000 3: 0.00000 -1.00000 2.00000 -1.00000 0.00000 4: 0.00000 0.00000 -1.00000 2.00000 -1.00000 5: 0.00000 0.00000 0.00000 -1.00000 2.00000 R8MAT_CHOLESKY_FACTOR_UPPER_TEST R8MAT_CHOLESKY_FACTOR_UPPER determines the upper triangular Cholesky factorization of a positive definite symmetric matrix, Matrix A to be factored: Col 1 2 3 4 5 Row 1: 5.88162 0.854058 0.586819 0.534998 0.504093 2: 0.854058 5.01869 0.472988 0.156499 0.772229 3: 0.586819 0.472988 5.46677 0.489716 0.994781 4: 0.534998 0.156499 0.489716 5.37112 0.412558 5: 0.504093 0.772229 0.994781 0.412558 5.65705 Upper Cholesky factor R: Col 1 2 3 4 5 Row 1: 2.42521 0.352159 0.241967 0.220599 0.207856 2: 0.00000 2.21239 0.175275 0.356234E-01 0.315962 3: 0.00000 0.00000 2.31894 0.185470 0.383410 4: 0.00000 0.00000 0.00000 2.29930 0.123663 5: 0.00000 0.00000 0.00000 0.00000 2.31338 Product R' * R: Col 1 2 3 4 5 Row 1: 5.88162 0.854058 0.586819 0.534998 0.504093 2: 0.854058 5.01869 0.472988 0.156499 0.772229 3: 0.586819 0.472988 5.46677 0.489716 0.994781 4: 0.534998 0.156499 0.489716 5.37112 0.412558 5: 0.504093 0.772229 0.994781 0.412558 5.65705 R8MAT_CHOLESKY_INVERSE_TEST For a positive definite symmetric matrix, R8MAT_CHOLESKY_INVERSE computes the inverse. Matrix to be inverted: Col 1 2 3 4 5 Row 1: 2.00000 -1.00000 0.00000 0.00000 0.00000 2: -1.00000 2.00000 -1.00000 0.00000 0.00000 3: 0.00000 -1.00000 2.00000 -1.00000 0.00000 4: 0.00000 0.00000 -1.00000 2.00000 -1.00000 5: 0.00000 0.00000 0.00000 -1.00000 2.00000 Inverse matrix: Col 1 2 3 4 5 Row 1: 0.833333 0.666667 0.500000 0.333333 0.166667 2: 0.666667 1.33333 1.00000 0.666667 0.333333 3: 0.500000 1.00000 1.50000 1.00000 0.500000 4: 0.333333 0.666667 1.00000 1.33333 0.666667 5: 0.166667 0.333333 0.500000 0.666667 0.833333 Product inv(A) * A: Col 1 2 3 4 5 Row 1: 1.00000 0.222045E-15 0.00000 -0.111022E-15 0.00000 2: -0.666134E-15 1.00000 0.222045E-15 -0.166533E-15 -0.111022E-15 3: -0.666134E-15 0.111022E-14 1.00000 -0.222045E-15 0.00000 4: -0.444089E-15 0.666134E-15 0.00000 1.00000 0.00000 5: -0.166533E-15 0.222045E-15 0.555112E-16 -0.222045E-15 1.00000 R8MAT_CHOLESKY_SOLVE_TEST For a positive definite symmetric matrix, R8MAT_CHOLESKY_SOLVE solves a linear system using the lower Cholesky factorization. Matrix to be factored: Col 1 2 3 4 5 Row 1: 2.00000 -1.00000 0.00000 0.00000 0.00000 2: -1.00000 2.00000 -1.00000 0.00000 0.00000 3: 0.00000 -1.00000 2.00000 -1.00000 0.00000 4: 0.00000 0.00000 -1.00000 2.00000 -1.00000 5: 0.00000 0.00000 0.00000 -1.00000 2.00000 Cholesky factor L: Col 1 2 3 4 5 Row 1: 1.41421 0.00000 0.00000 0.00000 0.00000 2: -0.707107 1.22474 0.00000 0.00000 0.00000 3: 0.00000 -0.816497 1.15470 0.00000 0.00000 4: 0.00000 0.00000 -0.866025 1.11803 0.00000 5: 0.00000 0.00000 0.00000 -0.894427 1.09545 Product L * L': Col 1 2 3 4 5 Row 1: 2.00000 -1.00000 0.00000 0.00000 0.00000 2: -1.00000 2.00000 -1.00000 0.00000 0.00000 3: 0.00000 -1.00000 2.00000 -1.00000 0.00000 4: 0.00000 0.00000 -1.00000 2.00000 -1.00000 5: 0.00000 0.00000 0.00000 -1.00000 2.00000 Right hand side: 1: 0.0000000 2: 0.0000000 3: 0.0000000 4: 0.0000000 5: 6.0000000 Computed solution: 1: 1.0000000 2: 2.0000000 3: 3.0000000 4: 4.0000000 5: 5.0000000 R8MAT_CHOLESKY_SOLVE_UPPER_TEST For a positive definite symmetric matrix, R8MAT_CHOLESKY_SOLVE_UPPER solves a linear system using the upper Cholesky factorization. Matrix to be factored: Col 1 2 3 4 5 Row 1: 2.00000 -1.00000 0.00000 0.00000 0.00000 2: -1.00000 2.00000 -1.00000 0.00000 0.00000 3: 0.00000 -1.00000 2.00000 -1.00000 0.00000 4: 0.00000 0.00000 -1.00000 2.00000 -1.00000 5: 0.00000 0.00000 0.00000 -1.00000 2.00000 Cholesky factor R: Col 1 2 3 4 5 Row 1: 1.41421 -0.707107 0.00000 0.00000 0.00000 2: 0.00000 1.22474 -0.816497 0.00000 0.00000 3: 0.00000 0.00000 1.15470 -0.866025 0.00000 4: 0.00000 0.00000 0.00000 1.11803 -0.894427 5: 0.00000 0.00000 0.00000 0.00000 1.09545 Product R' * R: Col 1 2 3 4 5 Row 1: 2.00000 -1.00000 0.00000 0.00000 0.00000 2: -1.00000 2.00000 -1.00000 0.00000 0.00000 3: 0.00000 -1.00000 2.00000 -1.00000 0.00000 4: 0.00000 0.00000 -1.00000 2.00000 -1.00000 5: 0.00000 0.00000 0.00000 -1.00000 2.00000 Right hand side: 1: 0.0000000 2: 0.0000000 3: 0.0000000 4: 0.0000000 5: 6.0000000 Computed solution: 1: 1.0000000 2: 2.0000000 3: 3.0000000 4: 4.0000000 5: 5.0000000 R8MAT_DET_2D_TEST R8MAT_DET_2D: determinant of a 2 by 2 matrix; Matrix: Col 1 2 Row 1: 1.00000 1.00000 2: 1.00000 10.0000 R8MAT_DET_2D computes determinant: 9.00000 Exact determinant is 9.00000 R8MAT_DET_3D_TEST R8MAT_DET_3D: determinant of a 3 by 3 matrix; Matrix: Col 1 2 3 Row 1: 1.00000 1.00000 1.00000 2: 1.00000 10.0000 100.000 3: 1.00000 4.00000 16.0000 R8MAT_DET_3D computes determinant: -162.000 Exact determinant is -162.000 R8MAT_DET_4D_TEST R8MAT_DET_4D determinant of a 4 by 4 matrix; Matrix: Col 1 2 3 4 Row 1: 1.00000 1.00000 1.00000 1.00000 2: 1.00000 10.0000 100.000 1000.00 3: 1.00000 4.00000 16.0000 64.0000 4: 1.00000 2.00000 4.00000 8.00000 R8MAT_DET_4D computes determinant: -2592.00 Exact determinant is -2592.00 R8MAT_DET_5D_TEST R8MAT_DET_5D: determinant of 5 by 5 matrix. Matrix: Col 1 2 3 4 5 Row 1: 1.00000 1.00000 1.00000 1.00000 1.00000 2: 1.00000 10.0000 100.000 1000.00 10000.0 3: 1.00000 4.00000 16.0000 64.0000 256.000 4: 1.00000 2.00000 4.00000 8.00000 16.0000 5: 1.00000 3.00000 9.00000 27.0000 81.0000 R8MAT_DET_5D computes determinant: -36288.0 Exact determinant is -36288.0 R8MAT_EXPAND_LINEAR_TEST R8MAT_EXPAND_LINEAR linearly interpolates new data between old values in a matrix. Original matrix: Col 1 2 3 Row 1: 1.00000 1.00000 1.00000 2: 2.00000 4.00000 8.00000 3: 3.00000 9.00000 27.0000 4: 4.00000 16.0000 64.0000 MFAT = 2 NFAT = 1 Fattened matrix: Col 1 2 3 4 5 Row 1: 1.00000 1.00000 1.00000 1.00000 1.00000 2: 1.33333 1.66667 2.00000 2.66667 3.33333 3: 1.66667 2.33333 3.00000 4.33333 5.66667 4: 2.00000 3.00000 4.00000 6.00000 8.00000 5: 2.33333 4.00000 5.66667 10.0000 14.3333 6: 2.66667 5.00000 7.33333 14.0000 20.6667 7: 3.00000 6.00000 9.00000 18.0000 27.0000 8: 3.33333 7.33333 11.3333 25.3333 39.3333 9: 3.66667 8.66667 13.6667 32.6667 51.6667 10: 4.00000 10.0000 16.0000 40.0000 64.0000 R8MAT_EXPAND_LINEAR2_TEST R8MAT_EXPAND_LINEAR2 fills in a large array by interpolating data from a small array. Original matrix has dimensions: 3 2 Expanded matrix has dimensions: 10 5 The little matrix A: Col 1 2 Row 1: 11.0000 12.0000 2: 21.0000 22.0000 3: 31.0000 32.0000 Expanded array A2: Col 1 2 3 4 5 Row 1: 11.0000 11.2500 11.5000 11.7500 12.0000 2: 13.2222 13.4722 13.7222 13.9722 14.2222 3: 15.4444 15.6944 15.9444 16.1944 16.4444 4: 17.6667 17.9167 18.1667 18.4167 18.6667 5: 19.8889 20.1389 20.3889 20.6389 20.8889 6: 22.1111 22.3611 22.6111 22.8611 23.1111 7: 24.3333 24.5833 24.8333 25.0833 25.3333 8: 26.5556 26.8056 27.0556 27.3056 27.5556 9: 28.7778 29.0278 29.2778 29.5278 29.7778 10: 31.0000 31.2500 31.5000 31.7500 32.0000 R8MAT_FS_TEST For a matrix in general storage, R8MAT_FS factors and solves a linear system. Matrix order N = 10 Solution: 1: 1.0000000 2: 2.0000000 3: 3.0000000 4: 4.0000000 5: 5.0000000 6: 6.0000000 7: 7.0000000 8: 8.0000000 9: 9.0000000 10: 10.000000 r8mat_fss_test r8mat_fss() factors a square matrix and solves multiple linear systems. Matrix order N = 10 Desired solutions: Col 1 2 3 Row 1: 1.00000 1.00000 1.00000 2: 1.00000 2.00000 2.00000 3: 1.00000 3.00000 3.00000 4: 1.00000 4.00000 1.00000 5: 1.00000 5.00000 2.00000 6: 1.00000 6.00000 3.00000 7: 1.00000 7.00000 1.00000 8: 1.00000 8.00000 2.00000 9: 1.00000 9.00000 3.00000 10: 1.00000 10.0000 1.00000 Computed solutions: Col 1 2 3 Row 1: 1.00000 1.00000 1.00000 2: 1.00000 2.00000 2.00000 3: 1.00000 3.00000 3.00000 4: 1.00000 4.00000 1.00000 5: 1.00000 5.00000 2.00000 6: 1.00000 6.00000 3.00000 7: 1.00000 7.00000 1.00000 8: 1.00000 8.00000 2.00000 9: 1.00000 9.00000 3.00000 10: 1.00000 10.0000 1.00000 R8MAT_GIVENS_POST_TEST R8MAT_GIVENS_POST computes a Givens postmultiplier rotation matrix. Matrix A: Col 1 2 3 Row 1: 1.00000 1.00000 1.00000 2: 1.00000 2.00000 4.00000 3: 1.00000 3.00000 9.00000 I, J= 3 2 G Col 1 2 3 Row 1: 1.00000 0.00000 0.00000 2: 0.00000 0.948683 0.316228 3: 0.00000 -0.316228 0.948683 A*G Col 1 2 3 Row 1: 1.00000 0.632456 1.26491 2: 1.00000 0.632456 4.42719 3: 1.00000 -0.388578E-15 9.48683 R8MAT_GIVENS_PRE_TEST R8MAT_GIVENS_PRE computes a Givens premultiplier rotation matrix. Matrix A: Col 1 2 3 Row 1: 1.00000 1.00000 1.00000 2: 1.00000 2.00000 4.00000 3: 1.00000 3.00000 9.00000 I, J= 3 2 G Col 1 2 3 Row 1: 1.00000 0.00000 0.00000 2: 0.00000 0.554700 0.832050 3: 0.00000 -0.832050 0.554700 G*A Col 1 2 3 Row 1: 1.00000 1.00000 1.00000 2: 1.38675 3.60555 9.70725 3: -0.277350 0.00000 1.66410 R8MAT_HESS_TEST R8MAT_HESS estimates the Hessian matrix of a scalar function. Estimated jacobian: Col 1 2 3 Row 1: 2.00000 1.00000 0.00000 2: 1.00000 0.238100E-05 9.88032 3: 0.00000 9.88032 -30.8503 Exact jacobian: Col 1 2 3 Row 1: 2.00000 1.00000 0.00000 2: 1.00000 0.00000 9.88032 3: 0.00000 9.88032 -30.8503 R8MAT_HOUSE_AXH_TEST R8MAT_HOUSE_AXH multiplies a matrix A times a compact Householder matrix. Matrix A: Col 1 2 3 4 5 Row 1: -0.743610 -3.66877 1.63273 0.730178 -2.96552 2: -1.96993 -4.71436 3.88775 4.42558 4.44120 3: 1.26959 3.80767 -2.28764 -0.145821E-01 -4.94717 4: 1.93234 -4.57060 1.33002 -0.360002 -2.86898 5: -2.78962 2.55032 2.67092 1.31625 0.312703 Compact vector V so H*A packs column 3: 1: 0.0000000 2: 0.0000000 3: -0.89678520 4: 0.19723107 5: 0.39607601 Householder matrix H: Col 1 2 3 4 5 Row 1: 1.00000 0.00000 0.00000 0.00000 0.00000 2: 0.00000 1.00000 0.00000 0.00000 0.00000 3: 0.00000 0.00000 -0.608447 0.353748 0.710390 4: 0.00000 0.00000 0.353748 0.922200 -0.156237 5: 0.00000 0.00000 0.710390 -0.156237 0.686248 Indirect product A*H: Col 1 2 3 4 5 Row 1: -0.743610 -3.66877 -2.84181 1.71427 -0.989287 2: -1.96993 -4.71436 2.35503 4.76267 5.11814 3: 1.26959 3.80767 -2.12767 -0.497639E-01 -5.01782 4: 1.93234 -4.57060 -2.97470 0.586739 -0.967754 5: -2.78962 2.55032 -0.937357 2.10982 1.90634 Direct product A*H: Col 1 2 3 4 5 Row 1: -0.743610 -3.66877 -2.84181 1.71427 -0.989287 2: -1.96993 -4.71436 2.35503 4.76267 5.11814 3: 1.26959 3.80767 -2.12767 -0.497639E-01 -5.01782 4: 1.93234 -4.57060 -2.97470 0.586739 -0.967754 5: -2.78962 2.55032 -0.937357 2.10982 1.90634 Product H*A has packed column 3: Col 1 2 3 4 5 Row 1: -0.743610 -3.66877 1.63273 0.730178 -2.96552 2: -1.96993 -4.71436 3.88775 4.42558 4.44120 3: -2.07064 -2.12189 3.75980 0.816571 2.21734 4: 2.66696 -3.26651 -0.148898E-16 -0.542799 -4.44468 5: -1.31437 5.16918 -0.422952E-16 0.949157 -2.85159 R8MAT_HOUSE_FORM_TEST R8MAT_HOUSE_FORM forms a Householder matrix from its compact form. Compact vector form V: 1: 0.0000000 2: 0.0000000 3: 1.0000000 4: 2.0000000 5: 3.0000000 Householder matrix H: Col 1 2 3 4 5 Row 1: 1.00000 0.00000 0.00000 0.00000 0.00000 2: 0.00000 1.00000 0.00000 0.00000 0.00000 3: 0.00000 0.00000 0.857143 -0.285714 -0.428571 4: 0.00000 0.00000 -0.285714 0.428571 -0.857143 5: 0.00000 0.00000 -0.428571 -0.857143 -0.285714 R8MAT_HOUSE_POST_TEST R8MAT_HOUSE_POST computes a Householder postmultiplier; Matrix A: Col 1 2 3 4 5 Row 1: 2.55964 4.11531 4.67899 1.08040 2.71608 2: 0.112376 2.08515 3.16911 0.623030 2.07026 3: 3.44346 3.89927 3.26760 0.861950 1.10305 4: 0.511015 1.73361 4.68569 1.36132 0.997398 5: 3.27359 1.35749 0.213197 2.25441 1.48644 I, J= 2 3 Householder matrix H: Col 1 2 3 4 5 Row 1: 1.00000 0.00000 0.00000 0.00000 0.00000 2: 0.00000 1.00000 0.00000 0.00000 0.00000 3: 0.00000 0.00000 -0.826079 -0.162403 -0.539647 4: 0.00000 0.00000 -0.162403 0.985557 -0.479937E-01 5: 0.00000 0.00000 -0.539647 -0.479937E-01 0.840522 Product A*H: Col 1 2 3 4 5 Row 1: 2.55964 4.11531 -5.50640 0.174559 -0.293932 2: 0.112376 2.08515 -3.83633 -0.121138E-15 0.227601E-16 3: 3.44346 3.89927 -3.43453 0.265894 -0.877582 4: 0.511015 1.73361 -4.63008 0.532822 -1.75562 5: 3.27359 1.35749 -1.34439 2.11588 1.02613 R8MAT_HOUSE_PRE_TEST R8MAT_HOUSE_PRE computes a Householder premultiplier; Matrix A: Col 1 2 3 4 5 Row 1: 3.09730 2.30182 3.37146 3.37470 0.408535 2: 2.69034 2.82187 1.43042 4.41560 2.46775 3: 3.41646 0.992002E-01 3.74849 4.75537 1.26949 4: 1.65978 2.17845 0.706588 0.124043 1.89508 5: 1.48221 1.87111 4.65142 2.85625 1.66686 I, J= 2 3 Householder matrix H: Col 1 2 3 4 5 Row 1: 1.00000 0.00000 0.00000 0.00000 0.00000 2: 0.00000 -0.231339 -0.606235 -0.114275 -0.752265 3: 0.00000 -0.606235 0.701527 -0.562620E-01 -0.370369 4: 0.00000 -0.114275 -0.562620E-01 0.989395 -0.698143E-01 5: 0.00000 -0.752265 -0.370369 -0.698143E-01 0.540418 Product H*A: Col 1 2 3 4 5 Row 1: 3.09730 2.30182 3.37146 3.37470 0.408535 2: -3.99825 -2.36946 -6.18322 -6.06720 -2.81097 3: 0.123416 -2.45669 0.562885E-15 -0.405715 -1.32943 4: 1.03904 1.69667 0.162404E-15 -0.848818 1.40518 5: -2.60406 -1.30044 0.788251E-15 -3.54803 -1.55808 R8MAT_INDICATOR_TEST R8MAT_INDICATOR returns an indicator matrix. The indicator matrix: Col 1 2 3 4 Row 1: 11.0000 12.0000 13.0000 14.0000 2: 21.0000 22.0000 23.0000 24.0000 3: 31.0000 32.0000 33.0000 34.0000 4: 41.0000 42.0000 43.0000 44.0000 5: 51.0000 52.0000 53.0000 54.0000 R8MAT_INVERSE_2D_TEST R8MAT_INVERSE_2D inverts a 2 by 2 matrix. Matrix A to invert: Col 1 2 Row 1: 1.00000 2.00000 2: 3.00000 4.00000 Inverse matrix B: Col 1 2 Row 1: -2.00000 1.00000 2: 1.50000 -0.500000 Product C = A * B: Col 1 2 Row 1: 1.00000 0.00000 2: 0.00000 1.00000 R8MAT_INVERSE_3D_TEST R8MAT_INVERSE_3D inverts a 3 by 3 matrix. Matrix A to be inverted: Col 1 2 3 Row 1: 1.00000 2.00000 3.00000 2: 4.00000 5.00000 6.00000 3: 7.00000 8.00000 0.00000 Inverse matrix B: Col 1 2 3 Row 1: -1.77778 0.888889 -0.111111 2: 1.55556 -0.777778 0.222222 3: -0.111111 0.222222 -0.111111 Product C = A * B: Col 1 2 3 Row 1: 1.00000 -0.111022E-15 0.00000 2: 0.555112E-15 1.00000 0.00000 3: 0.177636E-14 -0.888178E-15 1.00000 R8MAT_INVERSE_4D_TEST R8MAT_INVERSE_4D inverts a 4 x 4 matrix. Matrix A to be inverted: Col 1 2 3 4 Row 1: 4.00000 3.00000 2.00000 1.00000 2: 3.00000 3.00000 2.00000 1.00000 3: 0.00000 2.00000 2.00000 1.00000 4: 0.00000 0.00000 1.00000 1.00000 Determinant is 1.00000 Inverse B: Col 1 2 3 4 Row 1: 1.00000 -1.00000 0.00000 -0.00000 2: -3.00000 4.00000 -1.00000 0.00000 3: 6.00000 -8.00000 3.00000 -1.00000 4: -6.00000 8.00000 -3.00000 2.00000 Product C = A * B: Col 1 2 3 4 Row 1: 1.00000 0.00000 0.00000 0.00000 2: 0.00000 1.00000 0.00000 0.00000 3: 0.00000 0.00000 1.00000 0.00000 4: 0.00000 0.00000 0.00000 1.00000 R8MAT_IS_INTEGER_TEST R8MAT_IS_INTEGER is TRUE if every entry of an R8MAT is an integer. Example 1: Obviously integer Col 1 2 3 Row 1: 1.00000 2.00000 3.00000 2: 4.00000 5.00000 6.00000 A is an integer matrix. Example 2: Obviously NOT integer Col 1 2 3 Row 1: 1.00000 2.00000 3.00000 2: 4.00000 5.00000 6.50000 A is NOT an integer matrix. Example 3: Not obviously not integer Col 1 2 3 Row 1: 1.00000 2.00000 3.00000 2: 4.00000 5.00000 6.00000 A is NOT an integer matrix. Example 4: Not obviously not integer Col 1 2 3 Row 1: 1.00000 2.00000 3.00000 2: 4.00000 5.00000 0.300000E+09 A is NOT an integer matrix. R8MAT_JAC_TEST R8MAT_JAC estimates the M by N jacobian matrix of a nonlinear function. Estimated jacobian: Col 1 2 3 4 Row 1: -0.832330 -0.416160 0.00000 0.00000 2: 0.707110 0.00000 1.00000 0.00000 3: 1.00000 2.00000 3.00000 4.00000 Exact jacobian: Col 1 2 3 4 Row 1: -0.832294 -0.416147 0.00000 0.00000 2: 0.707107 0.00000 1.00000 0.00000 3: 1.00000 2.00000 3.00000 4.00000 R8MAT_KRONECKER_TEST R8MAT_KRONECKER computes the Kronecker product of two matrices. Factor matrix A: Col 1 2 3 Row 1: 1.00000 2.00000 3.00000 2: 4.00000 5.00000 6.00000 Factor matrix B: Col 1 2 Row 1: 7.00000 8.00000 2: 9.00000 10.0000 3: 11.0000 12.0000 Kronecker product C = kron(A,B) Col 1 2 3 4 5 Row 1: 7.00000 8.00000 14.0000 16.0000 21.0000 2: 9.00000 10.0000 18.0000 20.0000 27.0000 3: 11.0000 12.0000 22.0000 24.0000 33.0000 4: 28.0000 32.0000 35.0000 40.0000 42.0000 5: 36.0000 40.0000 45.0000 50.0000 54.0000 6: 44.0000 48.0000 55.0000 60.0000 66.0000 Col 6 Row 1: 24.0000 2: 30.0000 3: 36.0000 4: 48.0000 5: 60.0000 6: 72.0000 R8MAT_L_INVERSE_TEST R8MAT_L_INVERSE inverts a lower triangular matrix. Matrix A to be inverted: Col 1 2 3 4 Row 1: 1.00000 0.00000 0.00000 0.00000 2: 2.00000 3.00000 0.00000 0.00000 3: 4.00000 5.00000 6.00000 0.00000 4: 7.00000 8.00000 9.00000 10.0000 Inverse matrix B: Col 1 2 3 4 Row 1: 1.00000 0.00000 0.00000 0.00000 2: -0.666667 0.333333 0.00000 0.00000 3: -0.111111 -0.277778 0.166667 0.00000 4: -0.666667E-01 -0.166667E-01 -0.150000 0.100000 Product C = A * B: Col 1 2 3 4 Row 1: 1.00000 0.00000 0.00000 0.00000 2: 0.00000 1.00000 0.00000 0.00000 3: 0.00000 0.00000 1.00000 0.00000 4: 0.00000 0.00000 0.00000 1.00000 R8MAT_L_PRINT_TEST R8MAT_L_PRINT prints a lower triangular matrix stored compactly. Only the (possibly) nonzero elements are printed. A 7 by 7 matrix. Col 1 2 3 4 5 6 7 Row 1 11 2 21 22 3 31 32 33 4 41 42 43 44 5 51 52 53 54 55 6 61 62 63 64 65 66 7 71 72 73 74 75 76 77 A 7 by 3 matrix. Col 1 2 3 Row 1 11 2 21 22 3 31 32 33 4 41 42 43 5 51 52 53 6 61 62 63 7 71 72 73 A 4 by 7 matrix. Col 1 2 3 4 Row 1 11 2 21 22 3 31 32 33 4 41 42 43 44 R8MAT_L_SOLVE_TEST R8MAT_L_SOLVE solves a lower triangular system. Input matrix A: Col 1 2 3 4 Row 1: 1.00000 0.00000 0.00000 0.00000 2: 2.00000 3.00000 0.00000 0.00000 3: 4.00000 5.00000 6.00000 0.00000 4: 7.00000 8.00000 9.00000 10.0000 Right hand side b: 1: 1.0000000 2: 8.0000000 3: 32.000000 4: 90.000000 Computed solution x: 1: 1.0000000 2: 2.0000000 3: 3.0000000 4: 4.0000000 Norm of A*x-b = 0.00000 R8MAT_L1_INVERSE_TEST R8MAT_L1_INVERSE inverts a unit lower triangular matrix. Matrix A to be inverted: Col 1 2 3 4 5 Row 1: 1.00000 0.00000 0.00000 0.00000 0.00000 2: 2.00000 1.00000 0.00000 0.00000 0.00000 3: 0.00000 0.00000 1.00000 0.00000 0.00000 4: 5.00000 0.00000 3.00000 1.00000 0.00000 5: 0.00000 0.00000 0.00000 0.00000 1.00000 6: 75.0000 0.00000 0.00000 6.00000 4.00000 Col 6 Row 1: 0.00000 2: 0.00000 3: 0.00000 4: 0.00000 5: 0.00000 6: 1.00000 Inverse matrix B: Col 1 2 3 4 5 Row 1: 1.00000 0.00000 0.00000 0.00000 0.00000 2: -2.00000 1.00000 0.00000 0.00000 0.00000 3: -0.00000 -0.00000 1.00000 0.00000 0.00000 4: -5.00000 -0.00000 -3.00000 1.00000 0.00000 5: -0.00000 -0.00000 -0.00000 -0.00000 1.00000 6: -45.0000 -0.00000 18.0000 -6.00000 -4.00000 Col 6 Row 1: 0.00000 2: 0.00000 3: 0.00000 4: 0.00000 5: 0.00000 6: 1.00000 Product C = A * B: Col 1 2 3 4 5 Row 1: 1.00000 0.00000 0.00000 0.00000 0.00000 2: 0.00000 1.00000 0.00000 0.00000 0.00000 3: 0.00000 0.00000 1.00000 0.00000 0.00000 4: 0.00000 0.00000 0.00000 1.00000 0.00000 5: 0.00000 0.00000 0.00000 0.00000 1.00000 6: 0.00000 0.00000 0.00000 0.00000 0.00000 Col 6 Row 1: 0.00000 2: 0.00000 3: 0.00000 4: 0.00000 5: 0.00000 6: 1.00000 R8MAT_LT_SOLVE_TEST R8MAT_LT_SOLVE solves a transposed lower triangular system. Input matrix A: Col 1 2 3 4 Row 1: 1.00000 0.00000 0.00000 0.00000 2: 2.00000 3.00000 0.00000 0.00000 3: 4.00000 5.00000 6.00000 0.00000 4: 7.00000 8.00000 9.00000 10.0000 Right hand side b: 1: 45.000000 2: 53.000000 3: 54.000000 4: 40.000000 Computed solution x: 1: 1.0000000 2: 2.0000000 3: 3.0000000 4: 4.0000000 Norm of A'*x-b = 0.00000 R8MAT_LU_TEST R8MAT_LU computes the LU factors of a matrix. Matrix to be factored: Col 1 2 3 4 5 Row 1: 1.00000 1.00000 1.00000 1.00000 1.00000 2: 1.00000 10.0000 100.000 1000.00 10000.0 3: 1.00000 4.00000 16.0000 64.0000 256.000 4: 1.00000 2.00000 4.00000 8.00000 16.0000 5: 1.00000 3.00000 9.00000 27.0000 81.0000 P factor: Col 1 2 3 4 5 Row 1: 1.00000 0.00000 0.00000 0.00000 0.00000 2: 0.00000 1.00000 0.00000 0.00000 0.00000 3: 0.00000 0.00000 1.00000 0.00000 0.00000 4: 0.00000 0.00000 0.00000 1.00000 0.00000 5: 0.00000 0.00000 0.00000 0.00000 1.00000 L factor: Col 1 2 3 4 5 Row 1: 1.00000 0.00000 0.00000 0.00000 0.00000 2: 1.00000 1.00000 0.00000 0.00000 0.00000 3: 1.00000 0.333333 1.00000 0.00000 0.00000 4: 1.00000 0.111111 0.444444 1.00000 0.00000 5: 1.00000 0.222222 0.777778 0.875000 1.00000 U factor: Col 1 2 3 4 5 Row 1: 1.00000 1.00000 1.00000 1.00000 1.00000 2: 0.00000 9.00000 99.0000 999.000 9999.00 3: 0.00000 0.00000 -18.0000 -270.000 -3078.00 4: 0.00000 0.00000 0.00000 16.0000 272.000 5: 0.00000 0.00000 0.00000 0.00000 14.0000 P'*L*U: Col 1 2 3 4 5 Row 1: 1.00000 1.00000 1.00000 1.00000 1.00000 2: 1.00000 10.0000 100.000 1000.00 10000.0 3: 1.00000 4.00000 16.0000 64.0000 256.000 4: 1.00000 2.00000 4.00000 8.00000 16.0000 5: 1.00000 3.00000 9.00000 27.0000 81.0000 R8MAT_MAX_TEST For an R8MAT, R8MAT_MAX computes the maximum value; Random array: Col 1 2 3 Row 1: 4.33306 8.64743 9.14824 2: 3.39797 8.91080 2.85878 3: 1.01435 5.73302 9.56820 4: 1.11766 2.20754 3.56898 5: 3.99962 0.299668 3.39319 Maximum value = 9.56820 R8MAT_MAX_INDEX_TEST For an R8MAT: R8MAT_MAX_INDEX locates the maximum entry; Random array: Col 1 2 3 Row 1: 8.01905 0.107022 3.22635 2: 3.36775 5.92965 4.64949 3: 4.70790 4.56556 0.717169 4: 7.33914 9.27147 3.69253 5: 0.185689 0.668670 0.551540 Maximum I,J indices 4 2 R8MAT_MAXCOL_MINROW_TEST R8MAT_MAXCOL_MINROW computes the maximum over columns of the mininum over rows; Random array: Col 1 2 3 Row 1: 9.54394 5.00536 0.777721 2: 8.60065 2.32954 9.07582 3: 4.97963 3.04151 8.50670 4: 1.53034 3.33699 4.38814 5: 3.19420 0.748269E-01 3.67328 MAXCOL_MINROW = 3.04151 R8MAT_MAXROW_MINCOL_TEST R8MAT_MAXROW_MINCOL computes the maximum over rows of the mininum over columns; Random array: Col 1 2 3 Row 1: 5.68731 1.88667 4.98475 2: 0.966998 1.17642 7.85461 3: 1.87635 8.12037 4.23722 4: 7.45389 8.94208 1.50149 5: 7.81330 0.448197 6.70250 MAXROW_MINCOL = 1.50149 R8MAT_MIN_TEST R8MAT_MIN computes the minimum value of an R8MAT Random array: Col 1 2 3 Row 1: 1.86825 4.34551 7.97830 2: 4.47382 0.387980 1.91674 3: 5.46084 9.97220 0.191857 4: 7.60269 6.74902 7.77583 5: 7.68976 7.56017 1.31455 Minimum value = 0.191857 R8MAT_MIN_INDEX_TEST For an R8MAT: R8MAT_MIN_INDEX locates the minimum entry; Random array: Col 1 2 3 Row 1: 5.08147 4.92489 1.13339 2: 2.96907 8.44296 0.880263 3: 8.64134 8.43655 0.591604 4: 2.22514 7.86951 3.20427 5: 8.31144 6.84952 5.47868 Minimum I,J indices 3 1 R8MAT_MINCOL_MAXROW_TEST R8MAT_MINCOL_MAXROW computes the minimum over columns of the maxinum over rows; Random array: Col 1 2 3 Row 1: 7.82725 4.80755 6.79929 2: 0.645288 3.80838 2.05555 3: 8.50379 3.70320 7.16132 4: 4.36809 0.351950 2.20623 5: 0.304448 8.84885 1.74757 MINCOL_MAXROW = 3.80838 R8MAT_MINROW_MAXCOL_TEST R8MAT_MINROW_MAXCOL computes the minimum over rows of the maxinum over columns; Random array: Col 1 2 3 Row 1: 1.98662 6.00518 4.31935 2: 0.323303E-01 9.04745 0.563570 3: 6.18358 3.72411 1.31707 4: 2.38341 6.94090 6.58707 5: 1.42140 5.88196 8.56614 MINROW_MAXCOL = 6.18358 R8MAT_MM_TEST R8MAT_MM computes a matrix-matrix product C = A * B. A: Col 1 2 3 Row 1: 1.00000 0.00000 0.00000 2: 1.00000 1.00000 0.00000 3: 1.00000 2.00000 1.00000 4: 1.00000 3.00000 3.00000 B: Col 1 2 3 4 Row 1: 1.00000 1.00000 1.00000 1.00000 2: 0.00000 1.00000 2.00000 3.00000 3: 0.00000 0.00000 1.00000 3.00000 C = A*B: Col 1 2 3 4 Row 1: 1.00000 1.00000 1.00000 1.00000 2: 1.00000 2.00000 3.00000 4.00000 3: 1.00000 3.00000 6.00000 10.0000 4: 1.00000 4.00000 10.0000 19.0000 R8MAT_MV_TEST R8MAT_MV computes a matrix-vector product b = A * x; A: Col 1 2 Row 1: 1.00000 1.00000 2: 2.00000 1.00000 3: 3.00000 1.00000 4: 4.00000 1.00000 X: 1: 1.0000000 2: 2.0000000 B = A*X: 1: 3.0000000 2: 4.0000000 3: 5.0000000 4: 6.0000000 R8MAT_NINT_TEST R8MAT_NINT rounds an R8MAT. Matrix A: Col 1 2 3 4 Row 1: -4.93095 -3.89142 -0.243620E-01 2.43601 2: -0.822925 -4.43370 1.28161 1.90441 3: 1.58958 -4.05176 -1.20990 0.978878 4: 3.91092 -2.34745 4.12055 1.37069 5: 4.50801 1.33732 1.34898 -4.55301 Rounded matrix A: Col 1 2 3 4 Row 1: -5.00000 -4.00000 0.00000 2.00000 2: -1.00000 -4.00000 1.00000 2.00000 3: 2.00000 -4.00000 -1.00000 1.00000 4: 4.00000 -2.00000 4.00000 1.00000 5: 5.00000 1.00000 1.00000 -5.00000 R8MAT_NONZEROS_TEST R8MAT_NONZEROS counts nonzeros in an R8MAT. Matrix A: Col 1 2 3 4 Row 1: 0.00000 0.00000 0.00000 0.00000 2: 0.00000 1.00000 0.00000 1.00000 3: 0.00000 0.00000 0.00000 0.00000 4: 0.00000 1.00000 0.00000 1.00000 5: 0.00000 0.00000 0.00000 0.00000 Expected nonzeros = 4 Computed nonzeros = 4 R8MAT_NORM_FRO_TEST R8MAT_NORM_FRO computes a Frobenius norm of an R8MAT; A: Col 1 2 3 4 Row 1: 1.00000 2.00000 3.00000 4.00000 2: 5.00000 6.00000 7.00000 8.00000 3: 9.00000 10.0000 11.0000 12.0000 4: 13.0000 14.0000 15.0000 16.0000 5: 17.0000 18.0000 19.0000 20.0000 Expected norm = 53.5724 Computed norm = 53.5724 R8MAT_NORM_FRO_AFFINE_TEST R8MAT_NORM_FRO_AFFINE computes the Frobenius norm of the difference of two R8MAT's. Expected norm = 1.87238 Computed norm = 1.87238 R8MAT_NORM_L1_TEST R8MAT_NORM_L1 computes the L1 norm of an R8MAT; A: Col 1 2 3 4 Row 1: 2.00000 2.00000 -4.00000 -1.00000 2: -4.00000 5.00000 -2.00000 1.00000 3: 0.00000 2.00000 5.00000 -1.00000 4: -3.00000 -4.00000 3.00000 0.00000 5: 4.00000 4.00000 4.00000 4.00000 Computed norm = 18.0000 R8MAT_NULLSPACE_TEST R8MAT_NULLSPACE computes the nullspace of a matrix. Input A: Col 1 2 3 4 5 Row 1: 1.00000 3.00000 0.00000 2.00000 6.00000 2: -2.00000 -6.00000 0.00000 -2.00000 -8.00000 3: 3.00000 9.00000 0.00000 0.00000 6.00000 4: -1.00000 -3.00000 0.00000 1.00000 0.00000 Col 6 7 Row 1: 3.00000 1.00000 2: 3.00000 1.00000 3: 6.00000 2.00000 4: 9.00000 3.00000 Nullspace size is 4 Nullspace vectors: Col 1 2 3 4 Row 1: -3.00000 0.00000 -2.00000 0.00000 2: 1.00000 0.00000 0.00000 0.00000 3: 0.00000 1.00000 0.00000 0.00000 4: 0.00000 0.00000 -2.00000 0.00000 5: 0.00000 0.00000 1.00000 0.00000 6: 0.00000 0.00000 0.00000 -0.333333 7: 0.00000 0.00000 0.00000 1.00000 Product A * Nullspace vectors: Col 1 2 3 4 Row 1: 0.00000 0.00000 0.00000 0.00000 2: 0.00000 0.00000 0.00000 0.00000 3: 0.00000 0.00000 0.00000 0.00000 4: 0.00000 0.00000 0.00000 0.00000 R8MAT_NULLSPACE_SIZE_TEST R8MAT_NULLSPACE_SIZE computes the size of the nullspace of a matrix. Input A: Col 1 2 3 4 5 Row 1: 1.00000 3.00000 0.00000 2.00000 6.00000 2: -2.00000 -6.00000 0.00000 -2.00000 -8.00000 3: 3.00000 9.00000 0.00000 0.00000 6.00000 4: -1.00000 -3.00000 0.00000 1.00000 0.00000 Col 6 7 Row 1: 3.00000 1.00000 2: 3.00000 1.00000 3: 6.00000 2.00000 4: 9.00000 3.00000 Nullspace size is 4 R8MAT_ORTH_UNIFORM_TEST R8MAT_ORTH_UNIFORM computes a random orthogonal matrix. Random orthogonal matrix A Col 1 2 3 4 5 Row 1: -0.259677E-01 -0.562364 0.725822 -0.227174E-01 0.394637 2: 0.455447 -0.735235 -0.474012 -0.694839E-01 -0.149943 3: 0.666847E-01 0.725139E-01 -0.369904 0.438225 0.813281 4: 0.713258 0.349703 0.138640 -0.531329 0.259692 5: 0.527930 0.125003 0.304048 0.721322 -0.304817 A'*A should be identity: Col 1 2 3 4 5 Row 1: 1.00000 0.217004E-15 0.235669E-16 0.135538E-15 -0.507966E-16 2: 0.217004E-15 1.00000 -0.226886E-15 -0.438600E-16 -0.639195E-16 3: 0.235669E-16 -0.226886E-15 1.00000 0.278742E-16 0.154638E-15 4: 0.135538E-15 -0.438600E-16 0.278742E-16 1.00000 0.189182E-15 5: -0.507966E-16 -0.639195E-16 0.154638E-15 0.189182E-15 1.00000 R8MAT_PLOT_TEST R8MAT_PLOT prints a symbolic picture of a matrix. Typically, "-" for negative, " " for zero, and "+" for positive entries or "X" for nonzero and, " " for zero. A plot of the matrix: 1234567890123456789012345678901234567890123456789012345678901234567890 1 -+00000000000000000000000000000000000000000000000000000000000000000000 2 +-+0000000000000000000000000000000000000000000000000000000000000000000 3 0+-+000000000000000000000000000000000000000000000000000000000000000000 4 00+-+00000000000000000000000000000000000000000000000000000000000000000 5 000+-+0000000000000000000000000000000000000000000000000000000000000000 6 0000+-+000000000000000000000000000000000000000000000000000000000000000 7 00000+-+00000000000000000000000000000000000000000000000000000000000000 8 000000+-+0000000000000000000000000000000000000000000000000000000000000 9 0000000+-+000000000000000000000000000000000000000000000000000000000000 10 00000000+-+00000000000000000000000000000000000000000000000000000000000 123456789012345678901234567890 1 00000000000000000000000000000+ 2 000000000000000000000000000000 3 000000000000000000000000000000 4 000000000000000000000000000000 5 000000000000000000000000000000 6 000000000000000000000000000000 7 000000000000000000000000000000 8 000000000000000000000000000000 9 000000000000000000000000000000 10 000000000000000000000000000000 R8MAT_POWER_METHOD_TEST R8MAT_POWER_METHOD applies the power method to a matrix. Estimated eigenvalue = 3.73198 Estimated eigenvector V: 1: 0.29287667 2: -0.49998671 3: 0.57312572 4: -0.49998670 5: 0.29287668 Value of A*V: 1: 1.0857400 2: -1.8659758 3: 2.1462249 4: -1.8659758 5: 1.0857401 R8MAT_PRINT_TEST R8MAT_PRINT prints an R8MAT. The R8MAT: Col 1 2 3 4 Row 1: 11.0000 12.0000 13.0000 14.0000 2: 21.0000 22.0000 23.0000 24.0000 3: 31.0000 32.0000 33.0000 34.0000 4: 41.0000 42.0000 43.0000 44.0000 5: 51.0000 52.0000 53.0000 54.0000 6: 61.0000 62.0000 63.0000 64.0000 R8MAT_PRINT_SOME_TEST R8MAT_PRINT_SOME prints some of an R8MAT. The R8MAT, rows 2:4, cols 1:2: Col 1 2 Row 2: 21.0000 22.0000 3: 31.0000 32.0000 4: 41.0000 42.0000 R8MAT_PRODUCT_ELEMENTWISE_TEST R8MAT_PRODUCT_ELEMENTWISE computes the elementwise\ product of two I4MATs. A: Col 1 2 3 Row 1: 1.00000 2.00000 3.00000 2: 4.00000 5.00000 6.00000 B: Col 1 2 3 Row 1: 1.00000 3.00000 5.00000 2: 2.00000 4.00000 6.00000 Elementwise product = 86.0000 R8MAT_REF_TEST R8MAT_REF computes the row echelon form of a matrix. Input A: Col 1 2 3 4 5 Row 1: 1.00000 3.00000 0.00000 2.00000 6.00000 2: -2.00000 -6.00000 0.00000 -2.00000 -8.00000 3: 3.00000 9.00000 0.00000 0.00000 6.00000 4: -1.00000 -3.00000 0.00000 1.00000 0.00000 Col 6 7 Row 1: 3.00000 1.00000 2: 3.00000 1.00000 3: 6.00000 2.00000 4: 9.00000 3.00000 Pseudo-determinant = 48.0000 REF form: Col 1 2 3 4 5 Row 1: 1.00000 3.00000 0.00000 2.00000 6.00000 2: 0.00000 0.00000 0.00000 1.00000 2.00000 3: 0.00000 0.00000 0.00000 0.00000 0.00000 4: 0.00000 0.00000 0.00000 0.00000 0.00000 Col 6 7 Row 1: 3.00000 1.00000 2: 4.50000 1.50000 3: 1.00000 0.333333 4: 0.00000 0.00000 R8MAT_RREF_TEST R8MAT_RREF computes the reduced row echelon form of a matrix. Input A: Col 1 2 3 4 5 Row 1: 1.00000 3.00000 0.00000 2.00000 6.00000 2: -2.00000 -6.00000 0.00000 -2.00000 -8.00000 3: 3.00000 9.00000 0.00000 0.00000 6.00000 4: -1.00000 -3.00000 0.00000 1.00000 0.00000 Col 6 7 Row 1: 3.00000 1.00000 2: 3.00000 1.00000 3: 6.00000 2.00000 4: 9.00000 3.00000 Pseudo-determinant = 48.0000 RREF form: Col 1 2 3 4 5 Row 1: 1.00000 3.00000 0.00000 0.00000 2.00000 2: 0.00000 0.00000 0.00000 1.00000 2.00000 3: 0.00000 0.00000 0.00000 0.00000 0.00000 4: 0.00000 0.00000 0.00000 0.00000 0.00000 Col 6 7 Row 1: 0.00000 0.00000 2: 0.00000 0.00000 3: 1.00000 0.333333 4: 0.00000 0.00000 R8MAT_SCALE_01_TEST R8MAT_SCALE_01 shifts and scales an R8MAT so that every column has min 0 and max 1. Matrix X: Col 1 2 3 Row 1: 9.63825 -0.517693 12.6243 2: 1.08130 10.8922 3.29929 3: 0.600967 6.92371 9.84177 4: 2.86705 -4.87681 1.28288 5: 10.7763 14.6426 8.04760 6: 9.62036 11.1269 -3.00108 7: 13.0145 -3.23509 3.88827 8: 6.59682 5.67820 10.0089 9: 3.04305 2.64030 -1.16560 10: 0.137885 12.0409 0.901034 mean(X) = 5.73765 5.53151 4.57274 std(X) = 4.76439 6.81115 5.27998 max(X) = 13.0145 14.6426 12.6243 min(X) = 0.137885 -4.87681 -3.00108 Matrix XS: Col 1 2 3 Row 1: 0.737800 0.223323 1.00000 2: 0.732655E-01 0.807866 0.403213 3: 0.359631E-01 0.604555 0.821920 4: 0.211948 0.00000 0.274166 5: 0.826184 1.00000 0.707096 6: 0.736412 0.819887 0.00000 7: 1.00000 0.841070E-01 0.440906 8: 0.501603 0.540746 0.832619 9: 0.225616 0.385110 0.117467 10: 0.00000 0.866715 0.249728 mean(XS) = 0.434879 0.533231 0.484712 std(XS) = 0.370004 0.348944 0.337910 max(XS) = 1.00000 1.00000 1.00000 min(XS) = 0.00000 0.00000 0.00000 R8MAT_SCALE_AB_TEST R8MAT_SCALE_AB shifts and scales an R8MAT so that every column has min A and max B. Matrix X: Col 1 2 3 Row 1: 9.20593 6.56795 9.03820 2: 0.698504E-01 10.5450 4.80182 3: 9.08927 7.44722 3.92635 4: 14.4946 8.76253 -2.25246 5: 10.9868 -4.74280 3.71586 6: 7.62663 10.9186 5.07734 7: 12.9814 4.59255 -0.246396 8: -2.67676 -4.14011 1.40691 9: -1.09064 7.27958 12.2755 10: 13.2044 1.32194 6.28607 mean(X) = 7.38915 4.85524 4.40292 std(X) = 6.33833 5.63250 4.25844 max(X) = 14.4946 10.9186 12.2755 min(X) = -2.67676 -4.74280 -2.25246 New scale interval = [ -1.00000 , 1.00000 ] Matrix XS: Col 1 2 3 Row 1: 0.384010 0.444411 0.554338 2: -0.680095 0.952285 -0.288667E-01 3: 0.370422 0.556697 -0.149388 4: 1.00000 0.724665 -1.00000 5: 0.591436 -1.00000 -0.178366 6: 0.200065 1.00000 0.906295E-02 7: 0.823746 0.192148 -0.723833 8: -1.00000 -0.923036 -0.496230 9: -0.815261 0.535289 1.00000 10: 0.849722 -0.225517 0.175464 mean(XS) = 0.172405 0.225694 -0.837819E-01 std(XS) = 0.738243 0.719284 0.586241 max(XS) = 1.00000 1.00000 1.00000 min(XS) = -1.00000 -1.00000 -1.00000 R8MAT_SOLVE_TEST R8MAT_SOLVE solves linear systems. The linear system: Col 1 2 3 4 5 Row 1: 1.00000 2.00000 3.00000 14.0000 7.00000 2: 4.00000 5.00000 6.00000 32.0000 16.0000 3: 7.00000 8.00000 0.00000 23.0000 7.00000 The computed solutions Col 1 2 Row 1: 1.00000 1.00000 2: 2.00000 0.00000 3: 3.00000 2.00000 R8MAT_SOLVE_2D_TEST R8MAT_SOLVE_2D solves 2D linear systems. Solution / Computed: 0.897474 0.897474 0.746495 0.746495 Solution / Computed: 0.880412 0.880412 0.332766E-01 0.332766E-01 Solution / Computed: 0.968859 0.968859 0.842991E-01 0.842991E-01 Solution / Computed: 0.155143 0.155143 0.365039E-01 0.365039E-01 Solution / Computed: 0.776078 0.776078 0.971673 0.971673 R8MAT_SOLVE_3D_TEST R8MAT_SOLVE_3D solves 3D linear systems. Solution / Computed: 0.564528 0.564528 0.380802 0.380802 0.922317 0.922317 Solution / Computed: 0.217995 0.217995 0.376093 0.376093 0.364973 0.364973 Solution / Computed: 0.254281 0.254281 0.519688E-01 0.519688E-01 0.704552 0.704552 Solution / Computed: 0.248623E-01 0.248623E-01 0.429831 0.429831 0.694793 0.694793 Solution / Computed: 0.648823 0.648823 0.981438 0.981438 0.970803 0.970803 R8MAT_SOLVE2_TEST R8MAT_SOLVE2 is a linear solver. Right hand side: 1: 5.0000000 2: 11.000000 The system is nonsingular. Computed solution: 1: 1.0000000 2: 2.0000000 Right hand side: 1: 4.0000000 2: 2.0000000 3: 2.0000000 R8MAT_SOLVE2 - Warning: Consistent singularity, equation = 3 The system is singular, but consistent. Computed solution: 1: 2.0000000 2: 0.0000000 3: 0.0000000 Right hand side: 1: 5.0000000 2: 11.000000 3: 16.000000 4: 15.000000 The system is nonsingular. Computed solution: 1: -2.0000000 2: -6.0000000 3: 10.000000 4: 7.0000000 Right hand side: 1: 13.000000 2: 17.000000 3: 20.000000 R8MAT_SOLVE2 - Error: Inconsistent singularity, equation = 2 The system is singular and inconsistent. Computed solution: 1: 6.4285714 2: 0.0000000 3: 0.14285714 R8MAT_STANDARDIZE_TEST R8MAT_STANDARDIZE shifts and scales an R8MAT so that every column has zero mean and unit standard deviation. Matrix X: Col 1 2 3 Row 1: 13.1371 0.639581 9.56088 2: 2.32315 3.09207 7.14915 3: -1.42394 -0.634754 10.9838 4: 13.7623 4.17276 0.366561 5: 12.6656 -1.12128 7.84830 6: 0.884460 11.6064 0.136058 7: -3.05101 6.41036 4.02404 8: 11.3478 12.3678 14.9884 9: 4.95596 6.45110 11.2827 10: 8.37706 11.5238 0.658799 mean(X) = 6.29784 5.45078 6.69987 std(X) = 6.38398 5.11109 5.21332 max(X) = 13.7623 12.3678 14.9884 min(X) = -3.05101 -1.12128 0.136058 Matrix XS: Col 1 2 3 Row 1: 1.07131 -0.941325 0.548789 2: -0.622604 -0.461488 0.861793E-01 3: -1.20956 -1.19065 0.821727 4: 1.16925 -0.250047 -1.21483 5: 0.997455 -1.28584 0.220289 6: -0.847963 1.20437 -1.25904 7: -1.46442 0.187745 -0.513266 8: 0.791031 1.35333 1.58987 9: -0.210195 0.195715 0.879067 10: 0.325693 1.18820 -1.15877 mean(XS) = 0.555112E-16 -0.222045E-16 -0.199840E-15 std(XS) = 1.00000 1.00000 1.00000 max(XS) = 1.16925 1.35333 1.58987 min(XS) = -1.46442 -1.28584 -1.25904 R8MAT_SYMM_JACOBI_TEST For a symmetric R8MAT: R8MAT_SYMM_JACOBI diagonalizes; Matrix to diagonalize: Col 1 2 3 4 5 Row 1: 2.85357 -0.370764 0.101108 1.21124 -0.942630E-01 2: -0.370764 1.75070 0.477996 0.405915 0.279861 3: 0.101108 0.477996 4.32965 0.803266 0.116403 4: 1.21124 0.405915 0.803266 2.81913 -0.723906 5: -0.942630E-01 0.279861 0.116403 -0.723906 3.24695 Computed Eigenvalues: 4.00000 1.00000 5.00000 2.00000 3.00000 R8MAT_TO_R8PLU_TEST R8MAT_TO_R8PLU determines the compressed PLU factors of a R8MAT. Matrix order N = 5 The matrix A: Col 1 2 3 4 5 Row 1: 0.392117 0.488624 0.623042 0.897176 0.143860 2: 0.295351 0.587537 0.841683 0.972683 0.996728 3: 0.141501 0.683861 0.382531 0.220759 0.291644 4: 0.567830 0.777368 0.928725 0.318783 0.611684 5: 0.244089 0.640231 0.507987 0.364208 0.466771 The pivot vector P: 1: 4 2: 3 3: 3 4: 4 5: 5 The compressed LU factors: Col 1 2 3 4 5 Row 1: 0.567830 0.777368 0.928725 0.318783 0.611684 2: -0.520140 0.490144 0.151097 0.141319 0.139214 3: -0.249196 -0.373761 0.302142 0.754051 0.626534 4: -0.690555 0.983208E-01 0.113778E-01 0.699512 -0.257724 5: -0.429862 -0.624450 -0.476945E-01 -0.147194 0.124952 The recovered matrix A2: Col 1 2 3 4 5 Row 1: 0.392117 0.488624 0.623042 0.897176 0.143860 2: 0.295351 0.587537 0.841683 0.972683 0.996728 3: 0.141501 0.683861 0.382531 0.220759 0.291644 4: 0.567830 0.777368 0.928725 0.318783 0.611684 5: 0.244089 0.640231 0.507987 0.364208 0.466771 R8MAT_TRACE_TEST R8MAT_TRACE computes the trace of a matrix Matrix: Col 1 2 3 4 Row 1: 4.00000 3.00000 2.00000 1.00000 2: 3.00000 3.00000 2.00000 1.00000 3: 0.00000 2.00000 2.00000 1.00000 4: 0.00000 0.00000 1.00000 1.00000 Trace is 10.0000 R8MAT_TRANSPOSE_TEST R8MAT_TRANSPOSE transposes an R8MAT. Matrix A: Col 1 2 3 4 Row 1: 11.0000 12.0000 13.0000 14.0000 2: 21.0000 22.0000 23.0000 24.0000 3: 31.0000 32.0000 33.0000 34.0000 4: 41.0000 42.0000 43.0000 44.0000 5: 51.0000 52.0000 53.0000 54.0000 Transposed matrix At: Col 1 2 3 4 5 Row 1: 11.0000 21.0000 31.0000 41.0000 51.0000 2: 12.0000 22.0000 32.0000 42.0000 52.0000 3: 13.0000 23.0000 33.0000 43.0000 53.0000 4: 14.0000 24.0000 34.0000 44.0000 54.0000 R8MAT_TRANSPOSE_IN_PLACE_TEST R8MAT_TRANSPOSE_IN_PLACE transposes an R8MAT. Matrix A: Col 1 2 3 4 5 Row 1: 11.0000 12.0000 13.0000 14.0000 15.0000 2: 21.0000 22.0000 23.0000 24.0000 25.0000 3: 31.0000 32.0000 33.0000 34.0000 35.0000 4: 41.0000 42.0000 43.0000 44.0000 45.0000 5: 51.0000 52.0000 53.0000 54.0000 55.0000 Transposed matrix At: Col 1 2 3 4 5 Row 1: 11.0000 21.0000 31.0000 41.0000 51.0000 2: 12.0000 22.0000 32.0000 42.0000 52.0000 3: 13.0000 23.0000 33.0000 43.0000 53.0000 4: 14.0000 24.0000 34.0000 44.0000 54.0000 5: 15.0000 25.0000 35.0000 45.0000 55.0000 R8MAT_TRANSPOSE_NEW_TEST R8MAT_TRANSPOSE_NEW transposes an R8MAT. Matrix A: Col 1 2 3 4 Row 1: 11.0000 12.0000 13.0000 14.0000 2: 21.0000 22.0000 23.0000 24.0000 3: 31.0000 32.0000 33.0000 34.0000 4: 41.0000 42.0000 43.0000 44.0000 5: 51.0000 52.0000 53.0000 54.0000 Transposed matrix At: Col 1 2 3 4 5 Row 1: 11.0000 21.0000 31.0000 41.0000 51.0000 2: 12.0000 22.0000 32.0000 42.0000 52.0000 3: 13.0000 23.0000 33.0000 43.0000 53.0000 4: 14.0000 24.0000 34.0000 44.0000 54.0000 R8MAT_TRANSPOSE_PRINT_TEST R8MAT_TRANSPOSE_PRINT prints an R8MAT, transposed. Matrix row order M = 5 Matrix column order N = 4 The matrix A: Col 1 2 3 4 Row 1: 11.0000 12.0000 13.0000 14.0000 2: 21.0000 22.0000 23.0000 24.0000 3: 31.0000 32.0000 33.0000 34.0000 4: 41.0000 42.0000 43.0000 44.0000 5: 51.0000 52.0000 53.0000 54.0000 The transposed matrix A: Row 1 2 3 4 5 Col 1: 11.0000 21.0000 31.0000 41.0000 51.0000 2: 12.0000 22.0000 32.0000 42.0000 52.0000 3: 13.0000 23.0000 33.0000 43.0000 53.0000 4: 14.0000 24.0000 34.0000 44.0000 54.0000 R8MAT_TRANSPOSE_PRINT_SOME_TEST R8MAT_TRANSPOSE_PRINT_SOME prints some of an R8MAT, transposed. Matrix row order M = 5 Matrix column order N = 4 The matrix A: Col 1 2 3 4 Row 1: 11.0000 12.0000 13.0000 14.0000 2: 21.0000 22.0000 23.0000 24.0000 3: 31.0000 32.0000 33.0000 34.0000 4: 41.0000 42.0000 43.0000 44.0000 5: 51.0000 52.0000 53.0000 54.0000 The transposed matrix A, rows 1:3, cols 2:3: Row 1 2 3 Col 2: 12.0000 22.0000 32.0000 3: 13.0000 23.0000 33.0000 R8MAT_U_INVERSE_TEST R8MAT_U_INVERSE inverts an upper triangular matrix. Input matrix A Col 1 2 3 4 Row 1: 1.00000 2.00000 4.00000 7.00000 2: 0.00000 3.00000 5.00000 8.00000 3: 0.00000 0.00000 6.00000 9.00000 4: 0.00000 0.00000 0.00000 10.0000 Inverse matrix B: Col 1 2 3 4 Row 1: 1.00000 -0.666667 -0.111111 -0.666667E-01 2: 0.00000 0.333333 -0.277778 -0.166667E-01 3: 0.00000 0.00000 0.166667 -0.150000 4: 0.00000 0.00000 0.00000 0.100000 Product C = A * B: Col 1 2 3 4 Row 1: 1.00000 0.00000 0.00000 -0.277556E-16 2: 0.00000 1.00000 0.00000 0.00000 3: 0.00000 0.00000 1.00000 0.111022E-15 4: 0.00000 0.00000 0.00000 1.00000 R8MAT_U_SOLVE_TEST R8MAT_U_SOLVE solves an upper triangular system. Input matrix A: Col 1 2 3 4 Row 1: 1.00000 2.00000 4.00000 7.00000 2: 0.00000 3.00000 5.00000 8.00000 3: 0.00000 0.00000 6.00000 9.00000 4: 0.00000 0.00000 0.00000 10.0000 Right hand side b: 1: 45.000000 2: 53.000000 3: 54.000000 4: 40.000000 Computed solution x: 1: 1.0000000 2: 2.0000000 3: 3.0000000 4: 4.0000000 Norm of A*x-b = 0.00000 R8MAT_U1_INVERSE_TEST R8MAT_U1_INVERSE inverts a unit upper triangular matrix. Input matrix A Col 1 2 3 4 5 Row 1: 1.00000 2.00000 0.00000 5.00000 0.00000 2: 0.00000 1.00000 0.00000 0.00000 0.00000 3: 0.00000 0.00000 1.00000 3.00000 0.00000 4: 0.00000 0.00000 0.00000 1.00000 0.00000 5: 0.00000 0.00000 0.00000 0.00000 1.00000 6: 0.00000 0.00000 0.00000 0.00000 0.00000 Col 6 Row 1: 75.0000 2: 0.00000 3: 0.00000 4: 6.00000 5: 4.00000 6: 1.00000 Inverse matrix B: Col 1 2 3 4 5 Row 1: 1.00000 -2.00000 -0.00000 -5.00000 -0.00000 2: 0.00000 1.00000 -0.00000 -0.00000 -0.00000 3: 0.00000 0.00000 1.00000 -3.00000 -0.00000 4: 0.00000 0.00000 0.00000 1.00000 -0.00000 5: 0.00000 0.00000 0.00000 0.00000 1.00000 6: 0.00000 0.00000 0.00000 0.00000 0.00000 Col 6 Row 1: -45.0000 2: -0.00000 3: 18.0000 4: -6.00000 5: -4.00000 6: 1.00000 Product C = A * B: Col 1 2 3 4 5 Row 1: 1.00000 0.00000 0.00000 0.00000 0.00000 2: 0.00000 1.00000 0.00000 0.00000 0.00000 3: 0.00000 0.00000 1.00000 0.00000 0.00000 4: 0.00000 0.00000 0.00000 1.00000 0.00000 5: 0.00000 0.00000 0.00000 0.00000 1.00000 6: 0.00000 0.00000 0.00000 0.00000 0.00000 Col 6 Row 1: 0.00000 2: 0.00000 3: 0.00000 4: 0.00000 5: 0.00000 6: 1.00000 R8MAT_UNIFORM_AB_TEST R8MAT_UNIFORM_AB sets an R8MAT to random values in [A,B]. The random matrix: Col 1 2 3 4 Row 1: 5.41912 6.30676 3.24980 3.89859 2: 7.06708 3.90898 7.95875 8.80231 3: 7.25284 3.53599 9.85002 4.92612 4: 5.92831 4.30853 3.13491 9.57885 5: 5.33431 2.81428 7.21861 4.41329 R8MAT_UT_SOLVE_TEST R8MAT_UT_SOLVE solves a transposed upper triangular system. Input matrix A: Col 1 2 3 4 Row 1: 1.00000 2.00000 4.00000 7.00000 2: 0.00000 3.00000 5.00000 8.00000 3: 0.00000 0.00000 6.00000 9.00000 4: 0.00000 0.00000 0.00000 10.0000 Right hand side b: 1: 1.0000000 2: 8.0000000 3: 32.000000 4: 90.000000 Computed solution x: 1: 1.0000000 2: 2.0000000 3: 3.0000000 4: 4.0000000 Norm of A'*x-b = 0.00000 R8PLU_DET_TEST R8PLU_DET determines the determinant of a matrix from its compressed PLU factors. Matrix order N = 5 The matrix A: Col 1 2 3 4 5 Row 1: 0.441013 0.623405 0.101667 0.604466 0.137790 2: 0.585737 0.634821 0.313562 0.589421 0.656026 3: 0.887673 0.144527E-01 0.400457 0.985992 0.543912 4: 0.414304 0.863174E-01 0.932064 0.564891 0.444842 5: 0.299069 0.243175 0.913300 0.225959 0.329579 The determinant = -0.422198E-01 R8PLU_INVERSE_TEST R8PLU_INVERSE determines the inverse of a matrix from its compressed PLU factors. Matrix order N = 5 The matrix A: Col 1 2 3 4 5 Row 1: 0.884542 0.580961 0.533238 0.563443 0.166460 2: 0.696270 0.293172 0.407144 0.149245 0.732740 3: 0.436728 0.215645 0.328419E-01 0.799346 0.530301 4: 0.696045 0.824546 0.294829 0.760984 0.729155 5: 0.740816 0.613826 0.895168 0.298468 0.353950 The inverse matrix B: Col 1 2 3 4 5 Row 1: 2.32541 1.43212 -0.620616 -0.644096 -1.80167 2: 0.175506E-01 -0.680670 -1.83342 2.18488 -0.353209 3: -1.27515 -0.683724 1.02127 -0.962148 2.46709 4: -0.257040 -1.16321 1.78215 -0.437934 0.761024 5: -1.45580 0.893071 0.392831 0.361671 0.327478 The product matrix C = A * B: Col 1 2 3 4 5 Row 1: 1.00000 0.417847E-17 0.734358E-16 -0.106322E-15 -0.286005E-15 2: 0.429526E-15 1.00000 -0.511815E-16 -0.121813E-15 -0.251456E-16 3: 0.376155E-15 0.143158E-16 1.00000 -0.145496E-15 -0.100505E-15 4: 0.437119E-15 0.656904E-16 -0.220220E-16 1.00000 -0.118537E-15 5: 0.524420E-15 0.332781E-16 -0.322739E-16 -0.220118E-15 1.00000 R8PLU_MUL_TEST R8PLU_MUL computes the product A*x=b using the compressed PLU factors of A. Matrix order N = 5 The matrix A: Col 1 2 3 4 5 Row 1: 0.528242 0.503922 0.146228 0.194566 0.959430 2: 0.771601 0.379979 0.883837E-01 0.886828 0.816676E-01 3: 0.920518 0.362190 0.157246 0.374391 0.709607 4: 0.417961 0.229427 0.884898E-01 0.326921 0.458324 5: 0.282979E-01 0.585806 0.396829 0.777097 0.843460 The right hand side B (computed from A): 1: 7.5501842 2: 5.7523588 3: 7.1622349 4: 4.7415868 5: 9.7160871 The right hand side B (computed from PLU): 1: 7.5501842 2: 5.7523588 3: 7.1622349 4: 4.7415868 5: 9.7160871 R8PLU_SOLVE_TEST R8PLU_SOLVE solves a linear system A*x=b using the compressed PLU factors of A. Matrix order N = 5 The matrix A: Col 1 2 3 4 5 Row 1: 0.294535 0.178286 0.578999 0.950478 0.415657 2: 0.379863 0.375892 0.442827 0.240894 0.469025 3: 0.671511 0.445390 0.710519 0.506644 0.980027 4: 0.608458 0.807083 0.970573 0.929039 0.647633 5: 0.306922 0.302209 0.369886 0.578218 0.489619 The right hand side B: 1: 8.2683004 2: 5.7688275 3: 10.620558 4: 12.088663 5: 6.7819677 The computed solution X: 1: 1.0000000 2: 2.0000000 3: 3.0000000 4: 4.0000000 5: 5.0000000 R8PLU_TO_R8MAT_TEST R8PLU_TO_R8MAT determines the original matrix from the compressed PLU factors. Matrix order N = 5 The matrix A: Col 1 2 3 4 5 Row 1: 0.492884 0.569993 0.663230 0.608721 0.434348 2: 0.608689E-01 0.907082 0.349585 0.260832 0.943555 3: 0.646719 0.530561 0.784182 0.298696E-01 0.789549 4: 0.544017 0.842476 0.756674 0.496584 0.966003 5: 0.600032 0.184951 0.107075 0.846099 0.912169 The pivot vector P: 1: 3 2: 2 3: 5 4: 5 5: 5 The compressed LU factors: Col 1 2 3 4 5 Row 1: 0.646719 0.530561 0.784182 0.298696E-01 0.789549 2: -0.941196E-01 0.857146 0.275778 0.258021 0.869242 3: -0.762131 -0.193241 -0.521623 0.910893 0.491263 4: -0.841195 -0.462198 -0.583555E-01 0.557557 -0.323792 5: -0.927810 0.358526 0.235600E-01 -0.536351 0.450735E-01 The recovered matrix A2: Col 1 2 3 4 5 Row 1: 0.492884 0.569993 0.663230 0.608721 0.434348 2: 0.608689E-01 0.907082 0.349585 0.260832 0.943555 3: 0.646719 0.530561 0.784182 0.298696E-01 0.789549 4: 0.544017 0.842476 0.756674 0.496584 0.966003 5: 0.600032 0.184951 0.107075 0.846099 0.912169 R8ROWS_TO_R8MAT_TEST R8ROWS_TO_R8MAT allows an R8MAT to be initialized by data stored ROW-WISE in a vector. The data vector: 1: 11.000000 2: 12.000000 3: 13.000000 4: 14.000000 5: 21.000000 6: 22.000000 7: 23.000000 8: 24.000000 9: 31.000000 10: 32.000000 11: 33.000000 12: 34.000000 The data copied into an array: Col 1 2 3 4 Row 1: 11.0000 12.0000 13.0000 14.0000 2: 21.0000 22.0000 23.0000 24.0000 3: 31.0000 32.0000 33.0000 34.0000 R8SLMAT_PRINT_TEST R8SLMAT_PRINT prints a strictly lower triangular matrix stored compactly. Only the (possibly) nonzero elements are printed. R8SLMAT Col 1 2 3 4 5 6 Row 2 21 3 31 32 4 41 42 43 5 51 52 53 54 6 61 62 63 64 65 7 71 72 73 74 75 76 R8SLMAT Col 1 2 3 Row 2 21 3 31 32 4 41 42 43 5 51 52 53 6 61 62 63 7 71 72 73 R8SLMAT Col 1 2 3 Row 2 21 3 31 32 4 41 42 43 R8VEC_AMAX_TEST For a R8VEC: R8VEC_AMAX: maximum magnitude entry; Input vector: 1: -1.2694706 2: 1.3959834 3: -2.4980119 4: 1.3541122 5: 2.6719543 6: 3.4471355 7: 0.32216501 8: -4.6042341 9: 2.6875687 10: -0.87223325 Maximum absolute: 4.60423 R8VEC_AMIN_TEST For a R8VEC: R8VEC_AMIN: minimum magnitude entry. Input vector: 1: -2.9904127 2: -4.6151450 3: 4.9383396 4: 1.8781003 5: 1.0581946 6: 9.8834200 7: 8.6740004 8: -3.8396085 9: -4.8679954 10: 0.88181060E-01 Minimum absolute: 0.881811E-01 R8VEC_BINARY_NEXT_TEST R8VEC_BINARY_NEXT generates the next binary vector. 0.00000 0.00000 0.00000 0.00000 0.00000 1.00000 0.00000 1.00000 0.00000 0.00000 1.00000 1.00000 1.00000 0.00000 0.00000 1.00000 0.00000 1.00000 1.00000 1.00000 0.00000 1.00000 1.00000 1.00000 R8VEC_BRACKET_TEST R8VEC_BRACKET finds a pair of entries in a sorted R8VEC which bracket a value. Sorted array: 1: 1.0000000 2: 2.0000000 3: 3.0000000 4: 4.0000000 5: 5.0000000 6: 5.0000000 7: 7.0000000 8: 8.0000000 9: 9.0000000 10: 10.000000 LEFT RIGHT X(LEFT) XVAL X(RIGHT) 1 2 1.00000 -10.0000 2.00000 1 2 1.00000 1.00000 2.00000 4 5 4.00000 4.50000 5.00000 6 7 5.00000 5.00000 7.00000 9 10 9.00000 10.0000 10.0000 9 10 9.00000 12.0000 10.0000 R8VEC_BRACKET2_TEST R8VEC_BRACKET2 finds a pair of entries in a sorted R8VEC which bracket a value. Sorted array: 1: 1.0000000 2: 2.0000000 3: 3.0000000 4: 4.0000000 5: 5.0000000 6: 5.0000000 7: 7.0000000 8: 8.0000000 9: 9.0000000 10: 10.000000 Search for XVAL = -10.0000 Start = 5 Left = 1 Right = 2 X(LEFT)= 1.00000 X(RIGHT) = 2.00000 Search for XVAL = 1.00000 Start = 1 Left = 1 Right = 1 X(LEFT)= 1.00000 X(RIGHT) = 1.00000 Search for XVAL = 4.50000 Start = 1 Left = 4 Right = 5 X(LEFT)= 4.00000 X(RIGHT) = 5.00000 Search for XVAL = 5.00000 Start = 4 Left = 5 Right = 5 X(LEFT)= 5.00000 X(RIGHT) = 5.00000 Search for XVAL = 10.0000 Start = 5 Left = 9 Right = 10 X(LEFT)= 9.00000 X(RIGHT) = 10.0000 Search for XVAL = 12.0000 Start = 9 Left = 10 Right = -1 X(LEFT)= 10.0000 R8VEC_BRACKET3_TEST R8VEC_BRACKET3 finds a pair of entries in a sorted R8VEC which bracket a value. Sorted array: 1: 1.0000000 2: 2.0000000 3: 3.0000000 4: 4.0000000 5: 5.0000000 6: 5.0000000 7: 7.0000000 8: 8.0000000 9: 9.0000000 10: 10.000000 Search for XVAL = -10.0000 Starting guess for interval is = 5 Nearest interval: X[ 1 ]= 1.00000 X[ 2 ]= 2.00000 Search for XVAL = 1.00000 Starting guess for interval is = 1 Nearest interval: X[ 1 ]= 1.00000 X[ 2 ]= 2.00000 Search for XVAL = 4.50000 Starting guess for interval is = 1 Nearest interval: X[ 4 ]= 4.00000 X[ 5 ]= 5.00000 Search for XVAL = 5.00000 Starting guess for interval is = 4 Nearest interval: X[ 4 ]= 4.00000 X[ 5 ]= 5.00000 Search for XVAL = 10.0000 Starting guess for interval is = 4 Nearest interval: X[ 9 ]= 9.00000 X[ 10 ]= 10.0000 Search for XVAL = 12.0000 Starting guess for interval is = 9 Nearest interval: X[ 9 ]= 9.00000 X[ 10 ]= 10.0000 R8VEC_BRACKET5_TEST R8VEC_BRACKET5 finds a pair of entries in a sorted R8VEC which bracket a value. Sorted array: 1: 1.0000000 2: 2.0000000 3: 3.0000000 4: 4.0000000 5: 5.0000000 6: 5.0000000 7: 7.0000000 8: 8.0000000 9: 9.0000000 10: 10.000000 LEFT RIGHT X(LEFT) XVAL X(RIGHT) -1 -10.0000 (Not bracketed!) 1 2 1.0000 1.0000 2.0000 4 5 4.0000 4.5000 5.0000 6 7 5.0000 5.0000 7.0000 9 10 9.0000 10.0000 10.0000 -1 12.0000 (Not bracketed!) R8VEC_CHEBY_EXTREME_TEST R8VEC_CHEBY_EXTREME computes N Chebyshev Extreme points in [R1,R2]. N = 5 R1 = -1.00000 R2 = 1.00000 Chebyshev points: 1: -1.0000000 2: -0.70710678 3: 0.0000000 4: 0.70710678 5: 1.0000000 N = 7 R1 = 0.00000 R2 = 10.0000 Chebyshev points: 1: 0.0000000 2: 0.66987298 3: 2.5000000 4: 5.0000000 5: 7.5000000 6: 9.3301270 7: 10.000000 R8VEC_CHEBY_ZERO_TEST R8VEC_CHEBY1SPACE computes Chebyshev Zero points in [R1,R2]. N = 5 R1 = -1.00000 R2 = 1.00000 Chebyshev points: 1: -0.95105652 2: -0.58778525 3: 0.0000000 4: 0.58778525 5: 0.95105652 N = 7 R1 = 0.00000 R2 = 10.0000 Chebyshev points: 1: 0.12536044 2: 1.0908426 3: 2.8305813 4: 5.0000000 5: 7.1694187 6: 8.9091574 7: 9.8746396 R8VEC_CONCATENATE_TEST R8VEC_CONCATENATE concatenates two R8VECs Array 1: 1: 91.099998 2: 31.200001 3: 71.300003 4: 51.400002 5: 31.500000 Array 2: 1: 42.599998 2: 22.700001 3: 12.800000 Array 3 = Array 1 + Array 2: 1: 91.099998 2: 31.200001 3: 71.300003 4: 51.400002 5: 31.500000 6: 42.599998 7: 22.700001 8: 12.800000 r8vec_correlation_test: r8vec_correlation computes the correlation of two R8VEC's. Vector V1: 1: 43.000000 2: 21.000000 3: 25.000000 4: 42.000000 5: 57.000000 6: 59.000000 Vector V2: 1: 99.000000 2: 65.000000 3: 79.000000 4: 75.000000 5: 87.000000 6: 81.000000 V1 V2 Correlation coefficient r = 0.529809 R8VEC_CONVOLUTION_TEST R8VEC_CONVOLUTION computes the convolution of two vectors. The factor X: 1: 1.0000000 2: 2.0000000 3: 3.0000000 4: 4.0000000 The factor Y: 1: -1.0000000 2: 5.0000000 3: 3.0000000 The convolution z = x star y: 1: -1.0000000 2: 3.0000000 3: 10.000000 4: 17.000000 5: 29.000000 6: 12.000000 Correct answer: 1: -1.0000000 2: 3.0000000 3: 10.000000 4: 17.000000 5: 29.000000 6: 12.000000 R8VEC_CONVOLUTION_CIRC_TEST R8VEC_CONVOLUTION_CIRC computes the circular convolution of two R8VECs. The factor X: 1: 1.0000000 2: 2.0000000 3: 3.0000000 4: 4.0000000 The factor Y: 1: 1.0000000 2: 2.0000000 3: 4.0000000 4: 8.0000000 The circular convolution z = x CC y: 1: 37.000000 2: 44.000000 3: 43.000000 4: 26.000000 Correct answer: 1: 37.000000 2: 44.000000 3: 43.000000 4: 26.000000 R8VEC_DIF_TEST R8VEC_DIF estimates derivatives. Estimate the derivative of order N = 4 Using H = 0.100000E-01 at argument X = 1.00000 The difference coefficients: 1: 6250000.0 2: -25000000. 3: 37500000. 4: -25000000. 5: 6250000.0 Estimate is FDIF = 2.71846 R8VEC_DIFF_NORM_LI_TEST R8VEC_DIFF_NORM_LI computes the L-infinity norm of the difference of two R8VEC's Vector V1: 1: 4.3697922 2: 0.60670693 3: 3.1475902 4: 7.5529133 5: 6.9193385 Vector V2: 1: -0.94471570 2: -1.8946479 3: 9.0226066 4: 1.6528188 5: 2.6183656 L-Infinity norm of V1-V2 = 5.90009 R8VEC_DIRECT_PRODUCT_TEST R8VEC_DIRECT_PRODUCT forms the entries of a direct product of a given number of R8VEC factors. J X(1) X(2) X(3) 1 1.0 50.0 800.0 2 2.0 50.0 800.0 3 3.0 50.0 800.0 4 4.0 50.0 800.0 5 1.0 60.0 800.0 6 2.0 60.0 800.0 7 3.0 60.0 800.0 8 4.0 60.0 800.0 9 1.0 70.0 800.0 10 2.0 70.0 800.0 11 3.0 70.0 800.0 12 4.0 70.0 800.0 13 1.0 50.0 900.0 14 2.0 50.0 900.0 15 3.0 50.0 900.0 16 4.0 50.0 900.0 17 1.0 60.0 900.0 18 2.0 60.0 900.0 19 3.0 60.0 900.0 20 4.0 60.0 900.0 21 1.0 70.0 900.0 22 2.0 70.0 900.0 23 3.0 70.0 900.0 24 4.0 70.0 900.0 R8VEC)_DIRECT_PRODUCT2_TEST R8VEC_DIRECT_PRODUCT2 forms the entries of a direct product of a given number of R8VEC factors. J W(J) 1 418.0 2 627.0 3 1045.0 4 1463.0 5 494.0 6 741.0 7 1235.0 8 1729.0 9 646.0 10 969.0 11 1615.0 12 2261.0 13 462.0 14 693.0 15 1155.0 16 1617.0 17 546.0 18 819.0 19 1365.0 20 1911.0 21 714.0 22 1071.0 23 1785.0 24 2499.0 R8VEC_DOT_PRODUCT_TEST: R8VEC_DOT_PRODUCT computes the dot product of two R8VEC's. V1 and V2: 1 0.387786 0.706710 2 0.516678 0.797046 3 0.811147 0.460375 4 0.415894 0.677162 5 0.744348 0.825810 6 0.344169 0.367979 7 0.840873 0.667641 8 0.197535 0.677990 9 0.764836 0.579607 10 0.693368 0.216852 V1 dot V2 = 3.37126 R8VEC_EVEN_TEST R8VEC_EVEN computes an R8VEC containing N evenly spaced values between XLO and XHI. XLO = 0.00000 XHI = 99.0000 while N = 10 Resulting array: 1: 0.0000000 2: 11.000000 3: 22.000000 4: 33.000000 5: 44.000000 6: 55.000000 7: 66.000000 8: 77.000000 9: 88.000000 10: 99.000000 R8VEC_EVEN2_TEST R8VEC_EVEN2 interpolates a specified number of points pairs of values in a vector. Input data: 0.00000 ( 4) 1.00000 ( 3) 5.00000 ( 5) 2.00000 ( 0) 0.00000 Resulting vector: * 0.00000 0.200000 0.400000 0.600000 0.800000 * 1.00000 2.00000 3.00000 4.00000 * 5.00000 4.50000 4.00000 3.50000 3.00000 2.50000 * 2.00000 * 0.00000 R8VEC_EVEN3_TEST R8VEC_EVEN3 tries to evenly interpolate new data between old values. Original vector: 1: 0.0000000 2: 5.1000000 3: 7.0000000 4: 10.000000 New vector: 1: 0.0000000 2: 1.0200000 3: 2.0400000 4: 3.0600000 5: 4.0800000 6: 5.1000000 7: 5.7333333 8: 6.3666667 9: 7.0000000 10: 8.0000000 11: 9.0000000 12: 10.000000 R8VEC_EXPAND_LINEAR_TEST R8VEC_EXPAND_LINEAR linearly interpolates new data between old values. Original vector: 1: 16.000000 2: 4.0000000 3: 0.0000000 4: 4.0000000 5: 16.000000 6: 36.000000 Expansion factor is 3 Fattened vector: 1: 16.000000 2: 13.000000 3: 10.000000 4: 7.0000000 5: 4.0000000 6: 3.0000000 7: 2.0000000 8: 1.0000000 9: 0.0000000 10: 1.0000000 11: 2.0000000 12: 3.0000000 13: 4.0000000 14: 7.0000000 15: 10.000000 16: 13.000000 17: 16.000000 18: 21.000000 19: 26.000000 20: 31.000000 21: 36.000000 R8VEC_FRAC_TEST R8VEC_FRAC: K-th smallest R8VEC entry; Array to search: 1: 0.74265166 2: 0.74898456 3: 0.53856043 4: 0.92417789 5: 0.75196885 6: 0.92116301 7: 0.93406572 8: 0.38867163 9: 0.28071882 10: 0.51086727 Fractile Value 1 0.280719 6 0.748985 R8VEC_HEAP_D_EXTRACT_TEST For a heap descending sorted R8VEC, R8VEC_HEAP_D_EXTRACT extracts the maximum value; Inserting value 9.7322 Current maximum value is 9.7322 Inserting value 2.7557 Current maximum value is 9.7322 Inserting value 5.4574 Current maximum value is 9.7322 Inserting value 6.3419 Current maximum value is 9.7322 Inserting value 9.7759 Current maximum value is 9.7759 Inserting value 4.2463 Current maximum value is 9.7759 Inserting value 1.7818 Current maximum value is 9.7759 Inserting value 2.4827 Current maximum value is 9.7759 Inserting value 2.6833 Current maximum value is 9.7759 Inserting value 6.6423 Current maximum value is 9.7759 Current heap as a vector: 1: 9.7758798 2: 9.7321575 3: 5.4574237 4: 2.7557122 5: 6.6422779 6: 4.2462886 7: 1.7818117 8: 2.4827164 9: 2.6832988 10: 6.3418944 Now extract the maximum several times. Extracting maximum element = 9.7759 Extracting maximum element = 9.7322 Extracting maximum element = 6.6423 Extracting maximum element = 6.3419 Extracting maximum element = 5.4574 Current heap as a vector: 1: 4.2462886 2: 2.7557122 3: 2.6832988 4: 2.4827164 5: 1.7818117 R8VEC_HEAP_D_INSERT_TEST For a heap descending sorted R8VEC, R8VEC_HEAP_D_INSERT inserts a value into the heap. Inserting value 0.7546 Current maximum value is 0.7546 Inserting value 0.5381 Current maximum value is 0.7546 Inserting value 1.0304 Current maximum value is 1.0304 Inserting value 0.3279 Current maximum value is 1.0304 Inserting value 1.9570 Current maximum value is 1.9570 Inserting value 7.4179 Current maximum value is 7.4179 Inserting value 4.7430 Current maximum value is 7.4179 Inserting value 4.5353 Current maximum value is 7.4179 Inserting value 0.1058 Current maximum value is 7.4179 Inserting value 8.1433 Current maximum value is 8.1433 Current heap as a vector: 1: 8.1433338 2: 7.4179135 3: 4.7430396 4: 1.0304328 5: 4.5353274 6: 0.75461664 7: 1.9570111 8: 0.32789231 9: 0.10583965 10: 0.53807074 R8VEC_HEAP_D_MAX_TEST For a heap descending sorted R8VEC, R8VEC_HEAP_D_MAX reports the maximum value. Inserting value 7.0585 Current maximum value is 7.0585 Inserting value 9.6546 Current maximum value is 9.6546 Inserting value 0.1039 Current maximum value is 9.6546 Inserting value 5.7023 Current maximum value is 9.6546 Inserting value 6.7550 Current maximum value is 9.6546 Inserting value 8.0526 Current maximum value is 9.6546 Inserting value 8.5496 Current maximum value is 9.6546 Inserting value 7.4026 Current maximum value is 9.6546 Inserting value 0.2949 Current maximum value is 9.6546 Inserting value 9.7707 Current maximum value is 9.7707 Current heap as a vector: 1: 9.7707378 2: 9.6546474 3: 8.5495830 4: 7.0584886 5: 7.4025716 6: 0.10393809 7: 8.0525652 8: 5.7022955 9: 0.29486778 10: 6.7550207 R8VEC_HISTOGRAM_TEST R8VEC_HISTOGRAM histograms an R8VEC. Uniform data: Histogram of data: 0.0000 0 0.0000 0.0500 51 0.0500 0.1000 51 0.1000 0.1500 55 0.1500 0.2000 40 0.2000 0.2500 48 0.2500 0.3000 47 0.3000 0.3500 54 0.3500 0.4000 42 0.4000 0.4500 54 0.4500 0.5000 57 0.5000 0.5500 51 0.5500 0.6000 42 0.6000 0.6500 55 0.6500 0.7000 44 0.7000 0.7500 66 0.7500 0.8000 44 0.8000 0.8500 39 0.8500 0.9000 57 0.9000 0.9500 44 0.9500 1.0000 59 1.0000 0 Normal data: Histogram of data: -3.0000 0 -3.0000 -2.7000 3 -2.7000 -2.4000 3 -2.4000 -2.1000 13 -2.1000 -1.8000 19 -1.8000 -1.5000 39 -1.5000 -1.2000 48 -1.2000 -0.9000 72 -0.9000 -0.6000 90 -0.6000 -0.3000 122 -0.3000 0.0000 107 0.0000 0.3000 121 0.3000 0.6000 106 0.6000 0.9000 87 0.9000 1.2000 57 1.2000 1.5000 50 1.5000 1.8000 32 1.8000 2.1000 10 2.1000 2.4000 10 2.4000 2.7000 9 2.7000 3.0000 1 3.0000 1 R8VEC_HOUSE_COLUMN_TEST R8VEC_HOUSE_COLUMN returns the compact form of a Householder matrix that "packs" a column of a matrix. Matrix A: Col 1 2 3 4 Row 1: 3.30671 -1.89150 3.09892 -4.00876 2: 0.808353 0.884506 4.60735 4.97080 3: 0.833486 0.244746 2.35743 2.75114 4: 2.36444 1.58342 2.00232 0.845343 Working on column K = 1 Householder matrix H: Col 1 2 3 4 Row 1: -0.782162 -0.191206 -0.197151 -0.559280 2: -0.191206 0.979486 -0.211521E-01 -0.600045E-01 3: -0.197151 -0.211521E-01 0.978190 -0.618702E-01 4: -0.559280 -0.600045E-01 -0.618702E-01 0.824486 Product H*A: Col 1 2 3 4 Row 1: -4.22765 0.376507 -4.88944 1.16988 2: 0.138778E-15 1.12784 3.75029 5.52641 3: 0.222045E-15 0.495643 1.47372 3.32402 4: 0.444089E-15 2.29517 -0.504597 2.47051 Working on column K = 2 Householder matrix H: Col 1 2 3 4 Row 1: 1.00000 0.00000 0.00000 0.00000 2: 0.00000 -0.432968 -0.190274 -0.881098 3: 0.00000 -0.190274 0.974735 -0.116995 4: 0.00000 -0.881098 -0.116995 0.458233 Product H*A: Col 1 2 3 4 Row 1: -4.22765 0.376507 -4.88944 1.16988 2: -0.493622E-15 -2.60490 -1.45957 -5.20200 3: 0.138073E-15 0.555112E-16 0.781938 1.89947 4: 0.552414E-16 -0.222045E-15 -3.70802 -4.12614 Working on column K = 3 Householder matrix H: Col 1 2 3 4 Row 1: 1.00000 0.00000 0.00000 0.00000 2: 0.00000 1.00000 0.00000 0.00000 3: 0.00000 0.00000 -0.206340 0.978480 4: 0.00000 0.00000 0.978480 0.206340 Product H*A: Col 1 2 3 4 Row 1: -4.22765 0.376507 -4.88944 1.16988 2: -0.493622E-15 -2.60490 -1.45957 -5.20200 3: 0.255628E-16 -0.228720E-15 -3.78957 -4.42928 4: 0.146500E-15 0.849996E-17 0.222045E-15 1.00721 R8VEC_IDENTITY_ROW_TEST R8VEC_IDENTITY_ROW returns a row of the identity matrix. 0: 0.0 0.0 0.0 0.0 0.0 1: 1.0 0.0 0.0 0.0 0.0 2: 0.0 1.0 0.0 0.0 0.0 3: 0.0 0.0 1.0 0.0 0.0 4: 0.0 0.0 0.0 1.0 0.0 5: 0.0 0.0 0.0 0.0 1.0 6: 0.0 0.0 0.0 0.0 0.0 R8VEC_INDEX_INSERT_TEST R8VEC_INDEX_INSERT inserts values into an index sorted array. 3.00 2.00 16.00 12.00 0.00 18.00 19.00 14.00 0.00 9.00 19.00 10.00 6.00 9.00 7.00 9.00 14.00 4.00 6.00 4.00 Indexed list of entries: I INDX(I) X(I) X(INDX(I)) 1 7 8.00 0.00 2 11 7.00 0.00 3 4 3.00 2.00 4 3 2.00 3.00 5 20 16.00 4.00 6 22 12.00 4.00 7 15 0.00 6.00 8 21 18.00 6.00 9 2 19.00 7.00 10 23 14.00 7.00 11 17 0.00 7.00 12 1 9.00 8.00 13 24 19.00 8.00 14 12 10.00 9.00 15 18 6.00 9.00 16 16 9.00 9.00 17 14 7.00 10.00 18 6 9.00 12.00 19 10 14.00 14.00 20 19 4.00 14.00 21 5 6.00 16.00 22 8 4.00 18.00 23 9 7.00 19.00 24 13 8.00 19.00 R8VEC_INDEX_DELETE_ALL_TEST R8VEC_INDEX_DELETE_ALL deletes all copies of a particular value. 4.00 7.00 18.00 3.00 17.00 8.00 14.00 11.00 19.00 9.00 17.00 19.00 6.00 16.00 15.00 3.00 0.00 9.00 2.00 5.00 Indexed list of entries: I INDX(I) X(I) X(INDX(I)) 1 19 8.00 0.00 2 21 7.00 2.00 3 6 4.00 3.00 4 18 7.00 3.00 5 3 18.00 4.00 6 22 3.00 5.00 7 15 17.00 6.00 8 2 8.00 7.00 9 23 14.00 7.00 10 4 11.00 7.00 11 1 19.00 8.00 12 8 9.00 8.00 13 24 17.00 8.00 14 12 19.00 9.00 15 20 6.00 9.00 16 10 16.00 11.00 17 9 15.00 14.00 18 17 3.00 15.00 19 16 0.00 16.00 20 7 9.00 17.00 21 13 2.00 17.00 22 5 5.00 18.00 23 11 7.00 19.00 24 14 8.00 19.00 Indexed list of entries: I INDX(I) X(I) X(INDX(I)) 1 17 8.00 0.00 2 19 4.00 2.00 3 4 18.00 3.00 4 16 3.00 3.00 5 2 17.00 4.00 6 20 8.00 5.00 7 13 14.00 6.00 8 1 11.00 8.00 9 6 19.00 8.00 10 21 9.00 8.00 11 10 17.00 9.00 12 18 19.00 9.00 13 8 6.00 11.00 14 7 16.00 14.00 15 15 15.00 15.00 16 14 3.00 16.00 17 5 0.00 17.00 18 11 9.00 17.00 19 3 2.00 18.00 20 9 5.00 19.00 21 12 8.00 19.00 R8VEC_INDEX_DELETE_DUPES_TEST R8VEC_INDEX_DELETE_DUPES deletes duplicates. Generate some random values: 13.00 2.00 0.00 8.00 5.00 11.00 16.00 11.00 14.00 16.00 10.00 16.00 14.00 15.00 15.00 11.00 16.00 3.00 7.00 8.00 Indexed list of entries: I INDX(I) X(I) X(INDX(I)) 1 5 8.00 0.00 2 4 7.00 2.00 3 20 13.00 3.00 4 7 2.00 5.00 5 2 0.00 7.00 6 21 8.00 7.00 7 23 5.00 7.00 8 1 11.00 8.00 9 6 16.00 8.00 10 24 11.00 8.00 11 22 14.00 8.00 12 13 16.00 10.00 13 8 10.00 11.00 14 10 16.00 11.00 15 18 14.00 11.00 16 3 15.00 13.00 17 11 15.00 14.00 18 15 11.00 14.00 19 16 16.00 15.00 20 17 3.00 15.00 21 9 7.00 16.00 22 12 8.00 16.00 23 14 7.00 16.00 24 19 8.00 16.00 Call R8VEC_INDEX_DELETE_DUPES to delete duplicates: Indexed list of unique entries: I INDX(I) X(I) 1 1 0.00 2 2 2.00 3 3 3.00 4 4 5.00 5 5 7.00 6 6 8.00 7 7 10.00 8 8 11.00 9 9 13.00 10 10 14.00 11 11 15.00 12 12 16.00 R8VEC_INDEX_DELETE_ONE_TEST R8VEC_INDEX_DELETE_ONE deletes one copies of a particular value. 12.00 9.00 18.00 4.00 4.00 5.00 2.00 10.00 4.00 19.00 8.00 13.00 1.00 6.00 7.00 15.00 1.00 20.00 15.00 17.00 Indexed list of entries: I INDX(I) X(I) X(INDX(I)) 1 15 8.00 1.00 2 19 7.00 1.00 3 9 12.00 2.00 4 6 9.00 4.00 5 7 18.00 4.00 6 11 4.00 4.00 7 8 4.00 5.00 8 16 5.00 6.00 9 2 2.00 7.00 10 23 10.00 7.00 11 17 4.00 7.00 12 1 19.00 8.00 13 24 8.00 8.00 14 13 13.00 8.00 15 4 1.00 9.00 16 10 6.00 10.00 17 3 7.00 12.00 18 14 15.00 13.00 19 18 1.00 15.00 20 21 20.00 15.00 21 22 15.00 17.00 22 5 17.00 18.00 23 12 7.00 19.00 24 20 8.00 20.00 Call R8VEC_INDEX_DELETE_ONE to delete one value of 8: Indexed list of entries: I INDX(I) X(I) X(INDX(I)) 1 14 7.00 1.00 2 18 12.00 1.00 3 8 9.00 2.00 4 5 18.00 4.00 5 6 4.00 4.00 6 10 4.00 4.00 7 7 5.00 5.00 8 15 2.00 6.00 9 1 10.00 7.00 10 22 4.00 7.00 11 16 19.00 7.00 12 23 8.00 8.00 13 12 13.00 8.00 14 3 1.00 9.00 15 9 6.00 10.00 16 2 7.00 12.00 17 13 15.00 13.00 18 17 1.00 15.00 19 20 20.00 15.00 20 21 15.00 17.00 21 4 17.00 18.00 22 11 7.00 19.00 23 19 8.00 20.00 R8VEC_INDEX_INSERT_UNIQUE_TEST R8VEC_INDEX_INSERT_UNIQUE inserts unique values into an index sorted array. Generate some random values: 1.00 19.00 19.00 1.00 13.00 13.00 17.00 19.00 8.00 7.00 1.00 19.00 13.00 5.00 18.00 5.00 9.00 5.00 18.00 2.00 Indexed list of entries: I INDX(I) X(I) X(INDX(I)) 1 1 1.00 1.00 2 10 19.00 2.00 3 7 13.00 5.00 4 6 17.00 7.00 5 5 8.00 8.00 6 9 7.00 9.00 7 3 5.00 13.00 8 4 18.00 17.00 9 8 9.00 18.00 10 2 2.00 19.00 R8VEC_INDEX_ORDER_TEST R8VEC_INDEX_ORDER sorts an index sorted array. Generate some random values: 14.00 14.00 16.00 10.00 6.00 0.00 17.00 17.00 8.00 10.00 7.00 2.00 13.00 9.00 3.00 9.00 2.00 20.00 13.00 9.00 Indexed list of unique entries: I INDX(I) X(I) X(INDX(I)) 1 5 14.00 0.00 2 9 16.00 2.00 3 12 10.00 3.00 4 4 6.00 6.00 5 8 0.00 7.00 6 7 17.00 8.00 7 11 8.00 9.00 8 3 7.00 10.00 9 10 2.00 13.00 10 1 13.00 14.00 11 2 9.00 16.00 12 6 3.00 17.00 13 13 20.00 20.00 Now call R8VEC_INDEX_ORDER to carry out the sorting: X: 1: 0.0000000 2: 2.0000000 3: 3.0000000 4: 6.0000000 5: 7.0000000 6: 8.0000000 7: 9.0000000 8: 10.000000 9: 13.000000 10: 14.000000 11: 16.000000 12: 17.000000 13: 20.000000 R8VEC_INDEX_SEARCH_TEST R8VEC_INDEX_SEARCH searches for an entry with a given value. Generate some random values: 11.00 15.00 12.00 9.00 18.00 9.00 3.00 10.00 3.00 12.00 12.00 4.00 12.00 9.00 6.00 5.00 7.00 15.00 14.00 18.00 Indexed list of entries: I INDX(I) X(I) X(INDX(I)) 1 6 11.00 3.00 2 8 15.00 4.00 3 10 12.00 5.00 4 9 9.00 6.00 5 11 18.00 7.00 6 4 3.00 9.00 7 7 10.00 10.00 8 1 4.00 11.00 9 3 6.00 12.00 10 12 5.00 14.00 11 2 7.00 15.00 12 5 14.00 18.00 Results of search for given XVAL: XVAL Less Equal More 0.00 0 0 1 1.00 0 0 1 2.00 0 0 1 3.00 0 1 2 4.00 1 2 3 5.00 2 3 4 6.00 3 4 5 7.00 4 5 6 8.00 5 0 6 9.00 5 6 7 10.00 6 7 8 11.00 7 8 9 12.00 8 9 10 13.00 9 0 10 14.00 9 10 11 15.00 10 11 12 16.00 11 0 12 17.00 11 0 12 18.00 11 12 13 19.00 12 0 13 20.00 12 0 13 R8VEC_INDEX_SORTED_RANGE_TEST R8VEC_INDEX_SORTED_RANGE seeks the range I_LO:I_HI of entries of sorted indexed R so that R_LO <= R(INDX(I)) <= R_HI for I_LO <= I <= I_HI. Array 1: 0.31656865 2: 0.26748918 3: 0.38721549 4: 0.54131707 5: 0.47062881 6: 0.63730221 7: 0.17050492 8: 0.54041350 9: 0.31479220 10: 0.67304321 11: 0.52222049 12: 0.52644082 13: 0.80196913 14: 0.65058471 15: 0.29520832 16: 0.76457854 17: 0.15053064 18: 0.31189641 19: 0.97221062 20: 0.76193604 I INDX R(INDX(I)) 1 17 0.150531 2 7 0.170505 3 2 0.267489 4 15 0.295208 5 18 0.311896 6 9 0.314792 7 1 0.316569 8 3 0.387215 9 5 0.470629 10 11 0.522220 11 12 0.526441 12 8 0.540414 13 4 0.541317 14 6 0.637302 15 14 0.650585 16 10 0.673043 17 20 0.761936 18 16 0.764579 19 13 0.801969 20 19 0.972211 R_LO 0.141563E-01 1 17 0.150531 2 7 0.170505 3 2 0.267489 4 15 0.295208 5 18 0.311896 6 9 0.314792 7 1 0.316569 8 3 0.387215 9 5 0.470629 10 11 0.522220 11 12 0.526441 12 8 0.540414 13 4 0.541317 14 6 0.637302 15 14 0.650585 16 10 0.673043 R_HI 0.699552 Array 1: 0.18309495 2: 0.61985049E-01 3: 0.25030455 4: 0.42151255 5: 0.62768899 6: 0.55308050 7: 0.94235241 8: 0.45683964 9: 0.19783475 10: 0.55798078 11: 0.42566644 12: 0.76435877 13: 0.78853860 14: 0.92651557 15: 0.91731986 16: 0.64778198 17: 0.81810387 18: 0.19837547 19: 0.86416385 20: 0.98982335E-01 I INDX R(INDX(I)) 1 2 0.619850E-01 2 20 0.989823E-01 3 1 0.183095 4 9 0.197835 5 18 0.198375 6 3 0.250305 7 4 0.421513 8 11 0.425666 9 8 0.456840 10 6 0.553081 11 10 0.557981 12 5 0.627689 13 16 0.647782 14 12 0.764359 15 13 0.788539 16 17 0.818104 17 19 0.864164 18 15 0.917320 19 14 0.926516 20 7 0.942352 R_LO 0.325137 7 4 0.421513 8 11 0.425666 9 8 0.456840 10 6 0.553081 11 10 0.557981 12 5 0.627689 13 16 0.647782 R_HI 0.695805 Array 1: 0.19830305E-02 2: 0.43185405 3: 0.75447928 4: 0.73199966 5: 0.16389537 6: 0.67859235 7: 0.85760345 8: 0.24379778 9: 0.36913117 10: 0.60000237 11: 0.58656621 12: 0.56984367 13: 0.31294565 14: 0.51532290E-01 15: 0.66922420E-01 16: 0.50263820 17: 0.35832641 18: 0.67391454 19: 0.70551008 20: 0.44054149 I INDX R(INDX(I)) 1 1 0.198303E-02 2 14 0.515323E-01 3 15 0.669224E-01 4 5 0.163895 5 8 0.243798 6 13 0.312946 7 17 0.358326 8 9 0.369131 9 2 0.431854 10 20 0.440541 11 16 0.502638 12 12 0.569844 13 11 0.586566 14 10 0.600002 15 18 0.673915 16 6 0.678592 17 19 0.705510 18 4 0.732000 19 3 0.754479 20 7 0.857603 R_LO 0.435261E-01 2 14 0.515323E-01 3 15 0.669224E-01 4 5 0.163895 R_HI 0.205457 Array 1: 0.13464889 2: 0.99555633 3: 0.61214619 4: 0.13297039 5: 0.99154201 6: 0.19993323 7: 0.90989927 8: 0.13896110 9: 0.58829170 10: 0.74372721 11: 0.37403422 12: 0.72133435E-01 13: 0.57409559E-01 14: 0.48686843 15: 0.62833932 16: 0.45053110 17: 0.82415278 18: 0.37383073 19: 0.86606296 20: 0.25990444 I INDX R(INDX(I)) 1 13 0.574096E-01 2 12 0.721334E-01 3 4 0.132970 4 1 0.134649 5 8 0.138961 6 6 0.199933 7 20 0.259904 8 18 0.373831 9 11 0.374034 10 16 0.450531 11 14 0.486868 12 9 0.588292 13 3 0.612146 14 15 0.628339 15 10 0.743727 16 17 0.824153 17 19 0.866063 18 7 0.909899 19 5 0.991542 20 2 0.995556 R_LO 0.644550E-01 2 12 0.721334E-01 3 4 0.132970 4 1 0.134649 5 8 0.138961 6 6 0.199933 R_HI 0.256707 Array 1: 0.49996405 2: 0.66387793 3: 0.84497296 4: 0.26183784 5: 0.23186533 6: 0.68318671 7: 0.33087297 8: 0.19131680 9: 0.56573623E-01 10: 0.28984775 11: 0.65318338 12: 0.44906505 13: 0.47639839 14: 0.31317724 15: 0.64629731 16: 0.66904185 17: 0.60901470 18: 0.48782450 19: 0.30920966 20: 0.77444552 I INDX R(INDX(I)) 1 9 0.565736E-01 2 8 0.191317 3 5 0.231865 4 4 0.261838 5 10 0.289848 6 19 0.309210 7 14 0.313177 8 7 0.330873 9 12 0.449065 10 13 0.476398 11 18 0.487825 12 1 0.499964 13 17 0.609015 14 15 0.646297 15 11 0.653183 16 2 0.663878 17 16 0.669042 18 6 0.683187 19 20 0.774446 20 3 0.844973 R_LO 0.336766 9 12 0.449065 10 13 0.476398 11 18 0.487825 12 1 0.499964 R_HI 0.547229 R8VEC_INDEXED_HEAP_D_TEST R8VEC_INDEXED_HEAP_D creates a descending heap from an indexed R8VEC. The data vector: 1: 101.00000 2: 102.00000 3: 103.00000 4: 104.00000 5: 105.00000 6: 106.00000 7: 107.00000 8: 108.00000 9: 109.00000 10: 110.00000 11: 111.00000 12: 112.00000 13: 113.00000 14: 114.00000 15: 115.00000 16: 116.00000 17: 117.00000 18: 118.00000 19: 119.00000 20: 120.00000 The index vector: 1: 1 2: 11 3: 17 4: 5 5: 7 6: 13 7: 15 8: 3 9: 19 10: 9 A(INDX): 1 101.000 2 111.000 3 117.000 4 105.000 5 107.000 6 113.000 7 115.000 8 103.000 9 119.000 10 109.000 The data vector (should NOT change): 1: 101.00000 2: 102.00000 3: 103.00000 4: 104.00000 5: 105.00000 6: 106.00000 7: 107.00000 8: 108.00000 9: 109.00000 10: 110.00000 11: 111.00000 12: 112.00000 13: 113.00000 14: 114.00000 15: 115.00000 16: 116.00000 17: 117.00000 18: 118.00000 19: 119.00000 20: 120.00000 The index vector (may change): 1: 19 2: 11 3: 17 4: 5 5: 9 6: 13 7: 15 8: 3 9: 1 10: 7 A(INDX) is now a heap: 1 119.000 2 111.000 3 117.000 4 105.000 5 109.000 6 113.000 7 115.000 8 103.000 9 101.000 10 107.000 R8VEC_INDEXED_HEAP_D_EXTRACT_TEST For an indexed R8VEC, R8VEC_INDEXED_HEAP_D_EXTRACT extracts the maximum value; The data vector: 1: 1.0000000 2: 2.0000000 3: 3.0000000 4: 4.0000000 5: 5.0000000 6: 6.0000000 7: 7.0000000 8: 8.0000000 9: 9.0000000 10: 10.000000 11: 11.000000 12: 12.000000 13: 13.000000 14: 14.000000 15: 15.000000 16: 16.000000 17: 17.000000 18: 18.000000 19: 19.000000 20: 20.000000 The index vector: 1: 9 2: 2 3: 8 4: 14 5: 5 A(INDX): 1 9.00000 2 2.00000 3 8.00000 4 14.0000 5 5.00000 The index vector after heaping: 1: 14 2: 9 3: 8 4: 2 5: 5 A(INDX) after heaping: 1 14.0000 2 9.00000 3 8.00000 4 2.00000 5 5.00000 Inserting value 7.00000 Current maximum is 14.0000 Inserting value 15.0000 Current maximum is 15.0000 Inserting value 1.00000 Current maximum is 15.0000 Inserting value 19.0000 Current maximum is 19.0000 Inserting value 20.0000 Current maximum is 20.0000 The data vector after insertions: 1: 1.0000000 2: 2.0000000 3: 3.0000000 4: 4.0000000 5: 5.0000000 6: 6.0000000 7: 7.0000000 8: 8.0000000 9: 9.0000000 10: 10.000000 11: 11.000000 12: 12.000000 13: 13.000000 14: 14.000000 15: 15.000000 16: 16.000000 17: 17.000000 18: 18.000000 19: 19.000000 20: 20.000000 The index vector after insertions: 1: 20 2: 19 3: 14 4: 9 5: 15 6: 7 7: 8 8: 1 9: 2 10: 5 A(INDX) after insertions: 1 20.0000 2 19.0000 3 14.0000 4 9.00000 5 15.0000 6 7.00000 7 8.00000 8 1.00000 9 2.00000 10 5.00000 Now extract the maximum several times. Extracting maximum element A( 20) = 20.0000 Extracting maximum element A( 19) = 19.0000 Extracting maximum element A( 15) = 15.0000 Extracting maximum element A( 14) = 14.0000 Extracting maximum element A( 9) = 9.00000 The data vector after extractions: 1: 1.0000000 2: 2.0000000 3: 3.0000000 4: 4.0000000 5: 5.0000000 6: 6.0000000 7: 7.0000000 8: 8.0000000 9: 9.0000000 10: 10.000000 11: 11.000000 12: 12.000000 13: 13.000000 14: 14.000000 15: 15.000000 16: 16.000000 17: 17.000000 18: 18.000000 19: 19.000000 20: 20.000000 The index vector after extractions: 1: 8 2: 5 3: 7 4: 2 5: 1 A(INDX) after extractions: 1 8.00000 2 5.00000 3 7.00000 4 2.00000 5 1.00000 R8VEC_INDEXED_HEAP_D_INSERT_TEST For an indexed R8VEC, R8VEC_INDEXED_HEAP_D_INSERT inserts a value into the heap. The data vector: 1: 1.0000000 2: 2.0000000 3: 3.0000000 4: 4.0000000 5: 5.0000000 6: 6.0000000 7: 7.0000000 8: 8.0000000 9: 9.0000000 10: 10.000000 11: 11.000000 12: 12.000000 13: 13.000000 14: 14.000000 15: 15.000000 16: 16.000000 17: 17.000000 18: 18.000000 19: 19.000000 20: 20.000000 The index vector: 1: 9 2: 2 3: 8 4: 14 5: 5 A(INDX): 1 9.00000 2 2.00000 3 8.00000 4 14.0000 5 5.00000 The index vector after heaping: 1: 14 2: 9 3: 8 4: 2 5: 5 A(INDX) after heaping: 1 14.0000 2 9.00000 3 8.00000 4 2.00000 5 5.00000 Inserting value 7.00000 Inserting value 15.0000 Inserting value 1.00000 Inserting value 19.0000 Inserting value 20.0000 The data vector after insertions: 1: 1.0000000 2: 2.0000000 3: 3.0000000 4: 4.0000000 5: 5.0000000 6: 6.0000000 7: 7.0000000 8: 8.0000000 9: 9.0000000 10: 10.000000 11: 11.000000 12: 12.000000 13: 13.000000 14: 14.000000 15: 15.000000 16: 16.000000 17: 17.000000 18: 18.000000 19: 19.000000 20: 20.000000 The index vector after insertions: 1: 20 2: 19 3: 14 4: 9 5: 15 6: 7 7: 8 8: 1 9: 2 10: 5 A(INDX) after insertions: 1 20.0000 2 19.0000 3 14.0000 4 9.00000 5 15.0000 6 7.00000 7 8.00000 8 1.00000 9 2.00000 10 5.00000 R8VEC_INDEXED_HEAP_D_MAX_TEST For an indexed R8VEC, R8VEC_INDEXED_HEAP_D_MAX reports the maximum value. The data vector: 1: 1.0000000 2: 2.0000000 3: 3.0000000 4: 4.0000000 5: 5.0000000 6: 6.0000000 7: 7.0000000 8: 8.0000000 9: 9.0000000 10: 10.000000 11: 11.000000 12: 12.000000 13: 13.000000 14: 14.000000 15: 15.000000 16: 16.000000 17: 17.000000 18: 18.000000 19: 19.000000 20: 20.000000 The index vector: 1: 9 2: 2 3: 8 4: 14 5: 5 A(INDX): 1 9.00000 2 2.00000 3 8.00000 4 14.0000 5 5.00000 The index vector after heaping: 1: 14 2: 9 3: 8 4: 2 5: 5 A(INDX) after heaping: 1 14.0000 2 9.00000 3 8.00000 4 2.00000 5 5.00000 Inserting value 7.00000 Current maximum is 14.0000 Inserting value 15.0000 Current maximum is 15.0000 Inserting value 1.00000 Current maximum is 15.0000 Inserting value 19.0000 Current maximum is 19.0000 Inserting value 20.0000 Current maximum is 20.0000 The data vector after insertions: 1: 1.0000000 2: 2.0000000 3: 3.0000000 4: 4.0000000 5: 5.0000000 6: 6.0000000 7: 7.0000000 8: 8.0000000 9: 9.0000000 10: 10.000000 11: 11.000000 12: 12.000000 13: 13.000000 14: 14.000000 15: 15.000000 16: 16.000000 17: 17.000000 18: 18.000000 19: 19.000000 20: 20.000000 The index vector after insertions: 1: 20 2: 19 3: 14 4: 9 5: 15 6: 7 7: 8 8: 1 9: 2 10: 5 A(INDX) after insertions: 1 20.0000 2 19.0000 3 14.0000 4 9.00000 5 15.0000 6 7.00000 7 8.00000 8 1.00000 9 2.00000 10 5.00000 R8VEC_INDICATOR0_TEST R8VEC_INDICATOR0 returns an indicator vector. The indicator0 vector: 1: 0.0000000 2: 1.0000000 3: 2.0000000 4: 3.0000000 5: 4.0000000 6: 5.0000000 7: 6.0000000 8: 7.0000000 9: 8.0000000 10: 9.0000000 R8VEC_INDICATOR1_TEST R8VEC_INDICATOR1 returns an indicator1 vector. The indicator1 vector: 1: 1.0000000 2: 2.0000000 3: 3.0000000 4: 4.0000000 5: 5.0000000 6: 6.0000000 7: 7.0000000 8: 8.0000000 9: 9.0000000 10: 10.000000 R8VEC_IS_BINARY_TEST R8VEC_IS_BINARY is TRUE if an R8VEC only contains 0 or 1 entries. X: 0.00000 0.00000 0.00000 X is binary. X: 1.00000 0.00000 1.00000 X is binary. X: 0.00000 2.00000 1.00000 X is NOT binary. R8VEC_IS_DISTINCT_TEST R8VEC_IS_DISTINCT is TRUE if an R8VEC only contains distinct entries. X: 0.00000 1.00000 3.00000 X is distinct. X: 1.50000 1.60000 1.50000 X is NOT distinct. X: -1.00000 1.00000 10.0000 X is distinct. R8VEC_IS_INTEGER_TEST R8VEC_IS_INTEGER is TRUE if an R8VEC only contains integer entries. Example 1: Obviously integer: X: 1.00000 2.00000 3.00000 4.00000 5.00000 6.00000 X is integer. Obviously NOT integer: X: 1.00000 2.00000 3.00000 4.00000 5.00000 6.50000 X is NOT integer. Example 3: Not Integer, Not obvious: X: 1.00000 2.00000 3.00000 4.00000 5.00000 6.00000 X is NOT integer. Example 4: Not Integer, Not obvious: X: 1.00000 2.00000 0.300000E+09 4.00000 5.00000 6.00000 X is NOT integer. R8VEC_LEGENDRE_TEST R8VEC_LEGENDRE computes N Legendre points in [R1,R2]. N = 5 R1 = -1.00000 R2 = 1.00000 Legendre points: 1: -0.90617985 2: -0.53846931 3: 0.0000000 4: 0.53846931 5: 0.90617985 N = 7 R1 = 0.00000 R2 = 10.0000 Legendre points: 1: 0.25446044 2: 1.2923441 3: 2.9707742 4: 5.0000000 5: 7.0292258 6: 8.7076559 7: 9.7455396 R8VEC_LINSPACE_TEST For a R8VEC: R8VEC_LINSPACE: evenly spaced points between A and B; r8vec_linspace ( 5, 10, 20 ) 1: 10.000000 2: 12.500000 3: 15.000000 4: 17.500000 5: 20.000000 R8VEC_LINSPACE2_TEST For a R8VEC: R8VEC_LINSPACE2: R8VEC_LINSPACE, but no endpoints; r8vec_linspace2 ( 5, 10, 20 ) 1: 11.666667 2: 13.333333 3: 15.000000 4: 16.666667 5: 18.333333 R8VEC_MAX_TEST For a R8VEC: R8VEC_MAX: maximum entry; Input vector: 1: 5.9870551 2: 1.9989127 3: 0.30554588 4: -6.7100102 5: -0.88558860 6: 5.4533924 7: -2.8405376 8: -2.3536983 9: 8.0041283 10: -0.48912574 Maximum: 8.00413 R8VEC_MAX_ABS_INDEX_TEST R8VEC_MAX_ABS_INDEX: index of entry of maximum absolute value; Input vector: 1: -1.0383356 2: 9.9704675 3: 2.3948831 4: 7.2218314 5: 1.1195418 6: -3.3238147 7: 4.0566105 8: -3.5301267 9: -2.9225160 10: -1.0816842 Index of entry of maximum absolute value: 2 R8VEC_MAX_INDEX_TEST For a R8VEC: R8VEC_MAX_INDEX: index of maximum entry; Input vector: 1: 6.4745079 2: 6.6871480 3: -8.9851866 4: -8.9175249 5: 8.5890108 6: -1.9300470 7: -8.8672689 8: -3.4539066 9: -9.5462288 10: -1.5427638 Maximum index: 5 R8VEC_MEAN_TEST For a R8VEC: R8VEC_MEAN: mean value; Input vector: 1: 9.3951319 2: 3.7453308 3: -7.2580502 4: 3.0953148 5: -7.5151717 6: -9.1683186 7: -4.9620307 8: -9.0141209 9: 5.8875367 10: -6.8047717 Mean: -2.25991 R8VEC_MEAN_GEOMETRIC_TEST R8VEC_MEAN_GEOMETRIC computes the geometric mean of an R8VEC. Input vector: 1: 3.4849208 2: 3.9446941 3: 2.7284136 4: 0.99110379 5: 0.41310013 6: 0.30624542 7: 3.3499531 8: 1.1862812 9: 4.9491514 10: 2.5799471 Geometric mean: 1.72891 R8VEC_MEAN_RUNNING_TEST R8VEC_MEAN_RUNNING returns the running averages of an R8VEC. Random R8VEC: 1: 4.8529554 2: -2.2653378 3: 7.0152035 4: 9.7050278 5: 8.4284268 6: -1.0790008 7: 0.45880413 8: 6.0185213 9: -1.3912526 10: 4.4706939 Running averages: 1: 0.0000000 2: 4.8529554 3: 1.2938088 4: 3.2009404 5: 4.8269622 6: 5.5472551 7: 4.4428791 8: 3.8737256 9: 4.1418250 10: 3.5270386 11: 3.6214042 R8VEC_MEAN_UPDATE_TEST R8VEC_MEAN_UPDATE updates the mean of a vector when one more element is added. N R MEAN MEAN_UPDATE 1 0.137062 0.137062 0.137062 2 0.459556 0.298309 0.298309 3 0.331602 0.309407 0.309407 4 0.341101 0.317330 0.317330 5 0.115237 0.276912 0.276912 6 0.283795 0.278059 0.278059 7 0.171322 0.262811 0.262811 8 0.297948 0.267203 0.267203 9 0.884159 0.335754 0.335754 10 0.795852 0.381763 0.381763 R8VEC_MEDIAN_TEST For a R8VEC: R8VEC_MEDIAN: median value; Input vector: 1: 2.9750902 2: -6.3566893 3: 9.9537638 4: -2.6260046 5: 1.9735544 6: 8.4296917 7: 7.8057230 8: -9.6774043 9: -5.3556492 10: -5.9274174 Median: -2.62600 R8VEC_MIDSPACE_TEST R8VEC_MIDSPACE: evenly spaced midpoints between A and B r8vec_midspace ( 5, 10, 20 ) 1: 11.000000 2: 13.000000 3: 15.000000 4: 17.000000 5: 19.000000 R8VEC_MIN_TEST For a R8VEC: R8VEC_MIN: minimum entry. Input vector: 1: -1.6553508 2: -7.6765913 3: -4.3349194 4: -0.20368934 5: -0.92877824 6: 3.5067870 7: 0.97857038 8: -7.9267501 9: -7.6807954 10: 4.8835926 Minimum: -7.92675 R8VEC_MIN_INDEX_TEST For a R8VEC: R8VEC_MIN_INDEX: index of minimum entry; Input vector: 1: -1.4114475 2: -2.7124286 3: -5.3231507 4: 5.1337018 5: 9.8722676 6: -0.43609291 7: -7.9738485 8: 0.25128646 9: 5.7003401 10: 2.7978444 Minimum index: 7 R8VEC_MIRROR_NEXT_TEST R8VEC_MIRROR_NEXT generates all sign variations of a real vector. Next vector: 1: 1.0000000 2: 2.0000000 3: 3.0000000 Next vector: 1: -1.0000000 2: 2.0000000 3: 3.0000000 Next vector: 1: 1.0000000 2: -2.0000000 3: 3.0000000 Next vector: 1: -1.0000000 2: -2.0000000 3: 3.0000000 Next vector: 1: 1.0000000 2: 2.0000000 3: -3.0000000 Next vector: 1: -1.0000000 2: 2.0000000 3: -3.0000000 Next vector: 1: 1.0000000 2: -2.0000000 3: -3.0000000 Next vector: 1: -1.0000000 2: -2.0000000 3: -3.0000000 Done. Next vector: 1: 1.0000000 2: 0.0000000 3: 3.0000000 Next vector: 1: -1.0000000 2: 0.0000000 3: 3.0000000 Next vector: 1: 1.0000000 2: -0.0000000 3: -3.0000000 Next vector: 1: -1.0000000 2: -0.0000000 3: -3.0000000 Done. R8VEC_MIRROR_AB_NEXT_TEST R8VEC_MIRROR_AB_NEXT generates all versions of of a real vector X mirrored by A and B. Case 1: 3x3x3 possibilities: A: -0.500000 -0.500000 -0.500000 X: 0.00000 0.00000 0.00000 B: 0.500000 0.500000 0.500000 1: -1.00000 -1.00000 -1.00000 2: -1.00000 -1.00000 0.00000 3: -1.00000 -1.00000 1.00000 4: -1.00000 0.00000 -1.00000 5: -1.00000 0.00000 0.00000 6: -1.00000 0.00000 1.00000 7: -1.00000 1.00000 -1.00000 8: -1.00000 1.00000 0.00000 9: -1.00000 1.00000 1.00000 10: 0.00000 -1.00000 -1.00000 11: 0.00000 -1.00000 0.00000 12: 0.00000 -1.00000 1.00000 13: 0.00000 0.00000 -1.00000 14: 0.00000 0.00000 0.00000 15: 0.00000 0.00000 1.00000 16: 0.00000 1.00000 -1.00000 17: 0.00000 1.00000 0.00000 18: 0.00000 1.00000 1.00000 19: 1.00000 -1.00000 -1.00000 20: 1.00000 -1.00000 0.00000 21: 1.00000 -1.00000 1.00000 22: 1.00000 0.00000 -1.00000 23: 1.00000 0.00000 0.00000 24: 1.00000 0.00000 1.00000 25: 1.00000 1.00000 -1.00000 26: 1.00000 1.00000 0.00000 27: 1.00000 1.00000 1.00000 Done. Case 2: 3x2x3 possibilities: A: -0.500000 -0.500000 -0.500000 X: 0.00000 0.500000 0.00000 B: 0.500000 0.500000 0.500000 1: -1.00000 -1.50000 -1.00000 2: -1.00000 -1.50000 0.00000 3: -1.00000 -1.50000 1.00000 4: -1.00000 0.500000 -1.00000 5: -1.00000 0.500000 0.00000 6: -1.00000 0.500000 1.00000 7: 0.00000 -1.50000 -1.00000 8: 0.00000 -1.50000 0.00000 9: 0.00000 -1.50000 1.00000 10: 0.00000 0.500000 -1.00000 11: 0.00000 0.500000 0.00000 12: 0.00000 0.500000 1.00000 13: 1.00000 -1.50000 -1.00000 14: 1.00000 -1.50000 0.00000 15: 1.00000 -1.50000 1.00000 16: 1.00000 0.500000 -1.00000 17: 1.00000 0.500000 0.00000 18: 1.00000 0.500000 1.00000 Done. Case 3: 1x3x3 possibilities: A: 0.00000 -0.500000 -0.500000 X: 0.00000 0.00000 0.00000 B: 0.00000 0.500000 0.500000 1: 0.00000 -1.00000 -1.00000 2: 0.00000 -1.00000 0.00000 3: 0.00000 -1.00000 1.00000 4: 0.00000 0.00000 -1.00000 5: 0.00000 0.00000 0.00000 6: 0.00000 0.00000 1.00000 7: 0.00000 1.00000 -1.00000 8: 0.00000 1.00000 0.00000 9: 0.00000 1.00000 1.00000 Done. R8VEC_NINT_TEST R8VEC_NINT rounds an R8VEC. Vector A: 1: 3.7552465 2: -4.8341361 3: -3.5860488 4: -0.29143518 5: -0.22309117 Rounded vector A: 1: 4.0000000 2: -5.0000000 3: -4.0000000 4: 0.0000000 5: 0.0000000 R8VEC_NORM_TEST R8VEC_NORM computes the L2 norm of an R8VEC. Vector X: 1: -2.9634917 2: 5.9629042 3: 3.6457904 4: 6.5373893 5: -4.4803587 R8VEC_NORM ( X ) = 10.9746 R8VEC_NORM_AFFINE_TEST R8VEC_NORM_AFFINE computes the L2 norm of the difference of two R8VECs. R8VEC_NORM_AFFINE(X,Y) = 13.3289 R8VEC_NORM (X-Y): 13.3289 R8VEC_NORM_L0_TEST R8VEC_NORM_L0 computes the L0 "norm" of an R8VEC. Input vector: 1: 2.0000000 2: 1.0000000 3: 1.0000000 4: -1.0000000 5: 0.0000000 6: 0.0000000 7: 1.0000000 8: 1.0000000 9: -1.0000000 10: 1.0000000 L0 norm: 8.00000 R8VEC_NORM_L1_TEST R8VEC_NORM_L1 computes the L1 norm of an R8VEC. Input vector: 1: 2.0973321 2: 0.22405492E-01 3: -8.9925589 4: 8.6723083 5: -6.3665051 6: -4.1149408 7: 7.5932996 8: -0.92098879 9: 8.2487255 10: -9.4072473 L1 norm: 56.4363 R8VEC_NORM_L2_TEST R8VEC_NORM_L2 computes the L2 norm of an R8VEC. Input vector: 1: 9.6445137 2: 4.3800710 3: 3.4370954 4: 6.7156133 5: -2.0510240 6: -5.7603058 7: -5.6227508 8: 9.0648892 9: -7.8644278 10: 7.5085886 L2 norm: 20.9408 R8VEC_NORM_LI_TEST R8VEC_NORM_LI computes the Loo norm of an R8VEC. Input vector: 1: 1.3952370 2: -9.8382171 3: 0.91701017 4: 3.0775049 5: 1.8965214 6: 9.2071909 7: -7.8154162 8: 6.6943172 9: -7.0066774 10: 2.6994971 L-Infinity norm: 9.83822 R8VEC_NORMAL_AB_TEST R8VEC_NORMAL_AB computes a vector of Normal AB values. MU = 15.0000 SIGMA = 0.250000 Vector of Normal AB values: 1: 15.117304 2: 14.535344 3: 15.349134 4: 15.056776 5: 15.248442 6: 15.260879 7: 14.923476 8: 14.900818 9: 15.046295 10: 15.078769 R8VEC_NORMALIZE_L1_TEST For a R8VEC: R8VEC_NORMALIZE_L1: make unit sum; Input vector: 1: -0.55198840 2: 1.0505653 3: 9.0049866 4: -3.2406087 5: -8.0249496 6: 1.9987883 7: 2.4957185 8: 9.4060899 9: 1.5328064 10: -5.1792562 After calling R8VEC_NORMALIZE_L1: 1: -0.64999826E-01 2: 0.12371014 3: 1.0603892 4: -0.38160041 5: -0.94498421 6: 0.23536887 7: 0.29388528 8: 1.1076215 9: 0.18049682 10: -0.60988736 R8VEC_ORDER_TYPE_TEST R8VEC_ORDER_TYPE classifies a R8VEC as -1: no order 0: all equal; 1: ascending; 2: strictly ascending; 3: descending; 4: strictly descending. The following vector has order type -1 1 1.00000 2 3.00000 3 2.00000 4 4.00000 The following vector has order type 0 1 2.00000 2 2.00000 3 2.00000 4 2.00000 The following vector has order type 1 1 1.00000 2 2.00000 3 2.00000 4 4.00000 The following vector has order type 2 1 1.00000 2 2.00000 3 3.00000 4 4.00000 The following vector has order type 3 1 4.00000 2 4.00000 3 3.00000 4 1.00000 The following vector has order type 4 1 9.00000 2 7.00000 3 3.00000 4 0.00000 R8VEC_PERMUTE_TEST R8VEC_PERMUTE permutes a R8VEC in place. Original array X[] 1: 1.0000000 2: 2.0000000 3: 3.0000000 4: 4.0000000 5: 5.0000000 Permutation vector P[] 1: 2 2: 4 3: 5 4: 1 5: 3 Permuted array X[P[]]: 1: 2.0000000 2: 4.0000000 3: 5.0000000 4: 1.0000000 5: 3.0000000 R8VEC_PERMUTE_CYCLIC_TEST R8VEC_PERMUTE_CYCLIC performs a cyclic permutation by K positions on an R8VEC. K = 4 Original array 1: 1.0000000 2: 2.0000000 3: 3.0000000 4: 4.0000000 5: 5.0000000 6: 6.0000000 7: 7.0000000 8: 8.0000000 9: 9.0000000 10: 10.000000 Array after cyclic permutation: 1: 5.0000000 2: 6.0000000 3: 7.0000000 4: 8.0000000 5: 9.0000000 6: 10.000000 7: 1.0000000 8: 2.0000000 9: 3.0000000 10: 4.0000000 R8VEC_PERMUTE_UNIFORM_TEST R8VEC_PERMUTE_UNIFORM randomly reorders an R8VEC. A, before permutation: 1: 101.00000 2: 102.00000 3: 103.00000 4: 104.00000 5: 105.00000 6: 106.00000 7: 107.00000 8: 108.00000 9: 109.00000 10: 110.00000 A, after random permutation: 1: 109.00000 2: 110.00000 3: 104.00000 4: 102.00000 5: 106.00000 6: 105.00000 7: 107.00000 8: 108.00000 9: 101.00000 10: 103.00000 R8VEC_POLARIZE_TEST R8VEC_POLARIZE decomposes a vector into components parallel and normal to a direction. Original vector: 1: 1.0000000 2: 2.0000000 3: 3.0000000 Direction vector: 1: 3.0000000 2: 1.0000000 3: -2.0000000 Normal component: 1: 1.2142857 2: 2.0714286 3: 2.8571429 Parallel component: 1: -0.21428571 2: -0.71428571E-01 3: 0.14285714 Dot product of P and A_normal (should be 0) 0.888178E-15 Cosine of angle between P and A_parallel (should be 1 or -1) -1.00000 Sum of components (should equal A): 1: 1.0000000 2: 2.0000000 3: 3.0000000 R8VEC_PRINT_TEST R8VEC_PRINT prints an R8VEC. The R8VEC: 1: 123.45600 2: 0.50000000E-05 3: -1000000.0 4: 3.1415927 R8VEC_PRINT_PART_TEST R8VEC_PRINT_PART prints part of an R8VEC. Entries 10:20 of the vector: 10: 10.000000 11: 11.000000 12: 12.000000 13: 13.000000 14: 14.000000 15: 15.000000 16: 16.000000 17: 17.000000 18: 18.000000 19: 19.000000 20: 20.000000 R8VEC_PRINT_SOME_TEST R8VEC_PRINT_SOME prints some of an R8VEC. No more than 10 lines of the vector: 1: 1.00000 2: 2.00000 3: 3.00000 4: 4.00000 5: 5.00000 6: 6.00000 7: 7.00000 8: 8.00000 ........ .............. 100: 100.000 R8VEC_REVERSE_TEST R8VEC_REVERSE reverses a R8VEC. Original array: 1: 1.0000000 2: 2.0000000 3: 3.0000000 4: 4.0000000 5: 5.0000000 Reversed array: 1: 5.0000000 2: 4.0000000 3: 3.0000000 4: 2.0000000 5: 1.0000000 Re-reversed array using a(1:n) = a(n:1:-1) 1: 1.0000000 2: 2.0000000 3: 3.0000000 4: 4.0000000 5: 5.0000000 R8VEC_ROTATE_TEST R8VEC_ROTATE rotates a R8VEC in place. Rotate entries 2 places to the right. Original array: 1: 1.0000000 2: 2.0000000 3: 3.0000000 4: 4.0000000 5: 5.0000000 Rotated array: 1: 4.0000000 2: 5.0000000 3: 1.0000000 4: 2.0000000 5: 3.0000000 R8VEC_RSQUARED_TEST R8VEC_RSQUARED evaluates the R^2 goodness-of-fit statistic. Data and model: 1 0.00000 0.00000 2 9.58000 9.00000 3 16.7600 16.0000 4 21.5200 21.0000 5 24.3800 24.0000 6 24.9700 25.0000 7 22.9000 24.0000 8 20.4500 21.0000 9 12.4000 16.0000 10 7.65000 9.00000 11 -3.82000 0.00000 Computed R^2 is -0.333769E+30 R8VEC_RSQUARED_ADJUSTED_TEST R8VEC_RSQUARED_ADJUSTED evaluates the adjusted R^2 goodness-of-fit statistic. Data and model: 1 0.00000 0.00000 2 9.58000 9.00000 3 16.7600 16.0000 4 21.5200 21.0000 5 24.3800 24.0000 6 24.9700 25.0000 7 22.9000 24.0000 8 20.4500 21.0000 9 12.4000 16.0000 10 7.65000 9.00000 11 -3.82000 0.00000 Computed R^2 for degree 2 is -0.417211E+30 R8VEC_SCALE_01_TEST R8VEC_SCALE_01 shifts and scales an R8VEC so that it has min 0 and max 1 Vector X: 1: 3.0674451 2: 6.6480161 3: -1.7039002 4: 2.9402605 5: -1.2866165 6: 3.2562819 7: 2.0127580 8: 12.747524 9: 0.59756729 10: 0.19654286 mean(X) = 2.84759 std(X) = 4.04068 max(X) = 12.7475 min(X) = -1.70390 Vector XS: 1: 0.33016436 2: 0.57793031 3: 0.0000000 4: 0.32136352 5: 0.28874918E-01 6: 0.34323136 7: 0.25718282 8: 1.0000000 9: 0.15925540 10: 0.13150558 mean(XS) = 0.314951 std(XS) = 0.279604 max(XS) = 1.00000 min(XS) = 0.00000 R8VEC_SCALE_AB_TEST R8VEC_SCALE_AB shifts and scales an R8VEC so that it has min A and max B Vector X: 1: -2.7346090 2: -4.5521143 3: 12.110525 4: -0.33607164 5: 13.296435 6: -0.96988920 7: 11.681954 8: 7.1260621 9: 11.283567 10: 1.3048235 mean(X) = 4.82107 std(X) = 6.60724 max(X) = 13.2964 min(X) = -4.55211 Using interval [ -1.00000 , 1.00000 ] Vector XS: 1: -0.79634140 2: -1.0000000 3: 0.86711415 4: -0.52757588 5: 1.0000000 6: -0.59859762 7: 0.81909109 8: 0.30858550 9: 0.77445020 10: -0.34370713 mean(XS) = 0.503019E-01 std(XS) = 0.740368 max(XS) = 1.00000 min(XS) = -1.00000 R8VEC_SEARCH_BINARY_A_TEST For ascending order: R8VEC_SEARCH_BINARY_A searches a sorted array; Sorted vector A: 1: 0.68110262E-01 2: 0.94291923E-01 3: 0.17291563 4: 0.23535075 5: 0.26403164 6: 0.29906315 7: 0.36942307 8: 0.39140677 9: 0.67386666 10: 0.83319394 Search the array for the value 0.391407 SEARCH RESULT: The value occurs in index 8 R8VEC_SIGN3_RUNNING_TEST R8VEC_SIGN3_RUNNING returns the running sign3 of an R8VEC. Random R8VEC: 1: 3.8708465 2: 4.5241193 3: 1.1944734 4: 6.6213600 5: 3.3097653 6: 3.0015258 7: 7.9535720 8: -2.5874193 9: 0.78851136 10: 5.9818231 Running sign3: 1: 0.0000000 2: 1.0000000 3: 1.0000000 4: 1.0000000 5: 1.0000000 6: 1.0000000 7: 1.0000000 8: 1.0000000 9: 1.0000000 10: 1.0000000 11: 1.0000000 r8vec_smooth_test r8vec_smooth smooths an R8VEC. The vector X: 1: 1.0000000 2: 2.0000000 3: 3.0000000 4: 4.0000000 5: 5.0000000 6: 6.0000000 7: 7.0000000 8: 8.0000000 9: 9.0000000 10: 10.000000 Vector X using smoothing S = 2 1: 1.0000000 2: 2.0000000 3: 3.0000000 4: 4.0000000 5: 5.0000000 6: 6.0000000 7: 7.0000000 8: 8.0000000 9: 9.0000000 10: 10.000000 The vector X: 1: 1.0000000 2: 4.0000000 3: 9.0000000 4: 16.000000 5: 25.000000 6: 36.000000 7: 49.000000 8: 64.000000 9: 81.000000 10: 100.00000 Vector X using smoothing S = 1 1: 1.0000000 2: 4.6666667 3: 9.6666667 4: 16.666667 5: 25.666667 6: 36.666667 7: 49.666667 8: 64.666667 9: 81.666667 10: 100.00000 R8VEC_SOFTMAX_TEST R8VEC_SOFTMAX evaluates the softmax function of an R8VEC. X, Softmax: 1 -6.56105 0.936789E-03 2 -3.26775 0.252294E-01 3 -2.22399 0.716480E-01 4 -6.64111 0.864717E-03 5 -7.82106 0.265722E-03 6 -1.10190 0.220050 7 -1.00099 0.243416 8 -5.02601 0.434814E-02 9 -2.43244 0.581672E-01 10 -0.568633 0.375074 R8VEC_SORT_BUBBLE_A_TEST R8VEC_SORT_BUBBLE_A ascending sorts a R8VEC. Original array: 1: 2.3415620 2: 26.281974 3: 9.1365378 4: 56.498679 5: 19.489495 6: 2.1157553 7: 12.691684 8: 19.777293 9: 23.856504 10: 1.3093950 Ascending sorted array: 1: 1.3093950 2: 2.1157553 3: 2.3415620 4: 5.2859338 5: 9.1365378 6: 10.783886 7: 12.691684 8: 13.411723 9: 17.873576 10: 19.489495 R8VEC_SORT_HEAP_A_TEST R8VEC_SORT_HEAP_A ascending sorts a R8VEC. Original array: 1: 52.434957 2: 54.189461 3: 47.307602 4: 2.1525494 5: 33.230329 6: 4.9606141 7: 25.031714 8: 56.803737 9: 18.604729 10: 20.472793 Ascending sorted array: 1: 2.1525494 2: 2.6912889 3: 4.9606141 4: 7.1176162 5: 12.582995 6: 16.380208 7: 17.790606 8: 18.604729 9: 20.472793 10: 20.618963 R8VEC_SORT_HEAP_D_TEST R8VEC_SORT_HEAP_D descending sorts a R8VEC. Original array: 1: 44.504292 2: 18.651482 3: 39.142200 4: 32.979727 5: 19.093331 6: 44.272452 7: 52.912083 8: 16.440868 9: 56.367937 10: 45.742169 Descending sorted array: 1: 56.367937 2: 52.912083 3: 52.249188 4: 51.231810 5: 45.742169 6: 44.504292 7: 44.272452 8: 39.142200 9: 32.979727 10: 31.222760 R8VEC_SORT_HEAP_INDEX_A_TEST R8VEC_SORT_HEAP_INDEX_A creates an ascending sort index for a R8VEC. Unsorted array: 1: 27.319382 2: 13.450911 3: 2.6057311 4: 9.8908753 5: 11.707090 6: 41.356546 7: 58.455909 8: 42.068001 9: 5.6998598 10: 17.466205 After indexed ascending sort: I, INDX(I), A(I) 1 15 27.3194 2 3 13.4509 3 9 2.60573 4 16 9.89088 5 4 11.7071 6 11 41.3565 7 5 58.4559 8 2 42.0680 9 10 5.69986 10 1 17.4662 11 19 11.2075 12 12 36.1141 13 17 42.2226 14 6 51.7717 15 20 1.90558 16 8 7.30955 17 13 41.2960 18 14 55.8688 19 18 29.4547 20 7 41.9512 Now use the index array to carry out the permutation implicitly. INDX(I), A(INDX(I)) 15 1.90558 3 2.60573 9 5.69986 16 7.30955 4 9.89088 11 11.2075 5 11.7071 2 13.4509 10 17.4662 1 27.3194 19 29.4547 12 36.1141 17 41.2960 6 41.3565 20 41.9512 8 42.0680 13 42.2226 14 51.7717 18 55.8688 7 58.4559 Call R8VEC_PERMUTE to carry out the permutation explicitly. I, A(I) 1: 1.9055755 2: 2.6057311 3: 5.6998598 4: 7.3095479 5: 9.8908753 6: 11.207548 7: 11.707090 8: 13.450911 9: 17.466205 10: 27.319382 11: 29.454724 12: 36.114139 13: 41.295956 14: 41.356546 15: 41.951192 16: 42.068001 17: 42.222553 18: 51.771651 19: 55.868825 20: 58.455909 R8VEC_SORT_HEAP_INDEX_D_TEST R8VEC_SORT_HEAP_INDEX_D creates a descending sort index for a R8VEC. Unsorted array: 1: 33.111148 2: 32.079733 3: 57.335121 4: 56.769966 5: 26.491051 6: 57.499788 7: 32.230931 8: 14.871691 9: 42.442137 10: 11.410274 After indexed descending sort: I, INDX(I), A(I) 1 11 33.1111 2 6 32.0797 3 3 57.3351 4 4 56.7700 5 19 26.4911 6 18 57.4998 7 12 32.2309 8 9 14.8717 9 1 42.4421 10 20 11.4103 11 7 58.9836 12 2 49.6905 13 16 30.5365 14 13 20.7864 15 15 30.1726 16 5 31.1169 17 14 13.2034 18 8 49.7657 19 17 50.7497 20 10 32.2767 Now use the index array to carry out the permutation implicitly. INDX(I), ARRAY(INDX(I)) 11 58.9836 6 57.4998 3 57.3351 4 56.7700 19 50.7497 18 49.7657 12 49.6905 9 42.4421 1 33.1111 20 32.2767 7 32.2309 2 32.0797 16 31.1169 13 30.5365 15 30.1726 5 26.4911 14 20.7864 8 14.8717 17 13.2034 10 11.4103 R8VEC_SORT_HEAP_MASK_A_TEST R8VEC_SORT_HEAP_MASK_A creates an ascending sort index for a masked R8VEC. Unsorted array: 1: 56.387839 2: 8.0203278 3: 58.717713 4: 59.135084 5: 58.015155 6: 2.9561567 7: 51.984406 8: 18.351754 9: 18.586820 10: 14.242639 11: 2.1356403 12: 41.657395 13: 45.526401 14: 28.492158 15: 53.587866 16: 1.8119606 17: 46.721360 18: 45.467149 19: 46.164291 20: 24.766960 The mask array: 1: 2 2: 4 3: 7 4: 8 5: 9 6: 12 7: 13 8: 16 9: 18 10: 19 Masked vector printout: The masked unsorted array: 1: 2 8.02033 2: 4 59.1351 3: 7 51.9844 4: 8 18.3518 5: 9 18.5868 6: 12 41.6574 7: 13 45.5264 8: 16 1.81196 9: 18 45.4671 10: 19 46.1643 After masked indexed ascending sort: I, INDX(I), MASK(INDX(I)), A(MASK(INDX(I))) 1 8 16 1.81196 2 1 2 8.02033 3 4 8 18.3518 4 5 9 18.5868 5 6 12 41.6574 6 9 18 45.4671 7 7 13 45.5264 8 10 19 46.1643 9 3 7 51.9844 10 2 4 59.1351 Call I4VEC_PERMUTE to carry out the index permutation explicitly on the MASK vector. The reordered mask array: 1: 16 2: 2 3: 8 4: 9 5: 12 6: 18 7: 13 8: 19 9: 7 10: 4 Masked vector printout: The reordered masked sorted array: 1: 16 1.81196 2: 2 8.02033 3: 8 18.3518 4: 9 18.5868 5: 12 41.6574 6: 18 45.4671 7: 13 45.5264 8: 19 46.1643 9: 7 51.9844 10: 4 59.1351 R8VEC_SORT_INSERT_A_TEST R8VEC_SORT_INSERT_A ascending sorts a R8VEC. Unsorted array: 1: 0.88588922E-02 2: 34.110828 3: 22.944685 4: 57.127926 5: 35.362064 6: 16.699236 7: 39.684521 8: 45.764402 9: 10.352333 10: 19.413056 Sorted array: 1: 0.88588922E-02 2: 10.352333 3: 12.568980 4: 16.699236 5: 19.413056 6: 20.747515 7: 22.944685 8: 27.757457 9: 32.071118 10: 32.837122 R8VEC_SORT_INSERT_INDEX_A_TEST R8VEC_SORT_INSERT_INDEX_A creates an ascending sort index for a R8VEC. Unsorted array: 1: 54.123398 2: 34.527387 3: 21.108482 4: 17.446740 5: 38.936642 6: 30.898845 7: 13.933629 8: 25.112449 9: 38.045538 10: 24.877354 After indexed ascending sort: I, INDX(I), A(I) 1 19 54.1234 2 20 34.5274 3 16 21.1085 4 7 17.4467 5 4 38.9366 6 13 30.8988 7 3 13.9336 8 12 25.1124 9 10 38.0455 10 8 24.8774 11 15 46.0108 12 6 21.7439 13 2 19.7815 14 9 51.0657 15 5 30.4377 16 11 13.6525 17 14 53.7366 18 17 56.4968 19 1 9.60813 20 18 11.9174 Now use the index array to carry out the permutation implicitly. I, INDX(I), A(INDX(I)) 1 19 9.60813 2 20 11.9174 3 16 13.6525 4 7 13.9336 5 4 17.4467 6 13 19.7815 7 3 21.1085 8 12 21.7439 9 10 24.8774 10 8 25.1124 11 15 30.4377 12 6 30.8988 13 2 34.5274 14 9 38.0455 15 5 38.9366 16 11 46.0108 17 14 51.0657 18 17 53.7366 19 1 54.1234 20 18 56.4968 Call R8VEC_PERMUTE to carry out the permutation explicitly. Permuted data 1: 9.6081322 2: 11.917366 3: 13.652513 4: 13.933629 5: 17.446740 6: 19.781470 7: 21.108482 8: 21.743872 9: 24.877354 10: 25.112449 R8VEC_SORT_QUICK_A_TEST R8VEC_SORT_QUICK_A sorts a R8VEC using quick sort. Unsorted array: 1: 2.2121804 2: 7.0779178 3: 5.3333206 4: 9.1549708 5: 6.2565236 6: 9.0893066 7: 9.3905680 8: 4.1042687 9: 3.1436688 10: 2.7989870 11: 0.55392262 12: 1.7203522 13: 0.97072052E-01 14: 0.20049449 15: 0.32478278 16: 8.7839434 17: 3.8183115 18: 9.5494962 19: 4.9466657 20: 7.6615997 Sorted array: 1: 0.97072052E-01 2: 0.20049449 3: 0.32478278 4: 0.55392262 5: 1.7203522 6: 2.2121804 7: 2.7989870 8: 3.1436688 9: 3.8183115 10: 4.1042687 11: 4.9466657 12: 5.3333206 13: 6.2565236 14: 7.0779178 15: 7.6615997 16: 8.7839434 17: 9.0893066 18: 9.1549708 19: 9.3905680 20: 9.5494962 R8VEC_SORTED_MERGE_A_TEST For ascending order: R8VEC_SORTED_MERGE_A merges two sorted R8VEC's; Sorted vector A: 1: 0.13657354E-01 2: 0.17607521 3: 0.22248875 4: 0.22614442 5: 0.32087683 6: 0.56501926 7: 0.68958160 8: 0.84660408 9: 0.92750999 10: 0.98577666 Sorted vector B: 1: 0.91173079E-01 2: 0.96216345E-01 3: 0.13802561 4: 0.15381622 5: 0.20620381 6: 0.60474926 7: 0.61852574 8: 0.69038658 9: 0.93108018 10: 0.93975679 Merged vector C: 1: 0.13657354E-01 2: 0.91173079E-01 3: 0.96216345E-01 4: 0.13802561 5: 0.15381622 6: 0.17607521 7: 0.20620381 8: 0.22248875 9: 0.22614442 10: 0.32087683 11: 0.56501926 12: 0.60474926 13: 0.61852574 14: 0.68958160 15: 0.69038658 16: 0.84660408 17: 0.92750999 18: 0.93108018 19: 0.93975679 20: 0.98577666 R8VEC_SORTED_NEAREST_TEST R8VEC_SORTED_NEAREST finds the nearest entry in a sorted R8VEC. Sorted array: 1: 0.98847270 2: 1.1839214 3: 2.0572301 4: 2.4276692 5: 3.6610997 6: 4.9588812 7: 5.9531640 8: 6.5987698 9: 8.1826476 10: 9.5410295 Test Nearest Value Index Value 9.0696 10 9.5410 5.7628 7 5.9532 2.3188 4 2.4277 9.8527 10 9.5410 4.3313 6 4.9589 3.5211 5 3.6611 0.9865 1 0.9885 4.0879 5 3.6611 5.9381 7 5.9532 4.8076 6 4.9589 R8VEC_SORTED_RANGE_TEST R8VEC_SORTED_RANGE seeks the range of indices in a sorted vector R so that R_LO <= R(I_LO:I_HI) <= R_HI. Sorted array R: 1: 0.29196427E-01 2: 0.30034602 3: 0.34936269 4: 0.46172538 5: 0.62581019 6: 0.66797875 7: 0.70977038 8: 0.77068271 9: 0.92308036 10: 0.93252292 R_LO 0.295330 2 0.300346 3 0.349363 4 0.461725 5 0.625810 6 0.667979 7 0.709770 8 0.770683 9 0.923080 10 0.932523 R_HI 0.970557 Sorted array R: 1: 0.18664273 2: 0.22815238 3: 0.30763105 4: 0.41031285 5: 0.50885987 6: 0.72649848 7: 0.77029599 8: 0.88426266 9: 0.97200287 10: 0.98454122 R_LO 0.642617 R_HI 0.702341 Empty range in R. Sorted array R: 1: 0.75420324E-01 2: 0.16290071 3: 0.31532292 4: 0.52577385 5: 0.57553193 6: 0.58696472 7: 0.70127980 8: 0.71849890 9: 0.75123745 10: 0.78268253 R_LO 0.678065 7 0.701280 8 0.718499 9 0.751237 10 0.782683 R_HI 0.950244 Sorted array R: 1: 0.54101792E-02 2: 0.20933504 3: 0.33246766 4: 0.50324281 5: 0.62713182 6: 0.69955864 7: 0.72760137 8: 0.74996476 9: 0.82001310 10: 0.95851652 R_LO 0.157843 2 0.209335 R_HI 0.248280 Sorted array R: 1: 0.43644004E-01 2: 0.78383821E-01 3: 0.25093048 4: 0.26348036 5: 0.31711507 6: 0.42162033 7: 0.51583518 8: 0.58352901 9: 0.89166085 10: 0.99563677 R_LO 0.209098 3 0.250930 4 0.263480 5 0.317115 6 0.421620 7 0.515835 8 0.583529 9 0.891661 R_HI 0.915495 R8VEC_SORTED_SPLIT_TEST R8VEC_SORTED_SPLIT splits a sorted R8VEC into entries less than and greater than a splitting value. The sorted array: 1: 0.0000000 2: 0.0000000 3: 0.0000000 4: 0.50000000 5: 1.0000000 6: 1.0000000 7: 1.0000000 8: 1.5000000 9: 2.0000000 10: 2.0000000 11: 2.0000000 12: 2.0000000 13: 2.0000000 14: 2.5000000 15: 2.5000000 16: 2.5000000 17: 3.0000000 18: 3.5000000 19: 3.5000000 20: 3.5000000 21: 3.5000000 22: 4.0000000 23: 4.0000000 24: 4.0000000 25: 4.5000000 Splitting value is 2.25000 Lower index I_LT = 13 Upper index I_GT = 14 R8VEC_SORTED_UNDEX_TEST R8VEC_SORTED_UNDEX produces index vectors which create a sorted list of the unique elements of a sorted R8VEC, and a map from the original vector to the (implicit) vector of sorted unique elements. The vector X: 1: 11.000000 2: 11.000000 3: 11.000000 4: 22.000000 5: 22.000000 6: 33.000000 7: 33.000000 8: 55.000000 9: 55.000000 Tolerance for equality is 0.222045E-15 Number of unique entries in X is 4 UNDX can be used to list the unique elements of X in sorted order. I UNDX X(UNDX) 1 1 11.0 2 4 22.0 3 6 33.0 4 8 55.0 UNDX can be used to created XU, a copy of X containing only the unique elements, in sorted order. I UNDX XU(I) 1 1 11.0 2 4 22.0 3 6 33.0 4 8 55.0 XDNU can be used to match each element of X with one of the unique elements I XDNU X(I) XU(XDNU(I)) 1 1 11.0 11.0 2 1 11.0 11.0 3 1 11.0 11.0 4 2 22.0 22.0 5 2 22.0 22.0 6 3 33.0 33.0 7 3 33.0 33.0 8 4 55.0 55.0 9 4 55.0 55.0 R8VEC_SORTED_UNIQUE_TEST R8VEC_SORTED_UNIQUE finds the unique entries in a sorted R8VEC; Unsorted array: 1: 20.000000 2: 27.000000 3: 16.000000 4: 22.000000 5: 13.000000 6: 14.000000 7: 21.000000 8: 13.000000 9: 22.000000 10: 9.0000000 Unique entries 1: 1.0000000 2: 3.0000000 3: 4.0000000 4: 5.0000000 5: 8.0000000 6: 9.0000000 7: 13.000000 8: 14.000000 9: 16.000000 10: 17.000000 11: 18.000000 12: 20.000000 13: 21.000000 14: 22.000000 15: 24.000000 16: 26.000000 17: 27.000000 18: 28.000000 19: 29.000000 R8VEC_SORTED_UNIQUE_COUNT_TEST R8VEC_SORTED_UNIQUE_COUNT counts the unique entries of a sorted R8VEC; Using a tolerance of 0.250000 R8VEC_SORTED_UNIQUE_COUNT counts 30 unique entries in A. R8VEC_SORTED_UNIQUE_HIST_TEST R8VEC_SORTED_UNIQUE_HIST makes a histogram of the unique entries in a sorted R8VEC. Unsorted array: 1: 24.500000 2: 20.500000 3: 1.5000000 4: 28.500000 5: 26.500000 6: 13.500000 7: 26.500000 8: 18.500000 9: 15.500000 10: 18.500000 11: 4.5000000 12: 6.5000000 13: 14.500000 14: 15.500000 15: 2.5000000 16: 27.500000 17: 25.500000 18: 13.500000 19: 0.50000000 20: 29.500000 21: 8.5000000 22: 10.500000 23: 6.5000000 24: 19.500000 25: 12.500000 26: 0.50000000 27: 17.500000 28: 5.5000000 29: 22.500000 30: 23.500000 Ascending sorted array: 1: 0.50000000 2: 0.50000000 3: 1.5000000 4: 2.5000000 5: 4.5000000 6: 5.5000000 7: 6.5000000 8: 6.5000000 9: 8.5000000 10: 10.500000 11: 12.500000 12: 13.500000 13: 13.500000 14: 14.500000 15: 15.500000 16: 15.500000 17: 17.500000 18: 18.500000 19: 18.500000 20: 19.500000 21: 20.500000 22: 22.500000 23: 23.500000 24: 24.500000 25: 25.500000 26: 26.500000 27: 26.500000 28: 27.500000 29: 28.500000 30: 29.500000 R8VEC_SORTED_UNIQUE_HIST counts 24 unique entries. Value Multiplicity 1 0.500000 2 2 1.50000 1 3 2.50000 1 4 4.50000 1 5 5.50000 1 6 6.50000 2 7 8.50000 1 8 10.5000 1 9 12.5000 1 10 13.5000 2 11 14.5000 1 12 15.5000 2 13 17.5000 1 14 18.5000 2 15 19.5000 1 16 20.5000 1 17 22.5000 1 18 23.5000 1 19 24.5000 1 20 25.5000 1 21 26.5000 2 22 27.5000 1 23 28.5000 1 24 29.5000 1 R8VEC_SPLIT_TEST R8VEC SPLIT splits an R8VEC into entries less than and greater than a splitting value. The array: 1: 0.50000000 2: 1.0000000 3: 1.5000000 4: 1.0000000 5: 2.5000000 6: 2.0000000 7: 4.5000000 8: 3.0000000 9: 3.0000000 10: 1.5000000 11: 1.5000000 12: 4.5000000 13: 3.0000000 14: 2.0000000 15: 3.5000000 16: 4.5000000 17: 2.5000000 18: 2.5000000 19: 5.0000000 20: 1.0000000 21: 1.5000000 22: 1.0000000 23: 0.50000000 24: 1.5000000 25: 1.0000000 Splitting value is 0.750000 The split array: 1: 0.50000000 2: 0.50000000 3: 1.0000000 4: 2.5000000 5: 2.0000000 6: 4.5000000 7: 3.0000000 8: 3.0000000 9: 1.5000000 10: 1.5000000 11: 4.5000000 12: 3.0000000 13: 2.0000000 14: 3.5000000 15: 4.5000000 16: 2.5000000 17: 2.5000000 18: 5.0000000 19: 1.0000000 20: 1.5000000 21: 1.0000000 22: 1.5000000 23: 1.5000000 24: 1.0000000 25: 1.0000000 Array entries <= SPLIT up to index 2 R8VEC_STANDARDIZE_TEST R8VEC_STANDARDIZE shifts and scales an R8VEC so that it has zero mean and unit standard deviation. Vector X: 1: -0.95439604 2: 6.5652924 3: 11.919927 4: 7.2294715 5: 7.9862418 6: 2.8025488 7: 6.1514308 8: 10.510840 9: -2.8348418 10: 11.197625 mean(X) = 6.05741 std(X) = 4.99796 max(X) = 11.9199 min(X) = -2.83484 Vector XS: 1: -1.4029341 2: 0.10161713 3: 1.1729810 4: 0.23450713 5: 0.38592295 6: -0.65123857 7: 0.18811047E-01 8: 0.89104846 9: -1.7791766 10: 1.0284615 mean(XS) = 0.244249E-15 std(XS) = 1.00000 max(XS) = 1.17298 min(XS) = -1.77918 r8vec_std_test(): r8vec_std() computes the standard deviation of an R8VEC. Vector: 1: -0.30433442 2: 2.8402374 3: 3.7848785 4: -0.86694698 5: 3.2545431 6: 2.0626151 7: -3.9438939 8: -3.6892257 9: 0.41397461 10: -2.4938954 STD: 2.71158 r8vec_std_sample_test(0 r8vec_std_sample() computes the sample standard deviation of an R8VEC. Vector: 1: 2.9104115 2: 0.25770534 3: 3.1254043 4: -3.4831353 5: -3.4874113 6: -2.1714297 7: -4.0423311 8: 3.4449984 9: 0.41010527 10: -1.9125777 STD: 2.92310 r8vec_std_sample_update_test() r8vec_std_sample_update() updates sample standard deviation of a vector when one more element is added. N R STD STD_UPDATE 1 0.483053E-01 0.00000 0.00000 2 0.746834 0.493935 0.493935 3 0.548441 0.359963 0.359963 4 0.601278 0.303754 0.303754 5 0.816329 0.301654 0.301654 6 0.886808 0.302411 0.302411 7 0.946710E-01 0.337422 0.337422 8 0.411481 0.315414 0.315414 9 0.953196 0.328590 0.328590 10 0.845027 0.321990 0.321990 r8vec_std_update_test() r8vec_std_update() updates the standard deviation of a vector when one more element is added. N R STD STD_UPDATE 1 0.312673 0.00000 0.00000 2 0.571584E-01 0.127757 0.127757 3 0.266445 0.111168 0.111168 4 0.860849 0.296959 0.296959 5 0.894186 0.337337 0.337337 6 0.448151 0.308149 0.308149 7 0.548586 0.286506 0.286506 8 0.396657 0.269555 0.269555 9 0.928326 0.291641 0.291641 10 0.729943E-02 0.317091 0.317091 R8VEC_SUM_TEST R8VEC_SUM computes the sum of an R8VEC. Input vector: 1: -3.7326711 2: -0.32779721 3: -0.13078030 4: 0.31570584 5: 7.2315851 6: -1.6830531 7: 2.2470347 8: 9.3776798 9: 9.7051597 10: -8.2933700 SUM: 14.7095 R8VEC_SUM_RUNNING_TEST R8VEC_SUM_RUNNING eturns the running sums of an R8VEC. R8VEC: 1: -1.1609332 2: 4.3111365 3: 2.7396343 4: 9.3982113 5: 6.6734394 6: 1.5024395 7: 9.7307884 8: -0.79567274 9: -3.3412756 10: 5.9884122 Running sums: 1: 0.0000000 2: -1.1609332 3: 3.1502032 4: 5.8898375 5: 15.288049 6: 21.961488 7: 23.463928 8: 33.194716 9: 32.399043 10: 29.057768 11: 35.046180 R8VEC_TRANSPOSE_PRINT_TEST R8VEC_TRANSPOSE_PRINT prints an R8VEC "tranposed", that is, placing multiple entries on a line. The vector X: 1.10000 2.02000 30.3300 444.440 -0.500000E-02 6.66667 0.777778E+07 8.00000 99.0000 10.0000 11.0000 12.0000 R8VEC_UNDEX_TEST R8VEC_UNDEX produces index vectors which create a sorted list of the unique elements of an (unsorted) R8VEC, and a map from the original vector to the (implicit) vector of sorted unique elements. The vector X: 1: 33.000000 2: 55.000000 3: 11.000000 4: 11.000000 5: 55.000000 6: 33.000000 7: 22.000000 8: 22.000000 9: 11.000000 Tolerance for equality is 0.222045E-15 Number of unique entries in X is 4 UNDX can be used to list the unique elements of X in sorted order. I UNDX X(UNDX) 1 3 11.0 2 7 22.0 3 6 33.0 4 5 55.0 UNDX can be used to created XU, a copy of X containing only the unique elements, in sorted order. I UNDX XU(I) 1 3 11.0 2 7 22.0 3 6 33.0 4 5 55.0 XDNU can be used to match each element of X with one of the unique elements I XDNU X(I) XU(XDNU(I)) 1 3 33.0 33.0 2 4 55.0 55.0 3 1 11.0 11.0 4 1 11.0 11.0 5 4 55.0 55.0 6 3 33.0 33.0 7 2 22.0 22.0 8 2 22.0 22.0 9 1 11.0 11.0 R8VEC_UNIFORM_01_TEST R8VEC_UNIFORM_01 returns a random R8VEC with entries in [0,1]. Random R8VEC: 1: 0.22738441E-01 2: 0.84208578 3: 0.32202363 4: 0.75213577 5: 0.24065359 6: 0.83432819 7: 0.86722047E-01 8: 0.64011067 9: 0.23583827 10: 0.21310876 11: 0.32729610 12: 0.42448832 13: 0.75710647 14: 0.90897381 15: 0.88896254 16: 0.87335416 17: 0.98641298 18: 0.60221577 19: 0.30747767 20: 0.90742276 R8VEC_UNIFORM_AB_TEST R8VEC_UNIFORM_AB returns a random R8VEC with entries in a given range [ A, B ] For this problem: A = 10.0000 B = 20.0000 Random R8VEC: 1: 11.629156 2: 13.860891 3: 12.622977 4: 11.961432 5: 10.395392 6: 12.927704 7: 12.640529 8: 18.781369 9: 19.439743 10: 13.045847 Random R8VEC: 1: 19.961948 2: 12.132748 3: 13.628901 4: 15.913806 5: 17.486643 6: 10.949664 7: 18.556949 8: 11.523751 9: 10.498669 10: 14.314806 Random R8VEC: 1: 14.517999 2: 17.610738 3: 14.841928 4: 11.431670 5: 12.031108 6: 13.638032 7: 11.537086 8: 16.414293 9: 11.525680 10: 16.516271 R8VEC_UNIFORM_UNIT_TEST R8VEC_UNIFORM_UNIT returns a random point on the surface of the unit M sphere. Random unit vector: 1: -0.21400697 2: -0.44222187 3: -0.16062050 4: 0.12756398 5: 0.84650418 Random unit vector: 1: -0.51180838 2: -0.48992897 3: -0.25009403 4: -0.31459966 5: -0.58008777 Random unit vector: 1: -0.71598150E-02 2: 0.77591116 3: 0.12372303 4: -0.16444358 5: 0.59628981 Random unit vector: 1: -0.34599612 2: 0.62507817 3: 0.15514368E-01 4: 0.20902066 5: 0.66755797 Random unit vector: 1: 0.82317964E-01 2: 0.85677660 3: 0.41614360 4: 0.15918499 5: 0.24625648 r8vec_variance_test() r8vec_variance() computes the variance of an R8VEC. Vector: 1: -4.7358335 2: -3.0771580 3: 2.6840174 4: -1.0002612 5: 3.1236261 6: 4.8415262 7: 2.4004595 8: -0.44615964 9: -0.66281452 10: -1.1751614 Variance: 8.06994 R8VEC_VARIANCE_CIRCULAR_TEST R8VEC_VARIANCE_CIRCULAR computes the circular variance of an R8VEC. Uniform Vector in [-PI,+PI]: 1: -1.3123426 2: -2.5435452 3: -0.66445427 4: 0.96016055 5: 3.0552801 6: 3.0782945 7: 0.70401835E-01 8: -1.3284158 9: -2.6760512 10: 1.3711231 Circular variance: 0.831733 Normal vector, mean 0, variance 1 1: -0.70407940E-01 2: 0.54218372 3: 0.87635329 4: -1.2011470 5: 0.15363370 6: -2.0948837 7: -0.97350485 8: 0.12258032 9: 0.30222257E-01 10: 0.65012975 Circular variance: 0.328773 R8VEC_VARIANCE_SAMPLE_TEST R8VEC_VARIANCE_SAMPLE computes the sample variance of an R8VEC. Vector: 1: 2.3835215 2: 0.73611468 3: -2.4650880 4: 0.83639540 5: 3.0763998 6: 2.0490233 7: 1.8978091 8: -2.9675055 9: -0.11056262E-01 10: -4.3334094 Variance: 6.41153 r8vec_variance_sample_update_test() r8vec_variance_sample_update() updates the sample variance of a vector when one more element is added. N R VARIANCE VARIANCE_UPDATE 1 0.102776 0.00000 0.00000 2 0.924689 0.337770 0.337770 3 0.590200 0.170834 0.170834 4 0.210987 0.140824 0.140824 5 0.890281 0.143136 0.143136 6 0.191902 0.135146 0.135146 7 0.834291 0.130037 0.130037 8 0.780747 0.119008 0.119008 9 0.540012 0.104206 0.104206 10 0.121864 0.112076 0.112076 r8vec_variance_update_test() r8vec_variance_update() updates the variance of a vector when one more element is added. N R VARIANCE VARIANCE_UPDATE 1 0.172564 0.00000 0.00000 2 0.449362E-01 0.407219E-02 0.407219E-02 3 0.842842 0.122468 0.122468 4 0.652055 0.108570 0.108570 5 0.587064 0.908992E-01 0.908992E-01 6 0.765228 0.886979E-01 0.886979E-01 7 0.604857 0.771105E-01 0.771105E-01 8 0.290251 0.734590E-01 0.734590E-01 9 0.149076 0.771138E-01 0.771138E-01 10 0.428185 0.694748E-01 0.694748E-01 R8VEC2_PRINT_TEST R8VEC2_PRINT prints a pair of R8VEC's. Squares and square roots: 1 1.00000 1.00000 2 4.00000 1.41421 3 9.00000 1.73205 4 16.0000 2.00000 5 25.0000 2.23607 R8VEC2_PRINT_SOME_TEST R8VEC2_PRINT_SOME prints some of a pair of R8VEC's. No more than 10 lines of two vectors: 1 1.00000 1.00000 2 4.00000 1.41421 3 9.00000 1.73205 4 16.0000 2.00000 5 25.0000 2.23607 6 36.0000 2.44949 7 49.0000 2.64575 8 64.0000 2.82843 ...... .............. .............. 100 10000.0 10.0000 R8VEC2_SORT_A_TEST R8VEC2_SORT_A ascending sorts a pair of R8VEC's; The pair of arrays: 1 2.59223 9.32317 2 2.89654 8.03260 3 2.59223 9.32317 4 2.25146 8.31825 5 1.44032 9.80288 6 2.89654 8.03260 7 1.22256 8.63410 8 1.23441 8.52922 9 2.59223 9.32317 10 2.11945 8.99190 Arrays after ascending sort: 1 1.22256 8.63410 2 1.23441 8.52922 3 1.44032 9.80288 4 2.11945 8.99190 5 2.25146 8.31825 6 2.59223 9.32317 7 2.59223 9.32317 8 2.59223 9.32317 9 2.89654 8.03260 10 2.89654 8.03260 R8VEC2_SORT_D_TEST R8VEC2_SORT_D descending sorts a pair of R8VEC's. The pair of arrays: 1 2.95331 6.38711 2 2.02905 7.57328 3 2.95331 6.38711 4 1.25085 8.44637 5 2.98816 8.40770 6 2.02905 7.57328 7 2.32209 6.99931 8 2.23142 5.88516 9 2.95331 6.38711 10 2.31516 9.37951 Arrays after descending sort: 1 2.98816 8.40770 2 2.95331 6.38711 3 2.95331 6.38711 4 2.95331 6.38711 5 2.32209 6.99931 6 2.31516 9.37951 7 2.23142 5.88516 8 2.02905 7.57328 9 2.02905 7.57328 10 1.25085 8.44637 R8VEC2_SORT_HEAP_INDEX_A_TEST R8VEC2_SORT_HEAP_INDEX_A creates a sort index for an (X,Y) array. The unsorted array: I, X(I), Y(I) 1 0.950000 0.600000 2 0.650000 0.850000 3 0.200000 0.950000 4 0.200000 0.550000 5 0.400000 0.400000 6 0.800000 0.500000 7 0.950000 0.450000 8 0.600000 0.750000 9 0.550000 0.200000 10 0.400000 0.500000E-01 11 0.100000 0.250000 12 0.200000 0.550000 13 0.800000 0.500000E-01 14 0.400000 0.100000 15 0.900000 0.300000 16 0.500000E-01 0.350000 17 0.450000 0.500000 18 0.650000 1.00000 19 0.900000 0.00000 20 0.700000 0.300000 After sorting: I, INDX(I), X(I), Y(I) 1 16 0.950000 0.600000 2 11 0.650000 0.850000 3 4 0.200000 0.950000 4 12 0.200000 0.550000 5 3 0.400000 0.400000 6 10 0.800000 0.500000 7 14 0.950000 0.450000 8 5 0.600000 0.750000 9 17 0.550000 0.200000 10 9 0.400000 0.500000E-01 11 8 0.100000 0.250000 12 2 0.200000 0.550000 13 18 0.800000 0.500000E-01 14 20 0.400000 0.100000 15 13 0.900000 0.300000 16 6 0.500000E-01 0.350000 17 19 0.450000 0.500000 18 15 0.650000 1.00000 19 7 0.900000 0.00000 20 1 0.700000 0.300000 Now use the index array to carry out the permutation implicitly. I, INDX(I), X(INDX(I)), Y(INDX(I)) 1 16 0.500000E-01 0.350000 2 11 0.100000 0.250000 3 4 0.200000 0.550000 4 12 0.200000 0.550000 5 3 0.200000 0.950000 6 10 0.400000 0.500000E-01 7 14 0.400000 0.100000 8 5 0.400000 0.400000 9 17 0.450000 0.500000 10 9 0.550000 0.200000 11 8 0.600000 0.750000 12 2 0.650000 0.850000 13 18 0.650000 1.00000 14 20 0.700000 0.300000 15 13 0.800000 0.500000E-01 16 6 0.800000 0.500000 17 19 0.900000 0.00000 18 15 0.900000 0.300000 19 7 0.950000 0.450000 20 1 0.950000 0.600000 R8VEC_PERMUTE carries out the permutation. I, X(I), Y(I) 1 0.500000E-01 0.350000 2 0.100000 0.250000 3 0.200000 0.550000 4 0.200000 0.550000 5 0.200000 0.950000 6 0.400000 0.500000E-01 7 0.400000 0.100000 8 0.400000 0.400000 9 0.450000 0.500000 10 0.550000 0.200000 11 0.600000 0.750000 12 0.650000 0.850000 13 0.650000 1.00000 14 0.700000 0.300000 15 0.800000 0.500000E-01 16 0.800000 0.500000 17 0.900000 0.00000 18 0.900000 0.300000 19 0.950000 0.450000 20 0.950000 0.600000 R8VEC2_SORTED_UNIQUE_TEST For a pair of R8VEC's: R8VEC2_SORTED_UNIQUE counts unique entries. The pair of arrays: 1 1.43180 7.50092 2 1.37017 7.91163 3 1.43180 7.50092 4 1.85851 6.77728 5 1.07496 6.78559 6 1.37017 7.91163 7 1.84470 9.48890 8 1.78818 8.11157 9 1.43180 7.50092 10 2.67273 8.84798 Arrays after ascending sort: 1 1.07496 6.78559 2 1.37017 7.91163 3 1.37017 7.91163 4 1.43180 7.50092 5 1.43180 7.50092 6 1.43180 7.50092 7 1.78818 8.11157 8 1.84470 9.48890 9 1.85851 6.77728 10 2.67273 8.84798 UNIQed array: 1 1.07496 6.78559 2 1.37017 7.91163 3 1.43180 7.50092 4 1.78818 8.11157 5 1.84470 9.48890 6 1.85851 6.77728 7 2.67273 8.84798 R8VEC2_SORTED_UNIQUE_INDEX_TEST For a pair of R8VEC's: R8VEC2_SORTED_UNIQUE_INDEX indexes unique entries. Sorted arrays: 1 1.04048 5.14719 2 1.42997 7.30381 3 1.58901 9.75503 4 1.91806 6.50934 5 2.01689 6.53270 6 2.01689 6.53270 7 2.01689 6.53270 8 2.15777 7.91973 9 2.15777 7.91973 10 2.83117 6.98506 The number of unique elements is 7 Index of Unique Elements: 1: 1 2: 2 3: 3 4: 4 5: 5 6: 8 7: 10 After Indexed Nonunique Deletion. 1 1.04048 5.14719 2 1.42997 7.30381 3 1.58901 9.75503 4 1.91806 6.50934 5 2.01689 6.53270 6 2.15777 7.91973 7 2.83117 6.98506 R8VEC2_SUM_MAX_INDEX_TEST For a pair of R8VEC's: R8VEC2_SUM_MAX_INDEX: index of the sum vector with maximum value. The pair of vectors: 1 5.84723 4.39800 2 6.37812 2.47222 3 4.30817 4.64176 4 7.51514 4.24240 5 1.33796 0.340636 6 9.45864 3.81801 7 7.26318 1.31741 8 9.46310 0.783713 9 5.73162 2.65418 10 1.70033 0.179720 Index of maximum in A+B: 6 r8lib_test() Normal end of execution. 14 September 2021 10:27:48.002 AM