6 October 2025 6:33:35.424 PM r8lib_test() Fortran90 version Test r8lib(). i4int_to_r8int_test(): i4int_to_r8int() converts a value in an interval from an integer to a real; Integer interval: 1 11 Real interval: 100.000 200.000 R I(R) R(I(R)) 123.081 3 120.000 137.346 5 140.000 95.4912 1 100.000 174.069 8 170.000 106.142 2 110.000 198.311 11 200.000 184.964 9 180.000 165.457 8 170.000 115.846 3 120.000 91.1236 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 8 0 7 1 6 9 3 2 4 5 0 8 1 4 2 9 5 6 3 7 1 2 8 4 6 0 3 7 9 5 7 0 1 4 2 8 3 5 9 6 7 3 0 4 1 8 5 2 9 6 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 2 9 1 7 10 3 5 4 8 6 8 4 6 7 9 2 10 3 5 1 10 5 8 6 9 4 7 2 3 1 9 1 10 2 3 4 8 7 5 6 6 8 5 4 9 2 7 3 1 10 R8_ABS_TEST R8_ABS returns the absolute value of an R8. X R8_ABS(X) -2.424430 2.424430 0.534348 0.534348 3.751100 3.751100 0.891011 0.891011 -3.938272 3.938272 2.338328 2.338328 4.917043 4.917043 -2.145124 2.145124 4.917471 4.917471 -2.474675 2.474675 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 -2.74334 -1.39989 -2.74334 -6.70377 -1.88556 -6.70377 -3.83402 -1.56513 -3.83402 -8.01880 -2.00157 -8.01880 -6.44714 -1.86118 -6.44714 -1.96659 -1.25287 -1.96659 -0.890423 -0.962053 -0.890423 -3.97229 -1.58373 -3.97229 4.67817 1.67247 4.67817 -0.479507 -0.782706 -0.479507 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 -9 68 -0.132353 -59 -55 1.07273 37 -75 -0.493333 -49 59 -0.830508 14 -41 -0.341463 98 -94 -1.04255 73 96 0.760417 -32 18 -1.77778 40 -75 -0.533333 93 75 1.24000 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) 4.456123 0.456123 2.896725 0.896725 -0.398624 0.398624 -1.853628 0.853628 -0.039690 0.039690 2.217843 0.217843 4.470579 0.470579 -0.643699 0.643699 -2.373654 0.373654 2.333073 0.333073 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) -0.6505 -4.9511 -0.6505 1.6368 3.0966 3.0966 -0.3372 1.6813 1.6813 1.5251 -3.3554 1.5251 -2.8274 4.7672 4.7672 -3.6040 2.3741 2.3741 4.4629 -0.2937 4.4629 0.0669 1.9355 1.9355 1.8298 3.6888 3.6888 3.8812 -2.9116 3.8812 R8_MIN_TEST R8_MIN returns the minimum of two R8's. A B C=R8_MIN(A,B) -4.2501 -2.7344 -4.2501 -0.6563 -0.1459 -0.6563 -0.2461 3.2336 -0.2461 3.9661 3.8735 3.8735 3.4945 2.6303 2.6303 -3.3619 -1.2932 -3.3619 1.3187 -2.4805 -2.4805 4.2727 -0.8867 -0.8867 1.3490 0.9702 0.9702 2.0950 2.9643 2.0950 R8_MOD_TEST R8_MOD returns the remainder after division. X Y MOD(X,Y) R8_MOD(X,Y) -6.3436 7.2325 -6.3436 -6.3436 0.5319 8.9336 0.5319 0.5319 7.1669 -1.8650 1.5718 1.5718 7.3234 5.0715 2.2518 2.2518 -5.9844 1.8924 -0.3072 -0.3072 9.7836 2.7714 1.4695 1.4695 -0.6860 -6.4328 -0.6860 -0.6860 8.5254 -6.8339 1.6915 1.6915 4.6489 -6.2130 4.6489 4.6489 5.7265 -2.4808 0.7649 0.7649 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) 0.8299 1.5815 0.8299 0.8299 6.3219 -6.1448 0.1770 0.1770 -5.4558 8.7979 -5.4558 3.3421 -5.4709 6.3499 -5.4709 0.8789 7.4682 -7.9508 7.4682 7.4682 8.1506 6.4929 1.6577 1.6577 -6.5301 0.7266 -0.7174 0.0092 0.1492 -4.3324 0.1492 0.1492 1.6728 4.6244 1.6728 1.6728 -9.4869 -3.0834 -0.2366 2.8468 R8_MOP_TEST R8_MOP evaluates (-1.0)^I4 as an R8. I4 R8_MOP(I4) 34 1.0 51 -1.0 -33 -1.0 34 1.0 52 1.0 66 1.0 -79 -1.0 -40 1.0 -100 1.0 37 -1.0 R8_NINT_TEST R8_NINT produces the nearest integer to an R8. X R8_NINT(X) -9.1942 -9 -5.0322 -5 5.4158 5 -8.5232 -9 -9.1560 -9 9.5234 10 -6.4340 -6 2.9818 3 4.0032 4 -8.9045 -9 R8_NORMAL_01_TEST R8_NORMAL_01 generates normally distributed random values. 0.645482E-01 -1.52919 -0.885041 0.931555 1.56574 -0.359719 1.42523 0.382264 -1.09885 0.960726 -0.744827 -1.08152 -0.298886 2.25154 0.944495 -0.896987 0.990848 -0.157896 1.92762 1.76209 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 6.42519 12.3685 6.17944 13.3847 7.83499 13.4129 2.67958 4.39509 11.0038 8.36415 20.9382 10.6064 4.18740 10.8464 8.15326 4.96317 5.68965 11.7663 8.29808 11.2284 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.4141602183459225 0.000000000000000 2 0.4141602183459225 0.4100000000000000 4 0.4141602183459225 0.4141000000000000 6 0.4141602183459225 0.4141600000000000 8 0.4141602183459225 0.4141602100000000 10 0.4141602183459225 0.4141602183000000 0 0.3367625729905155E-01 0.000000000000000 2 0.3367625729905155E-01 0.3300000000000000E-01 4 0.3367625729905155E-01 0.3367000000000001E-01 6 0.3367625729905155E-01 0.3367620000000000E-01 8 0.3367625729905155E-01 0.3367625700000000E-01 10 0.3367625729905155E-01 0.3367625729000000E-01 0 0.1827625568863767E-01 0.000000000000000 2 0.1827625568863767E-01 0.1800000000000000E-01 4 0.1827625568863767E-01 0.1827000000000000E-01 6 0.1827625568863767E-01 0.1827620000000000E-01 8 0.1827625568863767E-01 0.1827625500000000E-01 10 0.1827625568863767E-01 0.1827625568000000E-01 0 0.4768881898721771 0.000000000000000 2 0.4768881898721771 0.4700000000000000 4 0.4768881898721771 0.4768000000000000 6 0.4768881898721771 0.4768880000000000 8 0.4768881898721771 0.4768881800000000 10 0.4768881898721771 0.4768881898000000 0 0.5369150139482616 0.000000000000000 2 0.5369150139482616 0.5300000000000000 4 0.5369150139482616 0.5369000000000000 6 0.5369150139482616 0.5369150000000000 8 0.5369150139482616 0.5369150100000000 10 0.5369150139482616 0.5369150139000001 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) 1.1633 0.0776 T 2.2712 1.1645 T -2.7394 0.1093 F 1.2069 -4.2516 F 1.0583 -2.9421 F 4.5424 -4.7270 F -0.0871 2.3080 F 4.4327 -2.2073 F 3.1945 -2.9596 F -1.1326 -2.2037 T 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 -0.2602 * sin ( 4.584 * x ) + -1.324 * cos ( 4.584 * x ) = 1.349 * sin ( 4.584 * x + -1.765 ) = 1.349 * cos ( 4.584 * x + 2.947 ) I X form 1 form 2 form 3 0 0.0000 -1.32373 -1.32373 -1.32373 1 0.3142 -.430628 -.430628 -.430628 2 0.6283 1.21140 1.21140 1.21140 3 0.9425 0.746621 0.746621 0.746621 4 1.2566 -1.01665 -1.01665 -1.01665 5 1.5708 -1.01181 -1.01181 -1.01181 6 1.8850 0.752718 0.752718 0.752718 7 2.1991 1.20816 1.20816 1.20816 8 2.5133 -.437571 -.437571 -.437571 9 2.8274 -1.32230 -1.32230 -1.32230 10 3.1416 0.926508E-01 0.926508E-01 0.926508E-01 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 6.92455 7.15789 4.11788 4.31579 4.05660 3.84211 11.1098 10.0000 4.95353 4.78947 9.07895 9.05263 10.1199 10.0000 10.8207 10.0000 5.99373 6.21053 9.84787 10.0000 8.36362 8.57895 5.00979 4.78947 1.36516 1.47368 11.6237 10.0000 6.67749 6.68421 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.4863 12.4035 10.9865 13.6563 16.3147 13.4005 13.6100 15.7205 15.6671 18.6709 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.44144 5.55856 0.551156E-01 3.55512 -1.23041 5.76959 2.99704 6.49704 0.571705 4.07170 8.98913 5.48913 6.17426 6.17426 8.87635 5.37635 8.16583 4.66583 -1.93320 5.06680 4.12084 4.12084 1.22112 4.72112 0.603878 4.10388 1.65714 5.15714 3.14239 3.14239 -1.14954 5.85046 7.64720 4.14720 0.449167 3.94917 3.82795 3.82795 7.14931 3.64931 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 = 4 1 3.00000 3.00000 2 2.00000 2.00000 3 1.00000 0.00000 4 0.00000 1.00000 Order type = -1 1 1.00000 2.00000 2 0.00000 2.00000 3 3.00000 2.00000 4 0.00000 3.00000 Order type = -1 1 1.00000 1.00000 2 1.00000 1.00000 3 2.00000 0.00000 4 1.00000 0.00000 Order type = -1 1 1.00000 0.00000 2 1.00000 2.00000 3 0.00000 2.00000 4 2.00000 2.00000 Order type = -1 1 2.00000 3.00000 2 1.00000 2.00000 3 2.00000 3.00000 4 2.00000 2.00000 Order type = -1 1 3.00000 3.00000 2 1.00000 3.00000 3 0.00000 2.00000 4 3.00000 2.00000 Order type = -1 1 1.00000 1.00000 2 1.00000 3.00000 3 1.00000 2.00000 4 0.00000 0.00000 Order type = -1 1 2.00000 3.00000 2 3.00000 2.00000 3 2.00000 3.00000 4 2.00000 2.00000 Order type = 3 1 3.00000 3.00000 2 1.00000 2.00000 3 1.00000 1.00000 4 1.00000 1.00000 Order type = -1 1 2.00000 2.00000 2 2.00000 2.00000 3 3.00000 2.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.85566 5.95672 2 5.43488 5.07660 3 1.96077 5.73058 4 8.24334 8.42084 5 5.58304 2.24894 6 1.82539 2.55821 7 7.81246 7.77999 8 5.13267 6.84980 9 8.31534 5.39693 10 1.87798 2.13838 11 5.07432 6.58406 12 3.57308 3.82710 Rearranged array Left index = 11 Key index = 12 Right index = 13 Left half: 1 5.43488 5.07660 2 1.96077 5.73058 3 8.24334 8.42084 4 5.58304 2.24894 5 1.82539 2.55821 6 7.81246 7.77999 7 5.13267 6.84980 8 8.31534 5.39693 9 1.87798 2.13838 10 5.07432 6.58406 11 3.57308 3.82710 Key: 1 8.85566 5.95672 Right half: 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 1.38374 5.49891 2 7.84681 8.02521 3 3.45729 1.42200 4 7.86468 7.30581 5 3.45729 6.18295 6 6.75260 5.49891 7 9.27165 4.69587 8 7.61940 9.35639 9 3.14519 8.02521 10 4.51421 7.22780 11 9.27165 4.69587 12 7.86468 4.29566 I Index A(Index) 1 1 1.38374 5.49891 2 9 3.14519 8.02521 3 3 3.45729 1.42200 4 5 3.45729 6.18295 5 10 4.51421 7.22780 6 6 6.75260 5.49891 7 8 7.61940 9.35639 8 2 7.84681 8.02521 9 12 7.86468 4.29566 10 4 7.86468 7.30581 11 7 9.27165 4.69587 12 11 9.27165 4.69587 After rearrangement by R82ROW_PERMUTE: 1 1.38374 5.49891 2 3.14519 8.02521 3 3.45729 1.42200 4 3.45729 6.18295 5 4.51421 7.22780 6 6.75260 5.49891 7 7.61940 9.35639 8 7.84681 8.02521 9 7.86468 4.29566 10 7.86468 7.30581 11 9.27165 4.69587 12 9.27165 4.69587 R82ROW_SORT_QUICK_A_TEST R82ROW_SORT_QUICK_A sorts an R82ROW using quick sort. Before rearrangement: 1 0.588237 8.40833 2 8.02018 6.25753 3 0.679104 8.01684 4 3.65870 8.69848 5 0.679104 9.32630 6 6.75944 8.40833 7 9.98623 4.42030 8 6.19076 1.87937 9 1.70216 6.25753 10 6.60599 8.96567 11 9.98623 4.42030 12 3.65870 4.52275 Sorted array: 1 0.588237 8.40833 2 0.679104 8.01684 3 0.679104 9.32630 4 1.70216 6.25753 5 3.65870 4.52275 6 3.65870 8.69848 7 6.19076 1.87937 8 6.60599 8.96567 9 6.75944 8.40833 10 8.02018 6.25753 11 9.98623 4.42030 12 9.98623 4.42030 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 2.00 2.00 2 1.00 2.00 3 2.00 1.00 4 2.00 3.00 5 4.00 1.00 6 3.00 1.00 1 2.00 2.00 3 2.00 1.00 7 3.00 3.00 4 2.00 3.00 8 1.00 3.00 6 3.00 1.00 1 2.00 2.00 9 3.00 2.00 1 2.00 2.00 9 3.00 2.00 7 3.00 3.00 1 2.00 2.00 2 1.00 2.00 7 3.00 3.00 4 2.00 3.00 2 1.00 2.00 9 3.00 2.00 4 2.00 3.00 9 3.00 2.00 9 3.00 2.00 7 3.00 3.00 9 3.00 2.00 6 3.00 1.00 8 1.00 3.00 Vector of unique X Y values: I X(I) Y(I) 1 2.00 2.00 2 1.00 2.00 3 2.00 1.00 4 2.00 3.00 5 4.00 1.00 6 3.00 1.00 7 3.00 3.00 8 1.00 3.00 9 3.00 2.00 X, Y sorted by index I INDX(I) X(INDX(I)) Y(INDX(I)) 1 2 1.00 2.00 2 8 1.00 3.00 3 3 2.00 1.00 4 1 2.00 2.00 5 4 2.00 3.00 6 6 3.00 1.00 7 9 3.00 2.00 8 7 3.00 3.00 9 5 4.00 1.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 1.00 3.00 2 3.00 2.00 3.00 3 4.00 2.00 3.00 4 3.00 1.00 2.00 5 4.00 2.00 2.00 3 4.00 2.00 3.00 3 4.00 2.00 3.00 6 4.00 2.00 4.00 7 2.00 2.00 3.00 8 3.00 3.00 3.00 9 1.00 3.00 2.00 10 3.00 2.00 2.00 11 2.00 3.00 2.00 12 1.00 3.00 4.00 5 4.00 2.00 2.00 6 4.00 2.00 4.00 5 4.00 2.00 2.00 13 2.00 1.00 2.00 14 3.00 1.00 1.00 4 3.00 1.00 2.00 15 2.00 3.00 3.00 16 4.00 2.00 1.00 17 3.00 3.00 2.00 18 4.00 3.00 4.00 17 3.00 3.00 2.00 13 2.00 1.00 2.00 19 2.00 2.00 2.00 19 2.00 2.00 2.00 20 3.00 2.00 4.00 7 2.00 2.00 3.00 Vector of unique X Y Z values: I X(I) Y(I) Z(I) 1 3.00 1.00 3.00 2 3.00 2.00 3.00 3 4.00 2.00 3.00 4 3.00 1.00 2.00 5 4.00 2.00 2.00 6 4.00 2.00 4.00 7 2.00 2.00 3.00 8 3.00 3.00 3.00 9 1.00 3.00 2.00 10 3.00 2.00 2.00 11 2.00 3.00 2.00 12 1.00 3.00 4.00 13 2.00 1.00 2.00 14 3.00 1.00 1.00 15 2.00 3.00 3.00 16 4.00 2.00 1.00 17 3.00 3.00 2.00 18 4.00 3.00 4.00 19 2.00 2.00 2.00 20 3.00 2.00 4.00 X Y Z sorted by index: I INDX(I) X(I) X(INDX(I)) 1 9 1.00 3.00 2.00 2 12 1.00 3.00 4.00 3 13 2.00 1.00 2.00 4 19 2.00 2.00 2.00 5 7 2.00 2.00 3.00 6 11 2.00 3.00 2.00 7 15 2.00 3.00 3.00 8 14 3.00 1.00 1.00 9 4 3.00 1.00 2.00 10 1 3.00 1.00 3.00 11 10 3.00 2.00 2.00 12 2 3.00 2.00 3.00 13 20 3.00 2.00 4.00 14 17 3.00 3.00 2.00 15 8 3.00 3.00 3.00 16 16 4.00 2.00 1.00 17 5 4.00 2.00 2.00 18 3 4.00 2.00 3.00 19 6 4.00 2.00 4.00 20 18 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)) 147.497 6 150.000 159.884 7 160.000 164.665 7 160.000 88.0624 0 90.0000 100.398 1 100.000 207.852 12 210.000 107.288 2 110.000 122.619 3 120.000 102.045 1 100.000 127.575 4 130.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.62260 0.562726 0.131257 0.638843 0.694804 2: 0.562726 5.10155 0.457409 0.625111 0.649365 3: 0.131257 0.457409 5.19106 0.793532 0.132698 4: 0.638843 0.625111 0.793532 5.92289 0.825818 5: 0.694804 0.649365 0.132698 0.825818 5.19268 Upper Cholesky factor R: Col 1 2 3 4 5 Row 1: 2.37120 0.237317 0.553546E-01 0.269417 0.293017 2: 0.00000 2.24616 0.197792 0.249837 0.258142 3: 0.00000 0.00000 2.26911 0.321360 0.288305E-01 4: 0.00000 0.00000 0.00000 2.38424 0.282318 5: 0.00000 0.00000 0.00000 0.00000 2.22703 Product R' * R: Col 1 2 3 4 5 Row 1: 5.62260 0.562726 0.131257 0.638843 0.694804 2: 0.562726 5.10155 0.457409 0.625111 0.649365 3: 0.131257 0.457409 5.19106 0.793532 0.132698 4: 0.638843 0.625111 0.793532 5.92289 0.825818 5: 0.694804 0.649365 0.132698 0.825818 5.19268 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.444089E-15 -0.166533E-15 -0.111022E-15 3: -0.666134E-15 0.133227E-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.00000 -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: 1.29261 -2.68774 4.97324 3.88360 -0.151223 2: 1.16576 -1.34133 -4.74476 -4.91579 2.75803 3: 3.29564 -3.19611 3.65322 0.854016 -3.26289 4: -2.00518 -0.831313 -2.87814 3.27073 3.38407 5: -1.09277 -2.30080 -4.43829 2.02969 -0.328360 Compact vector V so H*A packs column 3: 1: 0.0000000 2: 0.0000000 3: 0.88551333 4: -0.25279201 5: -0.38982348 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.568268 0.447701 0.690388 4: 0.00000 0.00000 0.447701 0.872192 -0.197089 5: 0.00000 0.00000 0.690388 -0.197089 0.696075 Indirect product A*H: Col 1 2 3 4 5 Row 1: 1.29261 -2.68774 -1.19184 5.64358 2.56278 2: 1.16576 -1.34133 2.39960 -6.95532 -0.387085 3: 3.29564 -3.19611 -3.94632 3.02350 0.826038E-01 4: -2.00518 -0.831313 5.43618 0.897204 -0.276089 5: -1.09277 -2.30080 3.20414 -0.152036 -3.69273 Direct product A*H: Col 1 2 3 4 5 Row 1: 1.29261 -2.68774 -1.19184 5.64358 2.56278 2: 1.16576 -1.34133 2.39960 -6.95532 -0.387085 3: 3.29564 -3.19611 -3.94632 3.02350 0.826038E-01 4: -2.00518 -0.831313 5.43618 0.897204 -0.276089 5: -1.09277 -2.30080 3.20414 -0.152036 -3.69273 Product H*A has packed column 3: Col 1 2 3 4 5 Row 1: 1.29261 -2.68774 4.97324 3.88360 -0.151223 2: 1.16576 -1.34133 -4.74476 -4.91579 2.75803 3: -3.52496 -0.144378 -6.42869 2.38027 3.14255 4: -0.580720E-01 -1.70251 0.811744E-15 2.83503 1.55547 5: 1.90982 -3.64424 -0.428032E-15 1.35779 -3.14818 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: 0.836413 0.859979 0.112809 1.21796 0.986481 2: 4.33972 3.55213 1.56455 2.99668 1.36106 3: 2.52074 1.70503 1.24343 2.02678 3.24842 4: 2.25953 4.76476 2.64443 1.24858 2.77928 5: 3.59904 0.512824 3.52303 2.44396 3.40071 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.429322 -0.822310 -0.373483 4: 0.00000 0.00000 -0.822310 0.526913 -0.214870 5: 0.00000 0.00000 -0.373483 -0.214870 0.902408 Product A*H: Col 1 2 3 4 5 Row 1: 0.836413 0.859979 -1.41840 0.337028 0.586374 2: 4.33972 3.55213 -3.64423 -0.747134E-15 -0.444089E-15 3: 2.52074 1.70503 -3.41370 -0.652535 2.03151 4: 2.25953 4.76476 -3.20004 -2.11384 1.25211 5: 3.59904 0.512824 -4.79231 -2.33998 1.22790 R8MAT_HOUSE_PRE_TEST R8MAT_HOUSE_PRE computes a Householder premultiplier; Matrix A: Col 1 2 3 4 5 Row 1: 4.00152 0.918363 2.55121 4.71709 2.22027 2: 2.01551 2.25779 1.21997 4.39685 1.89150 3: 2.58078 3.12899 2.56251 1.24059 3.46759 4: 2.05174 2.88083 4.40969 0.578280 3.34589 5: 3.29842 4.62258 1.93991 1.31383 1.34538 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.218188 -0.458298 -0.788660 -0.346947 3: 0.00000 -0.458298 0.827583 -0.296704 -0.130526 4: 0.00000 -0.788660 -0.296704 0.489418 -0.224615 5: 0.00000 -0.346947 -0.130526 -0.224615 0.901187 Product H*A: Col 1 2 3 4 5 Row 1: 4.00152 0.918363 2.55121 4.71709 2.22027 2: -4.38503 -5.80242 -5.59137 -2.43980 -5.10744 3: 0.172820 0.966376E-01 -0.366694E-15 -1.33144 0.834505 4: -2.09200 -2.33738 -0.464836E-15 -3.84780 -1.18526 5: 1.47551 2.32699 -0.301725E-15 -0.633285 -0.647956 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.333067E-15 1.00000 0.111022E-15 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: 6.54302 8.97376 4.01501 2: 4.25007 1.31217 2.57898 3: 0.208834 8.97834 9.80033 4: 1.19238 9.30329 3.41989 5: 1.23252 8.87431 4.10849 Maximum value = 9.80033 R8MAT_MAX_INDEX_TEST For an R8MAT: R8MAT_MAX_INDEX locates the maximum entry; Random array: Col 1 2 3 Row 1: 3.19371 8.70178 8.44121 2: 0.192887 1.41692 9.45304 3: 9.39348 8.88201 7.46696 4: 9.47504 0.329007 3.06292 5: 7.31494 8.97300 8.58786 Maximum I,J indices 4 1 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: 8.69389 9.99069 1.52062 2: 5.12703 9.94633 3.20327 3: 5.39161 1.00953 6.33624 4: 3.55668 6.02995 1.57592 5: 2.79349 2.83958 0.676410 MAXCOL_MINROW = 3.20327 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: 7.25233 9.26354 6.47968 2: 6.76864 2.39216 6.39464 3: 9.11693 2.05913 8.26418 4: 6.24450 0.718056 5.38738 5: 7.94422 2.48629 7.54985 MAXROW_MINCOL = 6.24450 R8MAT_MIN_TEST R8MAT_MIN computes the minimum value of an R8MAT Random array: Col 1 2 3 Row 1: 3.86353 7.07435 0.383903 2: 1.23611 9.49452 6.35563 3: 3.70824 8.94621 2.17026 4: 8.76479 6.77075 4.26281 5: 0.958495 7.40647 5.08243 Minimum value = 0.383903 R8MAT_MIN_INDEX_TEST For an R8MAT: R8MAT_MIN_INDEX locates the minimum entry; Random array: Col 1 2 3 Row 1: 9.31323 0.128448E-01 0.901684 2: 2.15588 0.652840 6.86156 3: 9.50240 7.88913 2.61366 4: 1.92241 7.64030 3.62785 5: 7.38835 7.23085 7.15418 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: 3.69238 4.10243 5.53656 2: 8.57465 3.61212 0.758510 3: 5.04249 1.06760 4.99084 4: 5.54565 0.332519E-01 2.42333 5: 9.04865 4.64886 9.02745 MINCOL_MAXROW = 5.04249 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: 0.273880 6.12782 5.71305 2: 3.10983 4.63546 6.46332 3: 1.77498 9.13097 5.78023 4: 9.55206 4.04469 9.57197 5: 7.98260 8.25418 9.53437 MINROW_MAXCOL = 9.13097 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.04109 -1.25680 3.24886 1.31264 2: -4.06196 0.881338 -2.80862 -1.47178 3: -2.92177 0.281038 1.83658 -2.53716 4: 1.99289 -3.42417 4.77994 -3.21517 5: -3.76989 -4.85583 -0.462929 -1.13051 Rounded matrix A: Col 1 2 3 4 Row 1: 4.00000 -1.00000 3.00000 1.00000 2: -4.00000 1.00000 -3.00000 -1.00000 3: -3.00000 0.00000 2.00000 -3.00000 4: 2.00000 -3.00000 5.00000 -3.00000 5: -4.00000 -5.00000 0.00000 -1.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.90915 Computed norm = 1.90915 R8MAT_NORM_L1_TEST R8MAT_NORM_L1 computes the L1 norm of an R8MAT; A: Col 1 2 3 4 Row 1: 4.00000 -3.00000 -4.00000 -1.00000 2: 1.00000 4.00000 5.00000 0.00000 3: 0.00000 4.00000 1.00000 -4.00000 4: 1.00000 0.00000 -2.00000 -4.00000 5: 4.00000 -2.00000 -5.00000 4.00000 Computed norm = 17.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.348819 -0.884469 -0.171984 0.181965 -0.182620 2: 0.460053 0.120612 -0.378131 0.463394 -0.645048 3: -0.383993 0.246906 -0.850365 -0.243456 0.958947E-01 4: 0.280957 -0.192952 0.608543E-02 -0.832277 -0.437162 5: 0.663543 -0.323998 -0.322925 -0.141122E-01 0.591824 A'*A should be identity: Col 1 2 3 4 5 Row 1: 1.00000 0.212397E-16 0.271196E-16 -0.643534E-16 0.271167E-16 2: 0.212397E-16 1.00000 0.131314E-15 -0.148376E-15 0.401343E-16 3: 0.271196E-16 0.131314E-15 1.00000 -0.168166E-16 0.530832E-17 4: -0.643534E-16 -0.148376E-15 -0.168166E-16 1.00000 -0.228682E-16 5: 0.271167E-16 0.401343E-16 0.530832E-17 -0.228682E-16 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: -4.60136 14.0365 14.5355 2: 1.66638 9.67712 12.6016 3: 9.13185 9.64969 1.19002 4: 6.10731 12.1739 4.75092 5: -1.95894 -3.51155 1.98086 6: -3.81827 13.0044 6.39026 7: -0.365955 0.374617 10.4670 8: -0.443649 9.61825 -0.647626 9: 11.6248 -2.36501 1.69220 10: -4.19280 11.8704 9.84344 mean(X) = 1.31494 7.45284 6.28041 std(X) = 5.76206 6.64279 5.31376 max(X) = 11.6248 14.0365 14.5355 min(X) = -4.60136 -3.51155 -0.647626 Matrix XS: Col 1 2 3 Row 1: 0.00000 1.00000 1.00000 2: 0.386273 0.751573 0.872627 3: 0.846360 0.750010 0.121033 4: 0.659962 0.893858 0.355562 5: 0.162849 0.00000 0.173119 6: 0.482608E-01 0.941185 0.463534 7: 0.261023 0.221458 0.732039 8: 0.256234 0.748219 0.00000 9: 1.00000 0.653367E-01 0.154107 10: 0.251791E-01 0.876559 0.690969 mean(XS) = 0.364614 0.624820 0.456299 std(XS) = 0.355109 0.378548 0.349979 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: 4.17613 -2.06969 -3.19177 2: -0.161454 12.7018 0.875213 3: 6.32175 4.21224 2.57139 4: 11.0633 0.994949 -0.813374 5: 3.55328 0.708093 5.29274 6: 9.22944 -3.37631 13.1442 7: 11.2521 -3.64938 7.57496 8: 8.73792 -3.00075 3.53558 9: 14.4608 4.98279 -3.49337 10: 5.63255 4.37471 11.8854 mean(X) = 7.42659 1.58785 3.73810 std(X) = 4.34481 5.13517 5.79869 max(X) = 14.4608 12.7018 13.1442 min(X) = -0.161454 -3.64938 -3.49337 New scale interval = [ -1.00000 , 1.00000 ] Matrix XS: Col 1 2 3 Row 1: -0.406716 -0.806780 -0.963745 2: -1.00000 1.00000 -0.474852 3: -0.113244 -0.384040E-01 -0.270955 4: 0.535297 -0.431927 -0.677837 5: -0.491907 -0.467014 0.561790E-01 6: 0.284464 -0.966599 1.00000 7: 0.561121 -1.00000 0.330525 8: 0.217235 -0.920663 -0.155049 9: 1.00000 0.558463E-01 -1.00000 10: -0.207510 -0.185316E-01 0.848687 mean(XS) = 0.378741E-01 -0.359407 -0.130705 std(XS) = 0.594273 0.628109 0.697061 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.732302 0.732302 0.233746E-01 0.233746E-01 Solution / Computed: 0.848491 0.848491 0.476102 0.476102 Solution / Computed: 0.249668 0.249668 0.564969 0.564969 Solution / Computed: 0.300544 0.300544 0.594528E-01 0.594528E-01 Solution / Computed: 0.958434 0.958434 0.562917 0.562917 R8MAT_SOLVE_3D_TEST R8MAT_SOLVE_3D solves 3D linear systems. Solution / Computed: 0.626419 0.626419 0.611785 0.611785 0.765775 0.765775 Solution / Computed: 0.975310 0.975310 0.965415 0.965415 0.112818 0.112818 Solution / Computed: 0.548468 0.548468 0.768892 0.768892 0.462713 0.462713 Solution / Computed: 0.508527 0.508527 0.672987 0.672987 0.193526 0.193526 Solution / Computed: 0.722850 0.722850 0.182297 0.182297 0.967686 0.967686 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: 9.13129 -2.66137 3.01554 2: -0.292495 11.9895 7.25512 3: 9.99995 3.45734 13.9516 4: 13.9320 2.24386 13.9658 5: 3.10745 -3.72644 10.4461 6: -2.53953 0.196125 12.2940 7: 2.94157 0.412223 -4.29575 8: 6.19154 12.3825 0.451847E-01 9: 11.6575 5.55486 11.2136 10: 9.00493 9.21491 1.67007 mean(X) = 6.31342 3.90635 6.95613 std(X) = 5.36503 5.75824 6.45323 max(X) = 13.9320 12.3825 13.9658 min(X) = -2.53953 -3.72644 -4.29575 Matrix XS: Col 1 2 3 Row 1: 0.525228 -1.14058 -0.610639 2: -1.23129 1.40376 0.463329E-01 3: 0.687140 -0.779771E-01 1.08403 4: 1.42004 -0.288716 1.08623 5: -0.597568 -1.32554 0.540814 6: -1.65012 -0.644334 0.827165 7: -0.628486 -0.606805 -1.74361 8: -0.227178E-01 1.47200 -1.07093 9: 0.996098 0.286288 0.659742 10: 0.501677 0.921907 -0.819135 mean(XS) = -0.555112E-16 0.666134E-16 -0.222045E-16 std(XS) = 1.00000 1.00000 1.00000 max(XS) = 1.42004 1.47200 1.08623 min(XS) = -1.65012 -1.32554 -1.74361 R8MAT_SYMM_JACOBI_TEST For a symmetric R8MAT: R8MAT_SYMM_JACOBI diagonalizes; Matrix to diagonalize: Col 1 2 3 4 5 Row 1: 2.91527 -0.716855 -0.391866 1.53363 -0.353991 2: -0.716855 3.49485 0.709220 -0.532302 -0.159433 3: -0.391866 0.709220 3.09818 0.807053 0.413921 4: 1.53363 -0.532302 0.807053 2.88667 -0.744093E-01 5: -0.353991 -0.159433 0.413921 -0.744093E-01 2.60502 Computed Eigenvalues: 2.00000 5.00000 1.00000 4.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.404345E-01 0.258770 0.733063 0.344584 0.158561 2: 0.486513 0.217751E-01 0.803714 0.115641 0.358856 3: 0.156816 0.518514 0.808360 0.685252 0.609576E-01 4: 0.898909E-01 0.354673 0.608077 0.341019 0.240372 5: 0.979423 0.379282 0.230582 0.594077 0.314372 The pivot vector P: 1: 5 2: 3 3: 3 4: 4 5: 5 The compressed LU factors: Col 1 2 3 4 5 Row 1: 0.979423 0.379282 0.230582 0.594077 0.314372 2: -0.496734 0.457787 0.771441 0.590134 0.106233E-01 3: -0.160111 0.363984 0.969968 0.353417E-01 0.206563 4: -0.917794E-01 -0.698714 -0.493804E-01 -0.127585 0.193896 5: -0.412840E-01 -0.531059 -0.323581 -0.374141E-01 0.658461E-01 The recovered matrix A2: Col 1 2 3 4 5 Row 1: 0.404345E-01 0.258770 0.733063 0.344584 0.158561 2: 0.486513 0.217751E-01 0.803714 0.115641 0.358856 3: 0.156816 0.518514 0.808360 0.685252 0.609576E-01 4: 0.898909E-01 0.354673 0.608077 0.341019 0.240372 5: 0.979423 0.379282 0.230582 0.594077 0.314372 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.00000 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: 6.29897 4.06120 9.80528 8.45162 2: 5.42857 8.58130 3.18141 8.17659 3: 2.78464 3.48625 5.60692 4.58033 4: 6.99171 7.61007 2.76880 8.02853 5: 6.24937 8.91009 6.45091 8.61642 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.205304 0.599550 0.637142 0.338585 0.671379 2: 0.823650 0.978270 0.225050 0.803571 0.125086E-01 3: 0.860048 0.208725 0.356029 0.681461 0.658780 4: 0.969852 0.863495 0.949354 0.329532 0.762994 5: 0.396061 0.286039 0.853728 0.814271 0.699093 The determinant = -0.214374 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.457800 0.869917 0.202824 0.642254 0.967396 2: 0.197372 0.934434 0.548557 0.551928 0.319532 3: 0.109798E-01 0.133351E-01 0.120078 0.272791 0.473146 4: 0.755905 0.790413 0.496533 0.272995 0.105028 5: 0.641857 0.791904 0.163315 0.109369E-06 0.369314 The inverse matrix B: Col 1 2 3 4 5 Row 1: 0.832116 -1.75490 -0.345351 1.93542 -0.769288 2: 0.331258 1.06385 -1.78157 -1.14992 0.821322 3: -3.10005 1.41637 4.20853 0.224308 1.43940 4: 2.67754 -0.851941 -2.52474 1.60910 -3.49959 5: -0.785621 0.142469 2.55930 -0.997152 1.64708 The product matrix C = A * B: Col 1 2 3 4 5 Row 1: 1.00000 -0.112262E-15 -0.553329E-15 -0.119979E-18 -0.444089E-15 2: 0.143935E-15 1.00000 0.124240E-15 0.960986E-16 0.111022E-15 3: -0.955392E-17 -0.526191E-17 1.00000 0.654627E-17 -0.111022E-15 4: 0.313791E-15 -0.366968E-15 -0.277974E-15 1.00000 0.277556E-16 5: 0.112874E-15 -0.193313E-15 0.150468E-15 -0.130376E-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.827770 0.659711 0.708939 0.722415 0.830771 2: 0.601888 0.702112 0.302884 0.455215 0.212363 3: 0.479628 0.346767 0.200403E-01 0.275835 0.875947 4: 0.556181 0.552559 0.163929 0.799745 0.217810 5: 0.413410 0.594766 0.669185E-01 0.486456 0.864982E-01 The right hand side B (computed from A): 1: 11.317522 2: 5.7974366 3: 6.7163574 4: 6.4411168 5: 4.1820146 The right hand side B (computed from PLU): 1: 11.317522 2: 5.7974366 3: 6.7163574 4: 6.4411168 5: 4.1820146 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.353407 0.398325 0.287761 0.644022 0.211816 2: 0.130199 0.201617 0.564617 0.442017 0.642561 3: 0.517435 0.263583 0.618927 0.508342 0.391038 4: 0.877988 0.135254 0.189202 0.860413 0.896243 5: 0.485451 0.875234 0.341151 0.492849E-03 0.664556 The right hand side B: 1: 5.6485102 2: 7.2081551 3: 6.8899428 4: 9.6389665 5: 6.5841241 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.476727 0.715277 0.583071 0.489400 0.334500E-01 2: 0.286031 0.709285E-01 0.596491 0.908984 0.290503 3: 0.592130 0.417915 0.606872E-01 0.339977 0.423341 4: 0.517582 0.897034 0.490578E-01 0.533052 0.826481 5: 0.130840 0.615448 0.670242 0.376006 0.941531 The pivot vector P: 1: 3 2: 4 3: 5 4: 4 5: 5 The compressed LU factors: Col 1 2 3 4 5 Row 1: 0.592130 0.417915 0.606872E-01 0.339977 0.423341 2: -0.483055 0.531735 -0.398896E-02 0.235878 0.456438 3: -0.805105 -0.712409 0.660757 0.688341E-01 0.398958 4: -0.874101 0.246264 -0.856887 0.743862 -0.143452 5: -0.220965 -0.983768 -0.812785 0.111652E-01 -0.958424 The recovered matrix A2: Col 1 2 3 4 5 Row 1: 0.476727 0.715277 0.583071 0.489400 0.334500E-01 2: 0.286031 0.709285E-01 0.596491 0.908984 0.290503 3: 0.592130 0.417915 0.606872E-01 0.339977 0.423341 4: 0.517582 0.897034 0.490578E-01 0.533052 0.826481 5: 0.130840 0.615448 0.670242 0.376006 0.941531 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: 0.85381709 2: -1.5664782 3: 2.6988290 4: -1.8255773 5: -3.4294613 6: 4.9708711 7: -4.1707094 8: 2.1212674 9: -4.2553195 10: 1.1508869 Maximum absolute: 4.97087 R8VEC_AMIN_TEST For a R8VEC: R8VEC_AMIN: minimum magnitude entry. Input vector: 1: 3.1200912 2: 3.2346544 3: -9.4668173 4: -5.8934506 5: 1.0489260 6: -8.8232540 7: -3.3041690 8: -7.4609218 9: 1.9446998 10: -1.6861077 Minimum absolute: 1.04893 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: 8.3174038 2: 3.9316023 3: -9.3802143 4: -2.5372337 5: -6.1598314 Vector V2: 1: 6.8060908 2: -3.7935066 3: -5.1842692 4: -9.5071443 5: -2.2327358 L-Infinity norm of V1-V2 = 7.72511 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.381269 0.350058 2 0.168267 0.519787 3 0.178208 0.842348 4 0.311566 0.834625 5 0.258026 0.859314 6 0.961221 0.309442 7 0.949031E-01 0.769846E-01 8 0.990805 0.513065 9 0.459758 0.884233 10 0.472617 0.341615 V1 dot V2 = 2.23389 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.83207179 2: 0.53131606E-03 3: 0.23054854E-01 4: 0.38595629 5: 0.87626560 6: 0.74809914 7: 0.23925648 8: 0.64696119 9: 0.66857104E-01 10: 0.55624901 Fractile Value 1 0.531316E-03 6 0.556249 R8VEC_HEAP_D_EXTRACT_TEST For a heap descending sorted R8VEC, R8VEC_HEAP_D_EXTRACT extracts the maximum value; Inserting value 9.5612 Current maximum value is 9.5612 Inserting value 6.3375 Current maximum value is 9.5612 Inserting value 2.2850 Current maximum value is 9.5612 Inserting value 8.2062 Current maximum value is 9.5612 Inserting value 9.8375 Current maximum value is 9.8375 Inserting value 5.7791 Current maximum value is 9.8375 Inserting value 2.8724 Current maximum value is 9.8375 Inserting value 8.9281 Current maximum value is 9.8375 Inserting value 6.9661 Current maximum value is 9.8375 Inserting value 4.0554 Current maximum value is 9.8375 Current heap as a vector: 1: 9.8374904 2: 9.5611899 3: 5.7790808 4: 8.9281236 5: 8.2062323 6: 2.2850082 7: 2.8724107 8: 6.3374575 9: 6.9661378 10: 4.0554140 Now extract the maximum several times. Extracting maximum element = 9.8375 Extracting maximum element = 9.5612 Extracting maximum element = 8.9281 Extracting maximum element = 8.2062 Extracting maximum element = 6.9661 Current heap as a vector: 1: 6.3374575 2: 5.7790808 3: 4.0554140 4: 2.8724107 5: 2.2850082 R8VEC_HEAP_D_INSERT_TEST For a heap descending sorted R8VEC, R8VEC_HEAP_D_INSERT inserts a value into the heap. Inserting value 1.8217 Current maximum value is 1.8217 Inserting value 1.9776 Current maximum value is 1.9776 Inserting value 2.5303 Current maximum value is 2.5303 Inserting value 6.6841 Current maximum value is 6.6841 Inserting value 5.9399 Current maximum value is 6.6841 Inserting value 5.9533 Current maximum value is 6.6841 Inserting value 2.5229 Current maximum value is 6.6841 Inserting value 6.9670 Current maximum value is 6.9670 Inserting value 7.8463 Current maximum value is 7.8463 Inserting value 9.4990 Current maximum value is 9.4990 Current heap as a vector: 1: 9.4990015 2: 7.8462596 3: 5.9533490 4: 6.6841319 5: 6.9670486 6: 1.9776011 7: 2.5228648 8: 1.8217080 9: 5.9399182 10: 2.5302937 R8VEC_HEAP_D_MAX_TEST For a heap descending sorted R8VEC, R8VEC_HEAP_D_MAX reports the maximum value. Inserting value 9.8565 Current maximum value is 9.8565 Inserting value 5.8788 Current maximum value is 9.8565 Inserting value 1.9822 Current maximum value is 9.8565 Inserting value 7.9453 Current maximum value is 9.8565 Inserting value 9.5918 Current maximum value is 9.8565 Inserting value 7.1353 Current maximum value is 9.8565 Inserting value 4.1778 Current maximum value is 9.8565 Inserting value 7.4371 Current maximum value is 9.8565 Inserting value 5.0905 Current maximum value is 9.8565 Inserting value 8.9284 Current maximum value is 9.8565 Current heap as a vector: 1: 9.8564721 2: 9.5917622 3: 7.1352847 4: 7.4370717 5: 8.9283726 6: 1.9822344 7: 4.1777791 8: 5.8788383 9: 5.0905170 10: 7.9453313 R8VEC_HISTOGRAM_TEST R8VEC_HISTOGRAM histograms an R8VEC. Uniform data: Histogram of data: 0.0000 0 0.0000 0.0500 62 0.0500 0.1000 54 0.1000 0.1500 38 0.1500 0.2000 49 0.2000 0.2500 58 0.2500 0.3000 46 0.3000 0.3500 42 0.3500 0.4000 49 0.4000 0.4500 43 0.4500 0.5000 46 0.5000 0.5500 55 0.5500 0.6000 38 0.6000 0.6500 62 0.6500 0.7000 52 0.7000 0.7500 45 0.7500 0.8000 38 0.8000 0.8500 53 0.8500 0.9000 48 0.9000 0.9500 57 0.9500 1.0000 65 1.0000 0 Normal data: Histogram of data: -3.0000 1 -3.0000 -2.7000 2 -2.7000 -2.4000 7 -2.4000 -2.1000 4 -2.1000 -1.8000 14 -1.8000 -1.5000 26 -1.5000 -1.2000 59 -1.2000 -0.9000 67 -0.9000 -0.6000 84 -0.6000 -0.3000 99 -0.3000 0.0000 122 0.0000 0.3000 110 0.3000 0.6000 111 0.6000 0.9000 89 0.9000 1.2000 75 1.2000 1.5000 68 1.5000 1.8000 26 1.8000 2.1000 23 2.1000 2.4000 6 2.4000 2.7000 4 2.7000 3.0000 1 3.0000 2 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.44030 -0.199853 -0.790563 3.56862 2: -1.67160 4.35926 3.26825 -3.50110 3: -4.00417 3.13886 -2.77723 -3.67944 4: 4.78949 1.29187 2.47241 1.58583 Working on column K = 1 Householder matrix H: Col 1 2 3 4 Row 1: -0.469899 -0.228318 -0.546915 0.654179 2: -0.228318 0.964536 -0.849518E-01 0.101613 3: -0.546915 -0.849518E-01 0.796506 0.243405 4: 0.654179 0.101613 0.243405 0.708857 Product H*A: Col 1 2 3 4 Row 1: 7.32137 -1.77296 2.76159 2.17223 2: -0.222045E-15 4.11491 3.82000 -3.71800 3: -0.444089E-15 2.55354 -1.45556 -4.19900 4: 0.444089E-15 1.99198 0.891522 2.20729 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.785811 -0.487642 -0.380402 3: 0.00000 -0.487642 0.866842 -0.103874 4: 0.00000 -0.380402 -0.103874 0.918969 Product H*A: Col 1 2 3 4 Row 1: 7.32137 -1.77296 2.76159 2.17223 2: 0.222109E-15 -5.23651 -2.63115 4.12959 3: -0.322807E-15 0.00000 -3.21714 -2.05610 4: 0.538700E-15 0.166533E-15 -0.482660 3.87894 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.988932 -0.148367 4: 0.00000 0.00000 -0.148367 0.988932 Product H*A: Col 1 2 3 4 Row 1: 7.32137 -1.77296 2.76159 2.17223 2: 0.222109E-15 -5.23651 -2.63115 4.12959 3: 0.239308E-15 -0.247081E-16 3.25314 1.45784 4: 0.580632E-15 0.164690E-15 -0.166533E-15 4.14107 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. 19.00 14.00 4.00 4.00 3.00 11.00 17.00 20.00 9.00 3.00 2.00 11.00 13.00 12.00 0.00 7.00 10.00 7.00 10.00 5.00 Indexed list of entries: I INDX(I) X(I) X(INDX(I)) 1 17 8.00 0.00 2 13 7.00 2.00 3 7 19.00 3.00 4 12 14.00 3.00 5 5 4.00 4.00 6 6 4.00 4.00 7 22 3.00 5.00 8 2 11.00 7.00 9 23 17.00 7.00 10 20 20.00 7.00 11 18 9.00 7.00 12 1 3.00 8.00 13 24 2.00 8.00 14 11 11.00 9.00 15 19 13.00 10.00 16 21 12.00 10.00 17 8 0.00 11.00 18 14 7.00 11.00 19 16 10.00 12.00 20 15 7.00 13.00 21 4 10.00 14.00 22 9 5.00 17.00 23 3 7.00 19.00 24 10 8.00 20.00 R8VEC_INDEX_DELETE_ALL_TEST R8VEC_INDEX_DELETE_ALL deletes all copies of a particular value. 7.00 5.00 15.00 16.00 6.00 5.00 3.00 10.00 17.00 17.00 19.00 3.00 8.00 20.00 6.00 11.00 0.00 3.00 18.00 13.00 Indexed list of entries: I INDX(I) X(I) X(INDX(I)) 1 19 8.00 0.00 2 9 7.00 3.00 3 14 7.00 3.00 4 20 5.00 3.00 5 4 15.00 5.00 6 8 16.00 5.00 7 7 6.00 6.00 8 17 5.00 6.00 9 2 3.00 7.00 10 23 10.00 7.00 11 3 17.00 7.00 12 1 17.00 8.00 13 24 19.00 8.00 14 15 3.00 8.00 15 10 8.00 10.00 16 18 20.00 11.00 17 22 6.00 13.00 18 5 11.00 15.00 19 6 0.00 16.00 20 11 3.00 17.00 21 12 18.00 17.00 22 21 13.00 18.00 23 13 7.00 19.00 24 16 8.00 20.00 Indexed list of entries: I INDX(I) X(I) X(INDX(I)) 1 17 8.00 0.00 2 7 5.00 3.00 3 12 15.00 3.00 4 18 16.00 3.00 5 2 6.00 5.00 6 6 5.00 5.00 7 5 3.00 6.00 8 15 10.00 6.00 9 1 17.00 8.00 10 21 17.00 8.00 11 13 19.00 8.00 12 8 3.00 10.00 13 16 8.00 11.00 14 20 20.00 13.00 15 3 6.00 15.00 16 4 11.00 16.00 17 9 0.00 17.00 18 10 3.00 17.00 19 19 18.00 18.00 20 11 13.00 19.00 21 14 8.00 20.00 R8VEC_INDEX_DELETE_DUPES_TEST R8VEC_INDEX_DELETE_DUPES deletes duplicates. Generate some random values: 12.00 11.00 8.00 18.00 15.00 13.00 15.00 5.00 11.00 8.00 12.00 9.00 12.00 14.00 2.00 3.00 6.00 11.00 19.00 7.00 Indexed list of entries: I INDX(I) X(I) X(INDX(I)) 1 17 8.00 2.00 2 18 7.00 3.00 3 10 12.00 5.00 4 19 11.00 6.00 5 2 8.00 7.00 6 22 18.00 7.00 7 23 15.00 7.00 8 1 13.00 8.00 9 12 15.00 8.00 10 24 5.00 8.00 11 5 11.00 8.00 12 14 8.00 9.00 13 4 12.00 11.00 14 20 9.00 11.00 15 11 12.00 11.00 16 3 14.00 12.00 17 13 2.00 12.00 18 15 3.00 12.00 19 8 6.00 13.00 20 16 11.00 14.00 21 7 19.00 15.00 22 9 7.00 15.00 23 6 7.00 18.00 24 21 8.00 19.00 Call R8VEC_INDEX_DELETE_DUPES to delete duplicates: Indexed list of unique entries: I INDX(I) X(I) 1 1 2.00 2 2 3.00 3 3 5.00 4 4 6.00 5 5 7.00 6 6 8.00 7 7 9.00 8 8 11.00 9 9 12.00 10 10 13.00 11 11 14.00 12 12 15.00 13 13 18.00 14 14 19.00 R8VEC_INDEX_DELETE_ONE_TEST R8VEC_INDEX_DELETE_ONE deletes one copies of a particular value. 20.00 17.00 4.00 11.00 7.00 14.00 4.00 14.00 8.00 18.00 12.00 2.00 19.00 19.00 8.00 16.00 9.00 14.00 12.00 12.00 Indexed list of entries: I INDX(I) X(I) X(INDX(I)) 1 14 8.00 2.00 2 5 7.00 4.00 3 9 20.00 4.00 4 2 17.00 7.00 5 23 4.00 7.00 6 7 11.00 7.00 7 1 7.00 8.00 8 17 14.00 8.00 9 11 4.00 8.00 10 24 14.00 8.00 11 19 8.00 9.00 12 6 18.00 11.00 13 13 12.00 12.00 14 22 2.00 12.00 15 21 19.00 12.00 16 8 19.00 14.00 17 20 8.00 14.00 18 10 16.00 14.00 19 18 9.00 16.00 20 4 14.00 17.00 21 12 12.00 18.00 22 15 12.00 19.00 23 16 7.00 19.00 24 3 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 13 8.00 2.00 2 5 7.00 4.00 3 9 20.00 4.00 4 2 17.00 7.00 5 22 4.00 7.00 6 7 11.00 7.00 7 1 7.00 8.00 8 16 14.00 8.00 9 23 4.00 8.00 10 18 14.00 9.00 11 6 18.00 11.00 12 12 12.00 12.00 13 21 2.00 12.00 14 20 19.00 12.00 15 8 19.00 14.00 16 19 8.00 14.00 17 10 16.00 14.00 18 17 9.00 16.00 19 4 14.00 17.00 20 11 12.00 18.00 21 14 12.00 19.00 22 15 7.00 19.00 23 3 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: 15.00 15.00 13.00 8.00 1.00 9.00 17.00 14.00 8.00 9.00 9.00 15.00 0.00 3.00 15.00 13.00 14.00 17.00 8.00 2.00 Indexed list of entries: I INDX(I) X(I) X(INDX(I)) 1 8 15.00 0.00 2 4 13.00 1.00 3 10 8.00 2.00 4 9 1.00 3.00 5 3 9.00 8.00 6 5 17.00 9.00 7 2 14.00 13.00 8 7 0.00 14.00 9 1 3.00 15.00 10 6 2.00 17.00 R8VEC_INDEX_ORDER_TEST R8VEC_INDEX_ORDER sorts an index sorted array. Generate some random values: 8.00 12.00 18.00 2.00 8.00 17.00 5.00 19.00 6.00 14.00 10.00 16.00 18.00 19.00 14.00 8.00 10.00 8.00 5.00 2.00 Indexed list of unique entries: I INDX(I) X(I) X(INDX(I)) 1 4 8.00 2.00 2 6 12.00 5.00 3 8 18.00 6.00 4 1 2.00 8.00 5 10 17.00 10.00 6 2 5.00 12.00 7 9 19.00 14.00 8 11 6.00 16.00 9 5 14.00 17.00 10 3 10.00 18.00 11 7 16.00 19.00 Now call R8VEC_INDEX_ORDER to carry out the sorting: X: 1: 2.0000000 2: 5.0000000 3: 6.0000000 4: 8.0000000 5: 10.000000 6: 12.000000 7: 14.000000 8: 16.000000 9: 17.000000 10: 18.000000 11: 19.000000 R8VEC_INDEX_SEARCH_TEST R8VEC_INDEX_SEARCH searches for an entry with a given value. Generate some random values: 9.00 6.00 16.00 1.00 8.00 10.00 4.00 8.00 4.00 4.00 16.00 0.00 18.00 16.00 8.00 6.00 13.00 18.00 4.00 2.00 Indexed list of entries: I INDX(I) X(I) X(INDX(I)) 1 8 9.00 0.00 2 4 6.00 1.00 3 11 16.00 2.00 4 7 1.00 4.00 5 2 8.00 6.00 6 5 10.00 8.00 7 1 4.00 9.00 8 6 0.00 10.00 9 10 18.00 13.00 10 3 13.00 16.00 11 9 2.00 18.00 Results of search for given XVAL: XVAL Less Equal More 0.00 0 1 2 1.00 1 2 3 2.00 2 3 4 3.00 3 0 4 4.00 3 4 5 5.00 4 0 5 6.00 4 5 6 7.00 5 0 6 8.00 5 6 7 9.00 6 7 8 10.00 7 8 9 11.00 8 0 9 12.00 8 0 9 13.00 8 9 10 14.00 9 0 10 15.00 9 0 10 16.00 9 10 11 17.00 10 0 11 18.00 10 11 12 19.00 11 0 12 20.00 11 0 12 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.97826215 2: 0.63156499 3: 0.87908976 4: 0.56762227 5: 0.49829435E-01 6: 0.58989913 7: 0.88632060E-01 8: 0.50141705 9: 0.53225759 10: 0.62626205 11: 0.76578673 12: 0.38701997 13: 0.70027992 14: 0.64728080 15: 0.77866020 16: 0.33367132 17: 0.81056114 18: 0.16149819 19: 0.24333643 20: 0.79936152 I INDX R(INDX(I)) 1 5 0.498294E-01 2 7 0.886321E-01 3 18 0.161498 4 19 0.243336 5 16 0.333671 6 12 0.387020 7 8 0.501417 8 9 0.532258 9 4 0.567622 10 6 0.589899 11 10 0.626262 12 2 0.631565 13 14 0.647281 14 13 0.700280 15 11 0.765787 16 15 0.778660 17 20 0.799362 18 17 0.810561 19 3 0.879090 20 1 0.978262 R_LO 0.488806 7 8 0.501417 8 9 0.532258 9 4 0.567622 10 6 0.589899 11 10 0.626262 12 2 0.631565 13 14 0.647281 R_HI 0.688382 Array 1: 0.92030700 2: 0.32017892 3: 0.32451775 4: 0.69925547 5: 0.87482300 6: 0.55354487 7: 0.62114776 8: 0.72825709 9: 0.33045079 10: 0.41176403 11: 0.54067041 12: 0.89449755 13: 0.75046610 14: 0.21380582 15: 0.25187750 16: 0.68049421 17: 0.10890778 18: 0.78931260 19: 0.44566160 20: 0.29092792 I INDX R(INDX(I)) 1 17 0.108908 2 14 0.213806 3 15 0.251878 4 20 0.290928 5 2 0.320179 6 3 0.324518 7 9 0.330451 8 10 0.411764 9 19 0.445662 10 11 0.540670 11 6 0.553545 12 7 0.621148 13 16 0.680494 14 4 0.699255 15 8 0.728257 16 13 0.750466 17 18 0.789313 18 5 0.874823 19 12 0.894498 20 1 0.920307 R_LO 0.680506E-01 1 17 0.108908 2 14 0.213806 3 15 0.251878 4 20 0.290928 5 2 0.320179 6 3 0.324518 7 9 0.330451 8 10 0.411764 9 19 0.445662 10 11 0.540670 11 6 0.553545 R_HI 0.588195 Array 1: 0.78670244 2: 0.74343292 3: 0.87959652 4: 0.85050401E-02 5: 0.64877064 6: 0.32991461 7: 0.49273516 8: 0.76809745 9: 0.94625766 10: 0.80292242 11: 0.67585584 12: 0.87222513 13: 0.57021450 14: 0.97398380 15: 0.52189547 16: 0.38258196 17: 0.57262330 18: 0.42751251E-01 19: 0.19258824 20: 0.13281445 I INDX R(INDX(I)) 1 4 0.850504E-02 2 18 0.427513E-01 3 20 0.132814 4 19 0.192588 5 6 0.329915 6 16 0.382582 7 7 0.492735 8 15 0.521895 9 13 0.570214 10 17 0.572623 11 5 0.648771 12 11 0.675856 13 2 0.743433 14 8 0.768097 15 1 0.786702 16 10 0.802922 17 12 0.872225 18 3 0.879597 19 9 0.946258 20 14 0.973984 R_LO 0.313314 R_HI 0.321021 Empty range in R. Array 1: 0.64185370 2: 0.28249528E-01 3: 0.80808911 4: 0.68517442 5: 0.85252418 6: 0.24726695 7: 0.32740979 8: 0.78458501 9: 0.25861711 10: 0.83303860 11: 0.61741903 12: 0.22404362 13: 0.93004811 14: 0.33297153 15: 0.83309978 16: 0.89871542 17: 0.41061397 18: 0.91082199 19: 0.93956512 20: 0.56815012 I INDX R(INDX(I)) 1 2 0.282495E-01 2 12 0.224044 3 6 0.247267 4 9 0.258617 5 7 0.327410 6 14 0.332972 7 17 0.410614 8 20 0.568150 9 11 0.617419 10 1 0.641854 11 4 0.685174 12 8 0.784585 13 3 0.808089 14 10 0.833039 15 15 0.833100 16 5 0.852524 17 16 0.898715 18 18 0.910822 19 13 0.930048 20 19 0.939565 R_LO 0.550276E-01 2 12 0.224044 3 6 0.247267 4 9 0.258617 5 7 0.327410 6 14 0.332972 7 17 0.410614 8 20 0.568150 9 11 0.617419 10 1 0.641854 11 4 0.685174 12 8 0.784585 13 3 0.808089 R_HI 0.827570 Array 1: 0.44852401 2: 0.53090038 3: 0.48088182E-01 4: 0.88567188 5: 0.84203486 6: 0.81543655 7: 0.28103726 8: 0.77365172 9: 0.16456185 10: 0.73599173 11: 0.18564887 12: 0.93834374E-01 13: 0.88399584 14: 0.87327625 15: 0.66110493 16: 0.63035021 17: 0.65360978 18: 0.62501961 19: 0.42118827E-01 20: 0.89222505 I INDX R(INDX(I)) 1 19 0.421188E-01 2 3 0.480882E-01 3 12 0.938344E-01 4 9 0.164562 5 11 0.185649 6 7 0.281037 7 1 0.448524 8 2 0.530900 9 18 0.625020 10 16 0.630350 11 17 0.653610 12 15 0.661105 13 10 0.735992 14 8 0.773652 15 6 0.815437 16 5 0.842035 17 14 0.873276 18 13 0.883996 19 4 0.885672 20 20 0.892225 R_LO 0.544132 9 18 0.625020 10 16 0.630350 11 17 0.653610 12 15 0.661105 13 10 0.735992 14 8 0.773652 15 6 0.815437 16 5 0.842035 17 14 0.873276 R_HI 0.876155 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: -0.14640829 2: 5.9244251 3: -8.8010770 4: -4.8579649 5: -2.5630619 6: 4.5140476 7: 8.5398654 8: -8.9895992 9: 9.6869274 10: -2.6524732 Maximum: 9.68693 R8VEC_MAX_ABS_INDEX_TEST R8VEC_MAX_ABS_INDEX: index of entry of maximum absolute value; Input vector: 1: 3.4927376 2: -3.4003227 3: -1.7276504 4: 4.9039559 5: 5.8488111 6: -3.7126385 7: -2.4766437 8: 3.2307772 9: 6.9523707 10: -1.0052267 Index of entry of maximum absolute value: 9 R8VEC_MAX_INDEX_TEST For a R8VEC: R8VEC_MAX_INDEX: index of maximum entry; Input vector: 1: 2.5439843 2: 4.2699709 3: 0.75677742 4: 9.8871706 5: 1.5215626 6: -9.4017595 7: -6.2824111 8: -8.6491505 9: -1.9876552 10: 9.8380849 Maximum index: 4 R8VEC_MEAN_TEST For a R8VEC: R8VEC_MEAN: mean value; Input vector: 1: -7.5171749 2: 4.9376911 3: 1.0930091 4: 9.0794790 5: 6.2459251 6: 1.0452394 7: 2.3635758 8: 7.8312352 9: 9.1191217 10: -2.3877630 Mean: 3.18103 R8VEC_MEAN_GEOMETRIC_TEST R8VEC_MEAN_GEOMETRIC computes the geometric mean of an R8VEC. Input vector: 1: 3.4773261 2: 3.4023597 3: 1.7845900 4: 2.1687459 5: 1.6745528 6: 4.4920305 7: 0.72264793E-02 8: 4.7847638 9: 1.6008580 10: 0.89389235 Geometric mean: 1.32787 R8VEC_MEAN_RUNNING_TEST R8VEC_MEAN_RUNNING returns the running averages of an R8VEC. Random R8VEC: 1: 9.6633152 2: 1.9234569 3: -3.2256085 4: -3.9399216 5: 0.71871470 6: -2.8636238 7: 3.5500906 8: -1.7905507 9: 5.4231390 10: 0.19418875 Running averages: 1: 0.0000000 2: 9.6633152 3: 5.7933860 4: 2.7870545 5: 1.1053105 6: 1.0279913 7: 0.37938881 8: 0.83234622 9: 0.50448410 10: 1.0510013 11: 0.96532006 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.570341 0.570341 0.570341 2 0.740473 0.655407 0.655407 3 0.764716E-01 0.462428 0.462428 4 0.471919 0.464801 0.464801 5 0.341411 0.440123 0.440123 6 0.411060 0.435279 0.435279 7 0.823867E-01 0.384866 0.384866 8 0.274892 0.371119 0.371119 9 0.284408 0.361485 0.361485 10 0.965686E-01 0.334993 0.334993 R8VEC_MEDIAN_TEST For a R8VEC: R8VEC_MEDIAN: median value; Input vector: 1: -5.7541821 2: -6.2005925 3: -5.8892165 4: -5.8899548 5: -4.4611427 6: -1.2109872 7: 3.9844322 8: 8.9027718 9: 4.9385029 10: -3.9617226 Median: -4.46114 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: -5.4440033 2: 1.5533357 3: 0.72896331 4: -4.3668049 5: 8.4778940 6: -1.2515784 7: -1.5682900 8: -1.7069317 9: -7.0649475 10: -6.7967536 Minimum: -7.06495 R8VEC_MIN_INDEX_TEST For a R8VEC: R8VEC_MIN_INDEX: index of minimum entry; Input vector: 1: -9.7590643 2: 8.7511872 3: -2.4185664 4: -2.7752617 5: -8.5388761 6: -8.0043894 7: -7.8228846 8: 2.6368912 9: -9.0583502 10: 6.4092461 Minimum index: 1 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: 1.3654658 2: -3.8247662 3: -4.3382157 4: -4.4508055 5: -0.85143870 Rounded vector A: 1: 1.0000000 2: -4.0000000 3: -4.0000000 4: -4.0000000 5: -1.0000000 R8VEC_NORM_TEST R8VEC_NORM computes the L2 norm of an R8VEC. Vector X: 1: 9.3847517 2: 7.0429805 3: -4.6595404 4: 1.5423245 5: -2.6682314 R8VEC_NORM ( X ) = 12.9956 R8VEC_NORM_AFFINE_TEST R8VEC_NORM_AFFINE computes the L2 norm of the difference of two R8VECs. R8VEC_NORM_AFFINE(X,Y) = 16.9685 R8VEC_NORM (X-Y): 16.9685 R8VEC_NORM_L0_TEST R8VEC_NORM_L0 computes the L0 "norm" of an R8VEC. Input vector: 1: 0.0000000 2: 2.0000000 3: 1.0000000 4: 2.0000000 5: 1.0000000 6: -1.0000000 7: -1.0000000 8: 1.0000000 9: 2.0000000 10: 0.0000000 L0 norm: 8.00000 R8VEC_NORM_L1_TEST R8VEC_NORM_L1 computes the L1 norm of an R8VEC. Input vector: 1: -7.5876352 2: 7.0056376 3: -4.7613876 4: 7.0039403 5: 8.1681678 6: 6.7000763 7: -2.5051590 8: 3.3293538 9: -2.2171284 10: -1.3526556 L1 norm: 50.6311 R8VEC_NORM_L2_TEST R8VEC_NORM_L2 computes the L2 norm of an R8VEC. Input vector: 1: 9.1935089 2: -4.1050796 3: -7.8699315 4: 8.1070746 5: 8.2874672 6: -8.1615679 7: -2.8825836 8: -7.4912709 9: -0.91404525 10: -2.5271349 L2 norm: 20.8800 R8VEC_NORM_LI_TEST R8VEC_NORM_LI computes the Loo norm of an R8VEC. Input vector: 1: -5.7663346 2: 0.34816288 3: -5.3543554 4: 5.8154076 5: 3.9653307 6: 0.45342325 7: -2.0449938 8: -4.6741041 9: 3.2491823 10: 6.9627143 L-Infinity norm: 6.96271 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: 14.761088 2: 15.204016 3: 15.053665 4: 14.832523 5: 14.581909 6: 15.171104 7: 14.822367 8: 15.197347 9: 15.205936 10: 14.619877 R8VEC_NORMALIZE_L1_TEST For a R8VEC: R8VEC_NORMALIZE_L1: make unit sum; Input vector: 1: 8.4914225 2: 9.9373016 3: 2.1514905 4: 7.7602361 5: -7.9705334 6: 6.8771555 7: 9.2400781 8: 2.0628225 9: -4.8714130 10: -8.5876931 After calling R8VEC_NORMALIZE_L1: 1: 0.33842682 2: 0.39605253 3: 0.85747953E-01 4: 0.30928528 5: -0.31766671 6: 0.27408999 7: 0.36826459 8: 0.82214077E-01 9: -0.19415084 10: -0.34226370 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: 104.00000 2: 110.00000 3: 106.00000 4: 105.00000 5: 108.00000 6: 103.00000 7: 109.00000 8: 107.00000 9: 102.00000 10: 101.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: -4.3412695 2: 7.1360652 3: 10.931470 4: 11.759467 5: 6.3029669 6: 14.946346 7: -1.1948955 8: -0.33747480 9: 6.3291929 10: -2.7264516 mean(X) = 4.88054 std(X) = 6.33648 max(X) = 14.9463 min(X) = -4.34127 Vector XS: 1: 0.0000000 2: 0.59506238 3: 0.79184172 4: 0.83477070 5: 0.55186895 6: 1.0000000 7: 0.16312923 8: 0.20758370 9: 0.55322868 10: 0.83723042E-01 mean(XS) = 0.478121 std(XS) = 0.328526 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: 6.6670905 2: 14.914901 3: 13.968347 4: -2.4514979 5: 11.213135 6: 11.631076 7: 12.993098 8: 12.071397 9: 7.0969438 10: 8.7971853 mean(X) = 9.69017 std(X) = 4.82025 max(X) = 14.9149 min(X) = -2.45150 Using interval [ -1.00000 , 1.00000 ] Vector XS: 1: 0.50141563E-01 2: 1.0000000 3: 0.89099020 4: -1.0000000 5: 0.57368645 6: 0.62181860 7: 0.77867574 8: 0.67252814 9: 0.99645585E-01 10: 0.29545376 mean(XS) = 0.398294 std(XS) = 0.555124 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.39059442E-01 2: 0.18430303 3: 0.20901489 4: 0.31107716 5: 0.37408882 6: 0.39134693 7: 0.40147295 8: 0.70720406 9: 0.92534513 10: 0.92713625 Search the array for the value 0.311077 SEARCH RESULT: The value occurs in index 4 r8vec_shift_circular_test(): r8vec_shift_circular() performs a circular shift of K positions on an R8VEC. Original vector A: 1.0 2.0 3.0 4.0 5.0 K: 1 2 3 4 5 -2 3.0 4.0 5.0 1.0 2.0 -1 2.0 3.0 4.0 5.0 1.0 0 1.0 2.0 3.0 4.0 5.0 1 5.0 1.0 2.0 3.0 4.0 2 4.0 5.0 1.0 2.0 3.0 3 3.0 4.0 5.0 1.0 2.0 r8vec_sign3_running_test(): r8vec_sign3_running() returns the running sign3 of an R8VEC. Random R8VEC: 1: -3.4979890 2: 3.8445354 3: -3.7133696 4: 1.0988751 5: 0.41308800 6: 2.2760656 7: 1.9151977 8: -1.9163808 9: 7.8393674 10: 3.3734337 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 -3.54857 0.443305E-04 2 -2.11478 0.185948E-03 3 -3.24988 0.597619E-04 4 -1.33626 0.405039E-03 5 0.327868 0.213904E-02 6 0.119315 0.173639E-02 7 4.98957 0.226345 8 -0.806992 0.687632E-03 9 6.21179 0.768380 10 -4.47860 0.174904E-04 r8vec_sort_bubble_a_test() r8vec_sort_bubble_a() ascending sorts a R8VEC. Original array: 1: 58.012011 2: 3.1627039 3: 55.100964 4: 53.173843 5: 50.766628 6: 21.936280 7: 2.1421085 8: 0.27401241 9: 56.634867 10: 37.822018 Ascending sorted array: 1: 0.27401241 2: 2.1421085 3: 3.1627039 4: 8.4686019 5: 10.368946 6: 13.811345 7: 15.959442 8: 21.508182 9: 21.936280 10: 23.597992 R8VEC_SORT_HEAP_A_TEST R8VEC_SORT_HEAP_A ascending sorts a R8VEC. Original array: 1: 55.265414 2: 41.239423 3: 7.4890725 4: 26.820363 5: 10.982491 6: 28.857148 7: 40.680246 8: 28.937791 9: 59.911849 10: 49.521129 Ascending sorted array: 1: 6.8490187 2: 7.4890725 3: 9.6577072 4: 9.7707403 5: 10.982491 6: 12.425427 7: 23.713220 8: 26.820363 9: 27.097980 10: 28.857148 R8VEC_SORT_HEAP_D_TEST R8VEC_SORT_HEAP_D descending sorts a R8VEC. Original array: 1: 49.514080 2: 58.836210 3: 52.539414 4: 14.505342 5: 38.570109 6: 28.636415 7: 49.286955 8: 46.736714 9: 33.202294 10: 16.303984 Descending sorted array: 1: 58.836210 2: 53.146160 3: 52.539414 4: 51.931481 5: 49.514080 6: 49.286955 7: 46.736714 8: 38.570109 9: 33.202294 10: 33.002356 R8VEC_SORT_HEAP_INDEX_A_TEST R8VEC_SORT_HEAP_INDEX_A creates an ascending sort index for a R8VEC. Unsorted array: 1: 34.919246 2: 43.153894 3: 6.2392189 4: 45.069127 5: 6.0310778 6: 24.507825 7: 11.652560 8: 36.615788 9: 29.663618 10: 1.2207193 After indexed ascending sort: I, INDX(I), A(I) 1 10 34.9192 2 5 43.1539 3 3 6.23922 4 12 45.0691 5 7 6.03108 6 15 24.5078 7 20 11.6526 8 6 36.6158 9 18 29.6636 10 9 1.22072 11 1 42.2764 12 13 8.82243 13 8 36.5940 14 17 43.7194 15 11 18.7240 16 2 44.9386 17 14 38.8974 18 16 28.1077 19 4 48.4536 20 19 19.1668 Now use the index array to carry out the permutation implicitly. INDX(I), A(INDX(I)) 10 1.22072 5 6.03108 3 6.23922 12 8.82243 7 11.6526 15 18.7240 20 19.1668 6 24.5078 18 28.1077 9 29.6636 1 34.9192 13 36.5940 8 36.6158 17 38.8974 11 42.2764 2 43.1539 14 43.7194 16 44.9386 4 45.0691 19 48.4536 Call R8VEC_PERMUTE to carry out the permutation explicitly. I, A(I) 1: 1.2207193 2: 6.0310778 3: 6.2392189 4: 8.8224256 5: 11.652560 6: 18.723982 7: 19.166847 8: 24.507825 9: 28.107693 10: 29.663618 11: 34.919246 12: 36.593973 13: 36.615788 14: 38.897399 15: 42.276419 16: 43.153894 17: 43.719425 18: 44.938618 19: 45.069127 20: 48.453557 R8VEC_SORT_HEAP_INDEX_D_TEST R8VEC_SORT_HEAP_INDEX_D creates a descending sort index for a R8VEC. Unsorted array: 1: 27.333058 2: 50.364939 3: 35.412909 4: 15.703172 5: 27.480434 6: 37.880784 7: 49.554523 8: 35.788006 9: 52.129782 10: 50.740828 After indexed descending sort: I, INDX(I), A(I) 1 9 27.3331 2 20 50.3649 3 10 35.4129 4 2 15.7032 5 7 27.4804 6 13 37.8808 7 19 49.5545 8 16 35.7880 9 17 52.1298 10 15 50.7408 11 6 1.95668 12 8 20.2099 13 3 48.4191 14 14 33.7471 15 5 42.4941 16 1 47.7825 17 18 43.6424 18 12 24.6773 19 4 47.9681 20 11 50.8560 Now use the index array to carry out the permutation implicitly. INDX(I), ARRAY(INDX(I)) 9 52.1298 20 50.8560 10 50.7408 2 50.3649 7 49.5545 13 48.4191 19 47.9681 16 47.7825 17 43.6424 15 42.4941 6 37.8808 8 35.7880 3 35.4129 14 33.7471 5 27.4804 1 27.3331 18 24.6773 12 20.2099 4 15.7032 11 1.95668 R8VEC_SORT_HEAP_MASK_A_TEST R8VEC_SORT_HEAP_MASK_A creates an ascending sort index for a masked R8VEC. Unsorted array: 1: 39.463778 2: 12.761318 3: 28.617727 4: 37.093984 5: 36.149638 6: 24.401681 7: 24.395787 8: 36.172450 9: 23.148781 10: 20.440534 11: 48.324323 12: 47.619091 13: 14.168373 14: 23.030723 15: 7.7053326 16: 0.77066567 17: 1.2222290 18: 33.041887 19: 43.884953 20: 57.427474 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 12.7613 2: 4 37.0940 3: 7 24.3958 4: 8 36.1725 5: 9 23.1488 6: 12 47.6191 7: 13 14.1684 8: 16 0.770666 9: 18 33.0419 10: 19 43.8850 After masked indexed ascending sort: I, INDX(I), MASK(INDX(I)), A(MASK(INDX(I))) 1 8 16 0.770666 2 1 2 12.7613 3 7 13 14.1684 4 5 9 23.1488 5 3 7 24.3958 6 9 18 33.0419 7 4 8 36.1725 8 2 4 37.0940 9 10 19 43.8850 10 6 12 47.6191 Call I4VEC_PERMUTE to carry out the index permutation explicitly on the MASK vector. The reordered mask array: 1: 16 2: 2 3: 13 4: 9 5: 7 6: 18 7: 8 8: 4 9: 19 10: 12 Masked vector printout: The reordered masked sorted array: 1: 16 0.770666 2: 2 12.7613 3: 13 14.1684 4: 9 23.1488 5: 7 24.3958 6: 18 33.0419 7: 8 36.1725 8: 4 37.0940 9: 19 43.8850 10: 12 47.6191 R8VEC_SORT_INSERT_A_TEST R8VEC_SORT_INSERT_A ascending sorts a R8VEC. Unsorted array: 1: 57.335232 2: 54.129920 3: 48.117855 4: 53.855919 5: 55.422451 6: 58.173359 7: 37.674992 8: 50.310069 9: 11.370148 10: 28.664261 Sorted array: 1: 2.4278574 2: 3.0214498 3: 3.7075961 4: 11.287564 5: 11.370148 6: 20.100297 7: 28.664261 8: 32.170367 9: 33.275481 10: 35.031047 R8VEC_SORT_INSERT_INDEX_A_TEST R8VEC_SORT_INSERT_INDEX_A creates an ascending sort index for a R8VEC. Unsorted array: 1: 55.706983 2: 59.690156 3: 0.86340354 4: 57.330188 5: 13.315751 6: 53.225418 7: 1.1235946 8: 48.279288 9: 7.8440950 10: 29.330402 After indexed ascending sort: I, INDX(I), A(I) 1 3 55.7070 2 7 59.6902 3 9 0.863404 4 17 57.3302 5 12 13.3158 6 5 53.2254 7 20 1.12359 8 14 48.2793 9 10 7.84410 10 11 29.3304 11 18 32.9091 12 15 10.5164 13 13 45.4790 14 16 28.3207 15 8 42.8653 16 19 48.2001 17 6 8.71064 18 1 41.3238 19 4 49.2495 20 2 28.3203 Now use the index array to carry out the permutation implicitly. I, INDX(I), A(INDX(I)) 1 3 0.863404 2 7 1.12359 3 9 7.84410 4 17 8.71064 5 12 10.5164 6 5 13.3158 7 20 28.3203 8 14 28.3207 9 10 29.3304 10 11 32.9091 11 18 41.3238 12 15 42.8653 13 13 45.4790 14 16 48.2001 15 8 48.2793 16 19 49.2495 17 6 53.2254 18 1 55.7070 19 4 57.3302 20 2 59.6902 Call R8VEC_PERMUTE to carry out the permutation explicitly. Permuted data 1: 0.86340354 2: 1.1235946 3: 7.8440950 4: 8.7106354 5: 10.516445 6: 13.315751 7: 28.320308 8: 28.320740 9: 29.330402 10: 32.909133 R8VEC_SORT_QUICK_A_TEST R8VEC_SORT_QUICK_A sorts a R8VEC using quick sort. Unsorted array: 1: 3.4906496 2: 8.3728906 3: 2.4936331 4: 2.4635101 5: 7.7261951 6: 2.3116499 7: 4.7483590 8: 4.4074864 9: 5.8542889 10: 4.8817187 11: 2.8213522 12: 7.9045966 13: 1.4724976 14: 3.4546369 15: 5.3917021 16: 2.4485970 17: 8.6702042 18: 3.5398054 19: 0.74203395 20: 9.8181721 Sorted array: 1: 0.74203395 2: 1.4724976 3: 2.3116499 4: 2.4485970 5: 2.4635101 6: 2.4936331 7: 2.8213522 8: 3.4546369 9: 3.4906496 10: 3.5398054 11: 4.4074864 12: 4.7483590 13: 4.8817187 14: 5.3917021 15: 5.8542889 16: 7.7261951 17: 7.9045966 18: 8.3728906 19: 8.6702042 20: 9.8181721 R8VEC_SORTED_MERGE_A_TEST For ascending order: R8VEC_SORTED_MERGE_A merges two sorted R8VEC's; Sorted vector A: 1: 0.19127251 2: 0.32036311 3: 0.37886977 4: 0.43487903 5: 0.49399848 6: 0.62169678 7: 0.73349406 8: 0.82106717 9: 0.85813741 10: 0.93575606 Sorted vector B: 1: 0.97016313E-01 2: 0.13966178 3: 0.28581571 4: 0.40259845 5: 0.49586153 6: 0.71578399 7: 0.76347571 8: 0.80498481 9: 0.92523848 10: 0.95770333 Merged vector C: 1: 0.97016313E-01 2: 0.13966178 3: 0.19127251 4: 0.28581571 5: 0.32036311 6: 0.37886977 7: 0.40259845 8: 0.43487903 9: 0.49399848 10: 0.49586153 11: 0.62169678 12: 0.71578399 13: 0.73349406 14: 0.76347571 15: 0.80498481 16: 0.82106717 17: 0.85813741 18: 0.92523848 19: 0.93575606 20: 0.95770333 R8VEC_SORTED_NEAREST_TEST R8VEC_SORTED_NEAREST finds the nearest entry in a sorted R8VEC. Sorted array: 1: 0.79598493 2: 1.3445036 3: 3.5219403 4: 3.8887887 5: 4.0657494 6: 4.7919548 7: 5.7449962 8: 6.1197224 9: 6.5251407 10: 9.1661759 Test Nearest Value Index Value 4.2557 5 4.0657 6.2819 8 6.1197 7.7945 9 6.5251 8.8162 10 9.1662 0.7803 1 0.7960 8.1484 10 9.1662 2.1920 2 1.3445 1.3353 2 1.3445 6.3735 9 6.5251 1.0180 1 0.7960 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.11207215 2: 0.12435200 3: 0.18830076 4: 0.36703657 5: 0.44190247 6: 0.50782022 7: 0.69338931 8: 0.73792356 9: 0.84132770 10: 0.88309898 R_LO 0.657903 7 0.693389 8 0.737924 9 0.841328 10 0.883099 R_HI 0.924407 Sorted array R: 1: 0.66158034E-01 2: 0.96103759E-01 3: 0.25321088 4: 0.29548354 5: 0.31006278 6: 0.37069238 7: 0.41408798 8: 0.56591703 9: 0.84954428 10: 0.99393077 R_LO 0.134135 3 0.253211 4 0.295484 5 0.310063 6 0.370692 7 0.414088 8 0.565917 R_HI 0.828377 Sorted array R: 1: 0.11347523 2: 0.22364412 3: 0.22742938 4: 0.37491391 5: 0.44962093 6: 0.47170354 7: 0.48582688 8: 0.49139231 9: 0.51583800 10: 0.58725300 R_LO 0.266012 4 0.374914 5 0.449621 6 0.471704 7 0.485827 8 0.491392 9 0.515838 10 0.587253 R_HI 0.691030 Sorted array R: 1: 0.29763907E-01 2: 0.50008717E-01 3: 0.23651750 4: 0.41650624 5: 0.43914761 6: 0.46605739 7: 0.51928499 8: 0.63765680 9: 0.91941758 10: 0.97179631 R_LO 0.396576 4 0.416506 5 0.439148 6 0.466057 R_HI 0.499886 Sorted array R: 1: 0.77402360E-01 2: 0.97632887E-01 3: 0.16340147 4: 0.21180948 5: 0.22119670 6: 0.24837518 7: 0.64362937 8: 0.71527048 9: 0.73918150 10: 0.75731298 R_LO 0.664157 8 0.715270 9 0.739182 10 0.757313 R_HI 0.886356 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.50000000 2: 1.0000000 3: 1.0000000 4: 1.5000000 5: 1.5000000 6: 1.5000000 7: 1.5000000 8: 1.5000000 9: 1.5000000 10: 2.0000000 11: 2.5000000 12: 2.5000000 13: 2.5000000 14: 3.0000000 15: 3.0000000 16: 3.0000000 17: 3.5000000 18: 3.5000000 19: 3.5000000 20: 3.5000000 21: 4.0000000 22: 4.0000000 23: 4.5000000 24: 4.5000000 25: 5.0000000 Splitting value is 2.75000 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: 14.000000 2: 22.000000 3: 11.000000 4: 25.000000 5: 10.000000 6: 13.000000 7: 3.0000000 8: 8.0000000 9: 12.000000 10: 0.0000000 Unique entries 1: 0.0000000 2: 3.0000000 3: 5.0000000 4: 7.0000000 5: 8.0000000 6: 10.000000 7: 11.000000 8: 12.000000 9: 13.000000 10: 14.000000 11: 15.000000 12: 16.000000 13: 19.000000 14: 20.000000 15: 21.000000 16: 22.000000 17: 23.000000 18: 24.000000 19: 25.000000 20: 26.000000 21: 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: 6.5000000 2: 18.500000 3: 27.500000 4: 25.500000 5: 18.500000 6: 17.500000 7: 9.5000000 8: 15.500000 9: 16.500000 10: 28.500000 11: 22.500000 12: 10.500000 13: 9.5000000 14: 19.500000 15: 23.500000 16: 11.500000 17: 27.500000 18: 22.500000 19: 22.500000 20: 25.500000 21: 27.500000 22: 29.500000 23: 22.500000 24: 7.5000000 25: 24.500000 26: 17.500000 27: 10.500000 28: 11.500000 29: 5.5000000 30: 25.500000 Ascending sorted array: 1: 5.5000000 2: 6.5000000 3: 7.5000000 4: 9.5000000 5: 9.5000000 6: 10.500000 7: 10.500000 8: 11.500000 9: 11.500000 10: 15.500000 11: 16.500000 12: 17.500000 13: 17.500000 14: 18.500000 15: 18.500000 16: 19.500000 17: 22.500000 18: 22.500000 19: 22.500000 20: 22.500000 21: 23.500000 22: 24.500000 23: 25.500000 24: 25.500000 25: 25.500000 26: 27.500000 27: 27.500000 28: 27.500000 29: 28.500000 30: 29.500000 R8VEC_SORTED_UNIQUE_HIST counts 18 unique entries. Value Multiplicity 1 5.50000 1 2 6.50000 1 3 7.50000 1 4 9.50000 2 5 10.5000 2 6 11.5000 2 7 15.5000 1 8 16.5000 1 9 17.5000 2 10 18.5000 2 11 19.5000 1 12 22.5000 4 13 23.5000 1 14 24.5000 1 15 25.5000 3 16 27.5000 3 17 28.5000 1 18 29.5000 1 R8VEC_SPLIT_TEST R8VEC SPLIT splits an R8VEC into entries less than and greater than a splitting value. The array: 1: 4.5000000 2: 5.0000000 3: 0.50000000 4: 4.5000000 5: 3.5000000 6: 1.0000000 7: 3.0000000 8: 1.0000000 9: 4.0000000 10: 3.5000000 11: 2.0000000 12: 2.0000000 13: 4.0000000 14: 2.0000000 15: 1.5000000 16: 3.5000000 17: 4.0000000 18: 1.5000000 19: 3.5000000 20: 1.0000000 21: 1.5000000 22: 3.0000000 23: 5.0000000 24: 2.0000000 25: 2.0000000 Splitting value is 3.25000 The split array: 1: 2.0000000 2: 2.0000000 3: 0.50000000 4: 3.0000000 5: 1.5000000 6: 1.0000000 7: 3.0000000 8: 1.0000000 9: 1.0000000 10: 1.5000000 11: 2.0000000 12: 2.0000000 13: 1.5000000 14: 2.0000000 15: 3.5000000 16: 4.0000000 17: 4.0000000 18: 3.5000000 19: 3.5000000 20: 4.0000000 21: 3.5000000 22: 5.0000000 23: 4.5000000 24: 5.0000000 25: 4.5000000 Array entries <= SPLIT up to index 14 R8VEC_STANDARDIZE_TEST R8VEC_STANDARDIZE shifts and scales an R8VEC so that it has zero mean and unit standard deviation. Vector X: 1: 0.24788192 2: 6.0221002 3: 2.3868636 4: -3.0406115 5: -3.6848634 6: -4.2159266 7: 12.995586 8: 4.1873143 9: 3.3186727 10: -4.3391948 mean(X) = 1.38778 std(X) = 5.57398 max(X) = 12.9956 min(X) = -4.33919 Vector XS: 1: -0.20450377 2: 0.83141958 3: 0.17924013 4: -0.79447577 5: -0.91005774 6: -1.0053331 7: 2.0824975 8: 0.50224990 9: 0.34641130 10: -1.0274480 mean(XS) = 0.444089E-16 std(XS) = 1.00000 max(XS) = 2.08250 min(XS) = -1.02745 r8vec_std_test(): r8vec_std() computes the standard deviation of an R8VEC. Vector: 1: -1.9019861 2: 2.8743907 3: 3.0687418 4: -3.5776234 5: 0.57085696 6: 0.90847931 7: -4.3758631 8: 2.0338634 9: 1.5741044 10: -3.1423939 STD: 2.65514 r8vec_std_sample_test(0 r8vec_std_sample() computes the sample standard deviation of an R8VEC. Vector: 1: -4.9094405 2: 2.0671126 3: 3.7820107 4: -2.3858065 5: -1.6121592 6: 1.8804619 7: 0.66536134 8: 2.9395795 9: -3.4110849 10: 3.8806673 STD: 3.15253 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.720061 0.00000 0.00000 2 0.788439 0.483502E-01 0.483502E-01 3 0.211739 0.315079 0.315079 4 0.982090 0.328538 0.328538 5 0.499985 0.295161 0.295161 6 0.614360 0.264215 0.264215 7 0.893266 0.260041 0.260041 8 0.819630 0.246281 0.246281 9 0.164078E-01 0.321972 0.321972 10 0.445941 0.308297 0.308297 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.888139E-01 0.00000 0.00000 2 0.809534 0.360360 0.360360 3 0.730941 0.322825 0.322825 4 0.842051E-01 0.342995 0.342995 5 0.185156 0.321841 0.321841 6 0.753818 0.325199 0.325199 7 0.466379 0.301195 0.301195 8 0.249289 0.289122 0.289122 9 0.524076 0.274505 0.274505 10 0.322163E-02 0.290517 0.290517 R8VEC_SUM_TEST R8VEC_SUM computes the sum of an R8VEC. Input vector: 1: -2.4738002 2: 3.1442661 3: 7.4549812 4: -4.8611179 5: -8.8184423 6: 4.5597181 7: 2.3360190 8: -6.0348294 9: 8.1639033 10: 4.8743587 SUM: 8.34506 R8VEC_SUM_RUNNING_TEST R8VEC_SUM_RUNNING eturns the running sums of an R8VEC. R8VEC: 1: 9.4204771 2: 1.2247198 3: -0.86323479 4: 6.1324674 5: -1.9126457 6: -2.2890453 7: -3.5715528 8: 4.3909275 9: -4.0294977 10: -2.8037538 Running sums: 1: 0.0000000 2: 9.4204771 3: 10.645197 4: 9.7819621 5: 15.914429 6: 14.001784 7: 11.712738 8: 8.1411856 9: 12.532113 10: 8.5026154 11: 5.6988617 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.72607532E-01 2: 0.77281091 3: 0.89460107E-01 4: 0.84943725 5: 0.58599323E-01 6: 0.86160054 7: 0.78648632 8: 0.70956735E-01 9: 0.28046497 10: 0.59841998 11: 0.12727879 12: 0.96763942 13: 0.97610436 14: 0.97141378 15: 0.77422986 16: 0.36638864 17: 0.19332779 18: 0.50327745 19: 0.28886007E-02 20: 0.38403544 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: 16.538156 2: 18.884169 3: 14.820803 4: 13.986313 5: 14.823386 6: 11.105010 7: 19.832062 8: 13.217771 9: 19.157375 10: 11.448798 Random R8VEC: 1: 13.164663 2: 13.518723 3: 16.189627 4: 16.622722 5: 11.296581 6: 13.489641 7: 16.446548 8: 14.842770 9: 10.606668 10: 10.027367 Random R8VEC: 1: 11.944694 2: 11.225463 3: 16.335707 4: 14.423406 5: 12.237823 6: 12.258323 7: 17.290777 8: 12.693494 9: 13.529287 10: 16.675221 R8VEC_UNIFORM_UNIT_TEST R8VEC_UNIFORM_UNIT returns a random point on the surface of the unit M sphere. Random unit vector: 1: 0.60776492 2: 0.87089040E-01 3: 0.87191836E-01 4: 0.60834360 5: -0.49533115 Random unit vector: 1: 0.18773878 2: 0.88305749 3: 0.20714626 4: 0.34860621 5: -0.14327510 Random unit vector: 1: 0.32768578 2: -0.25458710 3: 0.10466988 4: 0.53364911 5: -0.72943148 Random unit vector: 1: -0.63801427 2: 0.38494140 3: -0.39464467 4: -0.47202195E-01 5: -0.53552353 Random unit vector: 1: -0.35229306 2: 0.41680576 3: -0.32939561 4: 0.48971747 5: 0.59484274 r8vec_variance_test() r8vec_variance() computes the variance of an R8VEC. Vector: 1: 1.4804029 2: 4.8335460 3: -0.29902287 4: -2.6335174 5: 0.18890529 6: -3.4248571 7: -3.5423260 8: 2.1326726 9: -2.1075757 10: -3.5379033 Variance: 7.36256 R8VEC_VARIANCE_CIRCULAR_TEST R8VEC_VARIANCE_CIRCULAR computes the circular variance of an R8VEC. Uniform Vector in [-PI,+PI]: 1: 2.9334359 2: 0.32827275 3: -1.3452330 4: 2.7719153 5: -0.33491180 6: -2.4312906 7: 2.5107403 8: -1.0729490 9: -0.61245330 10: -1.1516446 Circular variance: 0.713750 Normal vector, mean 0, variance 1 1: -1.4559765 2: -0.81158054 3: -1.6407202 4: -1.1094601 5: -2.7196928 6: -0.31870136 7: 2.0232151 8: -0.28284882 9: -1.3477660 10: -1.2178685 Circular variance: 0.391815 R8VEC_VARIANCE_SAMPLE_TEST R8VEC_VARIANCE_SAMPLE computes the sample variance of an R8VEC. Vector: 1: -3.8695040 2: -3.2539922 3: 4.5805178 4: 3.1849287 5: -1.4330125 6: -4.0890983 7: -4.7078311 8: -0.20747618 9: -2.5457531 10: -0.57074153 Variance: 9.75579 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.951911 0.00000 0.00000 2 0.427602 0.137450 0.137450 3 0.167987 0.159473 0.159473 4 0.192624 0.132431 0.132431 5 0.188285 0.111500 0.111500 6 0.269483 0.914504E-01 0.914504E-01 7 0.540269 0.805315E-01 0.805315E-01 8 0.615639 0.753255E-01 0.753255E-01 9 0.680744 0.735090E-01 0.735090E-01 10 0.320782 0.669670E-01 0.669670E-01 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.911283 0.00000 0.00000 2 0.623250 0.207408E-01 0.207408E-01 3 0.531856 0.261424E-01 0.261424E-01 4 0.930744 0.305828E-01 0.305828E-01 5 0.928440 0.296018E-01 0.296018E-01 6 0.327601 0.537402E-01 0.537402E-01 7 0.944556 0.528652E-01 0.528652E-01 8 0.481297 0.537213E-01 0.537213E-01 9 0.694168 0.477766E-01 0.477766E-01 10 0.613823 0.437994E-01 0.437994E-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 1.33331 7.89040 2 2.01894 8.19804 3 1.33331 7.89040 4 1.08000 8.65347 5 2.64599 9.53995 6 2.01894 8.19804 7 2.76944 6.52094 8 2.95410 8.28024 9 1.33331 7.89040 10 1.43683 7.19839 Arrays after ascending sort: 1 1.08000 8.65347 2 1.33331 7.89040 3 1.33331 7.89040 4 1.33331 7.89040 5 1.43683 7.19839 6 2.01894 8.19804 7 2.01894 8.19804 8 2.64599 9.53995 9 2.76944 6.52094 10 2.95410 8.28024 R8VEC2_SORT_D_TEST R8VEC2_SORT_D descending sorts a pair of R8VEC's. The pair of arrays: 1 2.15548 8.43942 2 2.47081 5.38242 3 2.15548 8.43942 4 1.73730 9.78984 5 1.87510 7.04678 6 2.47081 5.38242 7 1.90892 5.15943 8 2.95077 5.75127 9 2.15548 8.43942 10 1.08465 9.31833 Arrays after descending sort: 1 2.95077 5.75127 2 2.47081 5.38242 3 2.47081 5.38242 4 2.15548 8.43942 5 2.15548 8.43942 6 2.15548 8.43942 7 1.90892 5.15943 8 1.87510 7.04678 9 1.73730 9.78984 10 1.08465 9.31833 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.250000 0.700000 2 0.850000 0.200000 3 0.200000 0.100000 4 0.150000 0.500000E-01 5 0.950000 0.00000 6 0.500000E-01 0.400000 7 0.600000 0.950000 8 1.00000 0.800000 9 0.100000 1.00000 10 0.350000 0.850000 11 0.350000 0.800000 12 0.650000 0.00000 13 0.250000 0.850000 14 0.500000E-01 0.100000 15 0.950000 0.00000 16 0.250000 0.400000 17 0.400000 0.150000 18 0.250000 0.600000 19 0.300000 0.00000 20 0.300000 0.700000 After sorting: I, INDX(I), X(I), Y(I) 1 14 0.250000 0.700000 2 6 0.850000 0.200000 3 9 0.200000 0.100000 4 4 0.150000 0.500000E-01 5 3 0.950000 0.00000 6 16 0.500000E-01 0.400000 7 18 0.600000 0.950000 8 1 1.00000 0.800000 9 13 0.100000 1.00000 10 19 0.350000 0.850000 11 20 0.350000 0.800000 12 11 0.650000 0.00000 13 10 0.250000 0.850000 14 17 0.500000E-01 0.100000 15 7 0.950000 0.00000 16 12 0.250000 0.400000 17 2 0.400000 0.150000 18 15 0.250000 0.600000 19 5 0.300000 0.00000 20 8 0.300000 0.700000 Now use the index array to carry out the permutation implicitly. I, INDX(I), X(INDX(I)), Y(INDX(I)) 1 14 0.500000E-01 0.100000 2 6 0.500000E-01 0.400000 3 9 0.100000 1.00000 4 4 0.150000 0.500000E-01 5 3 0.200000 0.100000 6 16 0.250000 0.400000 7 18 0.250000 0.600000 8 1 0.250000 0.700000 9 13 0.250000 0.850000 10 19 0.300000 0.00000 11 20 0.300000 0.700000 12 11 0.350000 0.800000 13 10 0.350000 0.850000 14 17 0.400000 0.150000 15 7 0.600000 0.950000 16 12 0.650000 0.00000 17 2 0.850000 0.200000 18 15 0.950000 0.00000 19 5 0.950000 0.00000 20 8 1.00000 0.800000 R8VEC_PERMUTE carries out the permutation. I, X(I), Y(I) 1 0.500000E-01 0.100000 2 0.500000E-01 0.400000 3 0.100000 1.00000 4 0.150000 0.500000E-01 5 0.200000 0.100000 6 0.250000 0.400000 7 0.250000 0.600000 8 0.250000 0.700000 9 0.250000 0.850000 10 0.300000 0.00000 11 0.300000 0.700000 12 0.350000 0.800000 13 0.350000 0.850000 14 0.400000 0.150000 15 0.600000 0.950000 16 0.650000 0.00000 17 0.850000 0.200000 18 0.950000 0.00000 19 0.950000 0.00000 20 1.00000 0.800000 R8VEC2_SORTED_UNIQUE_TEST For a pair of R8VEC's: R8VEC2_SORTED_UNIQUE counts unique entries. The pair of arrays: 1 1.42968 7.53171 2 1.52738 8.77258 3 1.42968 7.53171 4 2.24233 7.24297 5 1.43243 5.48562 6 1.52738 8.77258 7 1.68277 6.08055 8 1.62557 5.62742 9 1.42968 7.53171 10 1.48145 6.14587 Arrays after ascending sort: 1 1.42968 7.53171 2 1.42968 7.53171 3 1.42968 7.53171 4 1.43243 5.48562 5 1.48145 6.14587 6 1.52738 8.77258 7 1.52738 8.77258 8 1.62557 5.62742 9 1.68277 6.08055 10 2.24233 7.24297 UNIQed array: 1 1.42968 7.53171 2 1.43243 5.48562 3 1.48145 6.14587 4 1.52738 8.77258 5 1.62557 5.62742 6 1.68277 6.08055 7 2.24233 7.24297 R8VEC2_SORTED_UNIQUE_INDEX_TEST For a pair of R8VEC's: R8VEC2_SORTED_UNIQUE_INDEX indexes unique entries. Sorted arrays: 1 1.29436 5.76069 2 1.29436 5.76069 3 1.29436 5.76069 4 1.45606 6.08081 5 1.88713 6.00144 6 2.12971 8.29202 7 2.41525 9.66943 8 2.41525 9.66943 9 2.51598 5.70834 10 2.68089 6.71900 The number of unique elements is 7 Index of Unique Elements: 1: 1 2: 4 3: 5 4: 6 5: 7 6: 9 7: 10 After Indexed Nonunique Deletion. 1 1.29436 5.76069 2 1.45606 6.08081 3 1.88713 6.00144 4 2.12971 8.29202 5 2.41525 9.66943 6 2.51598 5.70834 7 2.68089 6.71900 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 6.28466 3.55717 2 7.82221 4.53984 3 7.43241 0.490515 4 5.76406 1.65152 5 1.49066 4.22922 6 4.09248 2.30601 7 1.71796 3.84375 8 1.57771 1.72070 9 6.18546 4.47094 10 7.11733 4.00535 Index of maximum in A+B: 2 r8lib_test() Normal end of execution. 6 October 2025 6:33:35.435 PM