23 June 2024 10:49:16.032 AM r8lib_test() Fortran90 version Test r8lib(). I4INT_TO_R8INT_TEST For data in an interval, I4INT_TO_R8INT converts an integer to a real; Integer interval: 1 11 Real interval: 100.000 200.000 R I(R) R(I(R)) 122.609 3 120.000 210.609 12 210.000 103.088 1 100.000 115.584 3 120.000 154.531 6 150.000 160.116 7 160.000 171.902 8 170.000 154.325 6 150.000 117.570 3 120.000 157.351 7 160.000 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 0 7 5 9 3 4 8 1 6 2 8 2 6 9 5 7 0 3 1 4 7 0 3 2 8 5 9 4 6 1 8 6 3 1 4 0 9 5 7 2 0 9 8 3 5 2 1 4 7 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 6 4 10 2 5 8 3 1 9 7 1 9 2 3 7 8 5 6 4 10 8 5 4 9 3 7 10 2 6 1 10 4 8 3 9 1 6 5 7 2 8 2 10 9 3 5 1 6 4 7 R8_ABS_TEST R8_ABS returns the absolute value of an R8. X R8_ABS(X) -3.855310 3.855310 -4.719737 4.719737 -1.265272 1.265272 3.367402 3.367402 2.036142 2.036142 3.097262 3.097262 -3.679537 3.679537 -0.757070 0.757070 -3.020866 3.020866 -1.086778 1.086778 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 -9.47371 -2.11596 -9.47371 4.38295 1.63652 4.38295 2.20898 1.30236 2.20898 -8.02989 -2.00249 -8.02989 -5.77103 -1.79370 -5.77103 4.54687 1.65668 4.54687 2.35318 1.33010 2.35318 -5.30985 -1.74459 -5.30985 6.06479 1.82364 6.06479 -0.198613 -0.583448 -0.198613 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 -23 98 -0.234694 37 100 0.370000 -13 -23 0.565217 41 34 1.20588 58 -5 -11.6000 19 -41 -0.463415 41 -57 -0.719298 -21 -35 0.600000 62 1 62.0000 72 93 0.774194 R8_E_TEST R8_E returns the value of E. Compare E to (1+1/n)^n R8_E = 2.718281828459045 N Estimate Error 1 2.00000 0.718282 2 2.25000 0.468282 4 2.44141 0.276876 8 2.56578 0.152497 16 2.63793 0.803533E-01 32 2.67699 0.412917E-01 64 2.69734 0.209369E-01 128 2.70774 0.105428E-01 256 2.71299 0.529020E-02 512 2.71563 0.264983E-02 1024 2.71696 0.132610E-02 2048 2.71762 0.663346E-03 4096 2.71795 0.331747E-03 8192 2.71812 0.165892E-03 16384 2.71820 0.829507E-04 32768 2.71824 0.414765E-04 65536 2.71826 0.207386E-04 131072 2.71827 0.103694E-04 262144 2.71828 0.518469E-05 524288 2.71828 0.259234E-05 1048576 2.71828 0.129618E-05 R8_EPSILON_TEST R8_EPSILON returns the R8 machine precision. R = R8_EPSILON() = 0.2220446049250313E-15 ( 1 + R ) - 1 = 0.2220446049250313E-15 ( 1 + (R/2) ) - 1 = 0.000000000000000 R8_EPSILON_COMPUTE_TEST R8_EPSILON_COMPUTE computes the R8 machine precision. R = R8_EPSILON_COMPUTE() = 0.2220446049250313E-15 ( 1 + R ) - 1 = 0.2220446049250313E-15 ( 1 + (R/2) ) - 1 = 0.000000000000000 R8_EXP_TEST R8_EXP evaluates the exponential function of R8. It truncates very small or large arguments. X R8_EXP(X) ********** .00000 ********** .00000 ********** ********** ********** ********** ********** ********** .00000 ********** ********** ********** ********** ********** ********** ********** ********** ********** ********** ********** R8_FACTORIAL_TEST R8_FACTORIAL computes the factorial function. N Exact Computed 0 1.000000000000000 1.000000000000000 1 1.000000000000000 1.000000000000000 2 2.000000000000000 2.000000000000000 3 6.000000000000000 6.000000000000000 4 24.00000000000000 24.00000000000000 5 120.0000000000000 120.0000000000000 6 720.0000000000000 720.0000000000000 7 5040.000000000000 5040.000000000000 8 40320.00000000000 40320.00000000000 9 362880.0000000000 362880.0000000000 10 3628800.000000000 3628800.000000000 11 39916800.00000000 39916800.00000000 12 479001600.0000000 479001600.0000000 13 6227020800.000000 6227020800.000000 14 87178291200.00000 87178291200.00000 15 1307674368000.000 1307674368000.000 16 20922789888000.00 20922789888000.00 17 355687428096000.0 355687428096000.0 18 6402373705728000. 6402373705728000. 19 0.1216451004088320E+18 0.1216451004088320E+18 20 0.2432902008176640E+19 0.2432902008176640E+19 25 0.1551121004333099E+26 0.1551121004333099E+26 50 0.3041409320171338E+65 0.3041409320171338E+65 100 0.9332621544394415+158 0.9332621544394410+158 150 0.5713383956445855+263 0.5713383956445850+263 R8_FACTORIAL_STIRLING_TEST R8_FACTORIAL_STIRLING computes Stirling's approximate factorial function; N Factorial Factorial Stirling 1 1.00227 1.00000 2 2.00065 2.00000 3 6.00060 6.00000 4 24.0010 24.0000 5 120.003 120.000 6 720.009 720.000 7 5040.04 5040.00 8 40320.2 40320.0 9 362881. 362880. 10 0.362881E+07 0.362880E+07 11 0.399169E+08 0.399168E+08 12 0.479002E+09 0.479002E+09 13 0.622703E+10 0.622702E+10 14 0.871784E+11 0.871783E+11 15 0.130768E+13 0.130767E+13 16 0.209228E+14 0.209228E+14 17 0.355688E+15 0.355687E+15 18 0.640238E+16 0.640237E+16 19 0.121645E+18 0.121645E+18 20 0.243290E+19 0.243290E+19 R8_FACTORIAL2_TEST R8_FACTORIAL2 computes the double factorial function. N Exact Computed 0 1.000000000000000 1.000000000000000 1 1.000000000000000 1.000000000000000 2 2.000000000000000 2.000000000000000 3 3.000000000000000 3.000000000000000 4 8.000000000000000 8.000000000000000 5 15.00000000000000 15.00000000000000 6 48.00000000000000 48.00000000000000 7 105.0000000000000 105.0000000000000 8 384.0000000000000 384.0000000000000 9 945.0000000000000 945.0000000000000 10 3840.000000000000 3840.000000000000 11 10395.00000000000 10395.00000000000 12 46080.00000000000 46080.00000000000 13 135135.0000000000 135135.0000000000 14 645120.0000000000 645120.0000000000 15 2027025.000000000 2027025.000000000 R8_FALL_TEST R8_FALL computes the falling factorial function. X N Exact Computed 5.0000 4 120.0000000000000 120.0000000000000 5.2500 4 163.1601562500000 163.1601562500000 5.5000 4 216.5625000000000 216.5625000000000 5.7500 4 281.6601562500000 281.6601562500000 6.0000 4 360.0000000000000 360.0000000000000 7.5000 0 1.000000000000000 1.000000000000000 7.5000 1 7.500000000000000 7.500000000000000 7.5000 2 48.75000000000000 48.75000000000000 7.5000 3 268.1250000000000 268.1250000000000 7.5000 4 1206.562500000000 1206.562500000000 7.5000 5 4222.968750000000 4222.968750000000 7.5000 6 10557.42187500000 10557.42187500000 7.5000 7 15836.13281250000 15836.13281250000 7.5000 8 7918.066406250000 7918.066406250000 7.5000 9 -3959.033203125000 -3959.033203125000 R8_FLOOR_TEST R8_FLOOR rounds a value down. X R8_FLOOR(X) -1.20000 -2.00000 -1.00000 -1.00000 -0.800000 -1.00000 -0.600000 -1.00000 -0.400000 -1.00000 -0.200000 -1.00000 0.00000 0.00000 0.200000 0.00000 0.400000 0.00000 0.600000 0.00000 0.800000 0.00000 1.00000 1.00000 1.20000 1.00000 R8_FRACTIONAL_TEST R8_FRACTIONAL returns the fractional part of an R8. X R8_FRACTIONAL(X) 3.893752 0.893752 -0.448213 0.448213 1.330844 0.330844 1.898663 0.898663 1.003403 0.003403 -1.034849 0.034849 -2.257874 0.257874 -2.915977 0.915977 1.489683 0.489683 -0.608305 0.608305 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) 2.0654 -0.3680 2.0654 0.3491 4.4287 4.4287 -1.7931 -2.0750 -1.7931 1.6695 -0.5378 1.6695 4.0365 -0.7396 4.0365 3.7017 4.0425 4.0425 1.4519 -3.9308 1.4519 -4.9093 1.6106 1.6106 -4.4642 -0.1017 -0.1017 -2.1001 1.8031 1.8031 R8_MIN_TEST R8_MIN returns the minimum of two R8's. A B C=R8_MIN(A,B) -3.2774 4.9248 -3.2774 0.6283 4.7666 0.6283 -3.3811 -1.5453 -3.3811 1.1352 3.5756 1.1352 1.2609 3.1261 1.2609 -0.4030 0.0362 -0.4030 3.6875 -1.7232 -1.7232 -3.7773 -2.0885 -3.7773 0.8360 3.0156 0.8360 -4.8240 -4.7501 -4.8240 R8_MOD_TEST R8_MOD returns the remainder after division. X Y MOD(X,Y) R8_MOD(X,Y) 6.6046 4.8229 1.7817 1.7817 2.4904 -0.9088 0.6729 0.6729 -2.9946 4.4072 -2.9946 -2.9946 -2.9440 0.8995 -0.2456 -0.2456 1.6880 2.3023 1.6880 1.6880 7.5949 -1.5328 1.4635 1.4635 -8.4482 8.5713 -8.4482 -8.4482 -3.9713 -1.2019 -0.3656 -0.3656 -5.8833 1.4418 -0.1161 -0.1161 -5.0509 3.8142 -1.2367 -1.2367 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) 2.6113 6.1273 2.6113 2.6113 -5.0603 -2.8213 -2.2391 0.5822 4.2886 -6.5204 4.2886 4.2886 6.0173 8.4340 6.0173 6.0173 5.5367 8.5862 5.5367 5.5367 -9.1840 9.9930 -9.1840 0.8089 9.9768 -8.1599 1.8169 1.8169 2.5958 -1.3056 1.2902 1.2902 -8.8289 5.7144 -3.1145 2.5999 6.7198 7.0903 6.7198 6.7198 R8_MOP_TEST R8_MOP evaluates (-1.0)^I4 as an R8. I4 R8_MOP(I4) 21 -1.0 -22 1.0 -95 -1.0 -93 -1.0 82 1.0 94 1.0 3 -1.0 -99 -1.0 49 -1.0 50 1.0 R8_NINT_TEST R8_NINT produces the nearest integer to an R8. X R8_NINT(X) -0.4202 0 1.4178 1 9.5662 10 0.2411 0 7.4059 7 -2.5452 -3 8.0031 8 0.0388 0 8.9936 9 7.7769 8 R8_NORMAL_01_TEST R8_NORMAL_01 generates normally distributed random values. -0.217012 -0.743015 -0.940227 1.43882 1.24196 1.77553 -0.747649 -1.28544 -0.711652 -2.88463 -0.293005 1.53842 0.814792 -1.25136 1.46260 0.400730 -0.332175 0.265079 0.598197 0.987759 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 11.0808 2.48073 11.2322 -1.53530 7.18169 17.0328 8.53802 5.57027 13.0151 -0.185728 16.4152 10.4407 10.1382 10.9696 10.9783 8.89314 13.0341 11.3014 15.3108 10.1662 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.7962960728393298E-01 0.000000000000000 2 0.7962960728393298E-01 0.7900000000000000E-01 4 0.7962960728393298E-01 0.7962000000000001E-01 6 0.7962960728393298E-01 0.7962959999999999E-01 8 0.7962960728393298E-01 0.7962960700000001E-01 10 0.7962960728393298E-01 0.7962960728000000E-01 0 0.2783237583676931 0.000000000000000 2 0.2783237583676931 0.2700000000000000 4 0.2783237583676931 0.2783000000000000 6 0.2783237583676931 0.2783230000000000 8 0.2783237583676931 0.2783237500000000 10 0.2783237583676931 0.2783237583000000 0 0.4764699436179405 0.000000000000000 2 0.4764699436179405 0.4700000000000000 4 0.4764699436179405 0.4764000000000000 6 0.4764699436179405 0.4764690000000000 8 0.4764699436179405 0.4764699400000000 10 0.4764699436179405 0.4764699436000000 0 0.2009899043346375E-01 0.000000000000000 2 0.2009899043346375E-01 0.2000000000000000E-01 4 0.2009899043346375E-01 0.2009000000000000E-01 6 0.2009899043346375E-01 0.2009890000000000E-01 8 0.2009899043346375E-01 0.2009899000000000E-01 10 0.2009899043346375E-01 0.2009899043000000E-01 0 0.9094824331318347 0.000000000000000 2 0.9094824331318347 0.9000000000000000 4 0.9094824331318347 0.9094000000000001 6 0.9094824331318347 0.9094820000000000 8 0.9094824331318347 0.9094824300000001 10 0.9094824331318347 0.9094824331000000 R8_SECD_TEST R8_SECD computes the secant of an angle given in degrees. ANGLE R8_SECD(ANGLE) 0.00 1.00000 15.00 1.03528 30.00 1.15470 45.00 1.41421 60.00 2.00000 75.00 3.86370 90.00 Undefined 105.00 -3.86370 120.00 -2.00000 135.00 -1.41421 150.00 -1.15470 165.00 -1.03528 180.00 -1.00000 195.00 -1.03528 210.00 -1.15470 225.00 -1.41421 240.00 -2.00000 255.00 -3.86370 270.00 Undefined 285.00 3.86370 300.00 2.00000 315.00 1.41421 330.00 1.15470 345.00 1.03528 360.00 1.00000 R8_SECH_TEST R8_SECH computes the hyperbolic secant. X R8_SECH(X) -1.00 0.648054 -0.90 0.697795 -0.80 0.747700 -0.70 0.796705 -0.60 0.843551 -0.50 0.886819 -0.40 0.925007 -0.30 0.956628 -0.20 0.980328 -0.10 0.995021 0.00 1.00000 0.10 0.995021 0.20 0.980328 0.30 0.956628 0.40 0.925007 0.50 0.886819 0.60 0.843551 0.70 0.796705 0.80 0.747700 0.90 0.697795 1.00 0.648054 r8_sigmoid_test r8_sigmoid evaluates the sigmoid function of R8. X R8_SIGMOID(L,B,M,X) -4.00000 0.179862E-01 -2.00000 0.119203 -1.00000 0.268941 -0.500000 0.377541 -0.250000 0.437823 0.00000 0.500000 0.250000 0.562177 0.500000 0.622459 1.00000 0.731059 2.00000 0.880797 4.00000 0.982014 R8_SIGN_TEST R8_SIGN returns the sign of an R8. R8 R8_SIGN(R8) -1.2500 -1. -0.2500 -1. 0.0000 1. 0.5000 1. 9.0000 1. R8_SIGN_MATCH_TEST R8_SIGN_MATCH reports whether signs match R1 R2 R8_SIGN_MATCH(R1,R2) 0.9510 3.5431 T 1.6449 -1.8742 F -0.1480 3.1094 F 0.4214 -4.8688 F 3.6510 4.6048 T 3.3252 1.1347 T 4.9031 1.8968 T 2.6808 2.9114 T -4.4450 3.9059 F -2.9627 -1.6841 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 -2.307 * sin ( -4.988 * x ) + -2.879 * cos ( -4.988 * x ) = 3.690 * sin ( -4.988 * x + -2.246 ) = 3.690 * cos ( -4.988 * x + 2.466 ) I X form 1 form 2 form 3 0 0.0000 -2.87891 -2.87891 -2.87891 1 0.3142 2.29624 2.29624 2.29624 2 0.6283 2.89677 2.89677 2.89677 3 0.9425 -2.27371 -2.27371 -2.27371 4 1.2566 -2.91446 -2.91446 -2.91446 5 1.5708 2.25103 2.25103 2.25103 6 1.8850 2.93197 2.93197 2.93197 7 2.1991 -2.22823 -2.22823 -2.22823 8 2.5133 -2.94930 -2.94930 -2.94930 9 2.8274 2.20528 2.20528 2.20528 10 3.1416 2.96646 2.96646 2.96646 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 4.40571 4.31579 7.71314 7.63158 0.975157 1.00000 6.96372 7.15789 7.94158 8.10526 11.4093 10.0000 8.37307 8.57895 9.52790 9.52632 10.7387 10.0000 3.23372 3.36842 7.66055 7.63158 11.1856 10.0000 4.50350 4.31579 8.17198 8.10526 7.99949 8.10526 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.6648 14.7206 12.1207 18.1705 16.2001 12.3960 19.8398 16.9928 13.6076 19.8274 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 ) 10.6091 3.60915 2.32277 5.82277 9.72645 6.22645 11.1225 4.12249 8.26440 4.76440 6.02332 6.02332 9.55110 6.05110 1.31501 4.81501 6.38159 6.38159 7.37026 3.87026 9.83682 6.33682 8.63141 5.13141 7.94499 4.44499 11.9220 4.92199 10.6873 3.68732 -0.544554 6.45545 0.152172 3.65217 2.02155 5.52155 10.2350 3.23495 11.6624 4.66239 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 = 2 1 1.00000 0.00000 2 1.00000 3.00000 3 2.00000 1.00000 4 3.00000 2.00000 Order type = -1 1 1.00000 0.00000 2 0.00000 3.00000 3 3.00000 0.00000 4 0.00000 2.00000 Order type = -1 1 0.00000 3.00000 2 2.00000 1.00000 3 3.00000 2.00000 4 2.00000 1.00000 Order type = -1 1 3.00000 2.00000 2 0.00000 1.00000 3 1.00000 1.00000 4 2.00000 2.00000 Order type = -1 1 1.00000 0.00000 2 2.00000 1.00000 3 3.00000 1.00000 4 2.00000 0.00000 Order type = -1 1 1.00000 1.00000 2 1.00000 3.00000 3 1.00000 1.00000 4 2.00000 1.00000 Order type = -1 1 3.00000 0.00000 2 2.00000 0.00000 3 2.00000 3.00000 4 2.00000 1.00000 Order type = 3 1 3.00000 1.00000 2 1.00000 1.00000 3 1.00000 1.00000 4 1.00000 0.00000 Order type = -1 1 1.00000 3.00000 2 2.00000 2.00000 3 1.00000 3.00000 4 0.00000 2.00000 Order type = -1 1 0.00000 1.00000 2 2.00000 1.00000 3 2.00000 1.00000 4 1.00000 3.00000 R82ROW_PART_QUICK_A_TEST R82ROW_PART_QUICK_A reorders an R82ROW as part of a quick sort. Before rearrangement: 1 1.60479 3.96365 2 3.04639 2.72289 3 4.55167 1.17225 4 4.26540 3.65177 5 9.75142 6.41204 6 5.94797 5.90159 7 8.64725 0.112035 8 0.503682 9.01486 9 8.34713 7.74702 10 2.56845 2.86799 11 7.02255 2.40629 12 3.11773 2.31651 Rearranged array Left index = 1 Key index = 2 Right index = 3 Left half: 1 0.503682 9.01486 Key: 1 1.60479 3.96365 Right half: 1 4.26540 3.65177 2 9.75142 6.41204 3 5.94797 5.90159 4 8.64725 0.112035 5 4.55167 1.17225 6 8.34713 7.74702 7 2.56845 2.86799 8 7.02255 2.40629 9 3.11773 2.31651 10 3.04639 2.72289 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 7.73537 0.464894 2 6.56775 2.97463 3 0.762286 4.89585 4 0.171634 4.99167 5 0.762286 1.72485 6 4.27739 0.464894 7 7.94215 0.617491 8 8.02254 4.83224 9 2.19333 2.97463 10 6.55255 4.08519 11 7.94215 0.617491 12 0.171634 1.65651 I Index A(Index) 1 12 0.171634 1.65651 2 4 0.171634 4.99167 3 5 0.762286 1.72485 4 3 0.762286 4.89585 5 9 2.19333 2.97463 6 6 4.27739 0.464894 7 10 6.55255 4.08519 8 2 6.56775 2.97463 9 1 7.73537 0.464894 10 7 7.94215 0.617491 11 11 7.94215 0.617491 12 8 8.02254 4.83224 After rearrangement by R82ROW_PERMUTE: 1 0.171634 1.65651 2 0.171634 4.99167 3 0.762286 1.72485 4 0.762286 4.89585 5 2.19333 2.97463 6 4.27739 0.464894 7 6.55255 4.08519 8 6.56775 2.97463 9 7.73537 0.464894 10 7.94215 0.617491 11 7.94215 0.617491 12 8.02254 4.83224 R82ROW_SORT_QUICK_A_TEST R82ROW_SORT_QUICK_A sorts an R82ROW using quick sort. Before rearrangement: 1 9.01002 9.67245 2 3.82400 7.87477 3 6.26590 8.29736 4 6.63169 5.54242 5 6.26590 3.12906 6 0.567042 9.67245 7 8.69314 7.38938 8 5.68600 0.196208 9 2.01157 7.87477 10 1.07140 0.562750 11 8.69314 7.38938 12 6.63169 8.82451 Sorted array: 1 0.567042 9.67245 2 1.07140 0.562750 3 2.01157 7.87477 4 3.82400 7.87477 5 5.68600 0.196208 6 6.26590 3.12906 7 6.26590 8.29736 8 6.63169 5.54242 9 6.63169 8.82451 10 8.69314 7.38938 11 8.69314 7.38938 12 9.01002 9.67245 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 3.00 2.00 1 3.00 2.00 2 1.00 1.00 2 1.00 1.00 3 1.00 3.00 4 2.00 3.00 5 2.00 1.00 6 3.00 1.00 1 3.00 2.00 5 2.00 1.00 1 3.00 2.00 7 3.00 3.00 4 2.00 3.00 8 4.00 3.00 6 3.00 1.00 9 4.00 1.00 10 2.00 2.00 9 4.00 1.00 1 3.00 2.00 1 3.00 2.00 4 2.00 3.00 1 3.00 2.00 10 2.00 2.00 10 2.00 2.00 11 1.00 2.00 10 2.00 2.00 1 3.00 2.00 1 3.00 2.00 3 1.00 3.00 4 2.00 3.00 Vector of unique X Y values: I X(I) Y(I) 1 3.00 2.00 2 1.00 1.00 3 1.00 3.00 4 2.00 3.00 5 2.00 1.00 6 3.00 1.00 7 3.00 3.00 8 4.00 3.00 9 4.00 1.00 10 2.00 2.00 11 1.00 2.00 X, Y sorted by index I INDX(I) X(INDX(I)) Y(INDX(I)) 1 2 1.00 1.00 2 11 1.00 2.00 3 3 1.00 3.00 4 5 2.00 1.00 5 10 2.00 2.00 6 4 2.00 3.00 7 6 3.00 1.00 8 1 3.00 2.00 9 7 3.00 3.00 10 9 4.00 1.00 11 8 4.00 3.00 R8R8R8VEC_INDEX_INSERT_UNIQUE_TEST R8R8R8VEC_INDEX_INSERT_UNIQUE inserts unique values into an index sorted array. Number of random values to generate = 30 XVAL YVAL ZVAL Index 1 1.00 2.00 4.00 2 3.00 2.00 2.00 3 3.00 1.00 1.00 4 4.00 3.00 2.00 5 2.00 2.00 1.00 6 1.00 3.00 2.00 7 1.00 1.00 2.00 8 3.00 3.00 1.00 2 3.00 2.00 2.00 1 1.00 2.00 4.00 9 3.00 3.00 2.00 10 3.00 3.00 3.00 11 2.00 1.00 4.00 12 2.00 2.00 4.00 13 2.00 2.00 2.00 2 3.00 2.00 2.00 13 2.00 2.00 2.00 13 2.00 2.00 2.00 14 3.00 2.00 3.00 15 4.00 2.00 3.00 16 1.00 3.00 4.00 1 1.00 2.00 4.00 17 1.00 2.00 1.00 18 4.00 3.00 4.00 19 1.00 3.00 3.00 10 3.00 3.00 3.00 9 3.00 3.00 2.00 20 1.00 3.00 1.00 8 3.00 3.00 1.00 14 3.00 2.00 3.00 Vector of unique X Y Z values: I X(I) Y(I) Z(I) 1 1.00 2.00 4.00 2 3.00 2.00 2.00 3 3.00 1.00 1.00 4 4.00 3.00 2.00 5 2.00 2.00 1.00 6 1.00 3.00 2.00 7 1.00 1.00 2.00 8 3.00 3.00 1.00 9 3.00 3.00 2.00 10 3.00 3.00 3.00 11 2.00 1.00 4.00 12 2.00 2.00 4.00 13 2.00 2.00 2.00 14 3.00 2.00 3.00 15 4.00 2.00 3.00 16 1.00 3.00 4.00 17 1.00 2.00 1.00 18 4.00 3.00 4.00 19 1.00 3.00 3.00 20 1.00 3.00 1.00 X Y Z sorted by index: I INDX(I) X(I) X(INDX(I)) 1 7 1.00 1.00 2.00 2 17 1.00 2.00 1.00 3 1 1.00 2.00 4.00 4 20 1.00 3.00 1.00 5 6 1.00 3.00 2.00 6 19 1.00 3.00 3.00 7 16 1.00 3.00 4.00 8 11 2.00 1.00 4.00 9 5 2.00 2.00 1.00 10 13 2.00 2.00 2.00 11 12 2.00 2.00 4.00 12 3 3.00 1.00 1.00 13 2 3.00 2.00 2.00 14 14 3.00 2.00 3.00 15 8 3.00 3.00 1.00 16 9 3.00 3.00 2.00 17 10 3.00 3.00 3.00 18 15 4.00 2.00 3.00 19 4 4.00 3.00 2.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)) 125.378 4 130.000 112.232 2 110.000 142.695 5 140.000 119.612 3 120.000 133.379 4 130.000 185.418 10 190.000 106.916 2 110.000 214.115 12 210.000 169.536 8 170.000 185.456 10 190.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.89870 0.840211 0.205216 0.856692 0.668062 2: 0.840211 5.23023 0.178031 0.439670 0.571014 3: 0.205216 0.178031 5.97264 0.685200 0.431658 4: 0.856692 0.439670 0.685200 5.64148 0.638136 5: 0.668062 0.571014 0.431658 0.638136 5.64469 Upper Cholesky factor R: Col 1 2 3 4 5 Row 1: 2.42872 0.345948 0.844953E-01 0.352733 0.275067 2: 0.00000 2.26065 0.658216E-01 0.140509 0.210495 3: 0.00000 0.00000 2.44155 0.264646 0.161603 4: 0.00000 0.00000 0.00000 2.32965 0.201217 5: 0.00000 0.00000 0.00000 0.00000 2.33626 Product R' * R: Col 1 2 3 4 5 Row 1: 5.89870 0.840211 0.205216 0.856692 0.668062 2: 0.840211 5.23023 0.178031 0.439670 0.571014 3: 0.205216 0.178031 5.97264 0.685200 0.431658 4: 0.856692 0.439670 0.685200 5.64148 0.638136 5: 0.668062 0.571014 0.431658 0.638136 5.64469 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: -4.24528 2.93440 4.91439 4.10657 -3.69225 2: 0.551240 -4.72686 -3.48711 3.18043 1.18654 3: -2.67704 -4.02239 0.479728 -1.07738 -0.675253 4: 1.23123 0.910576 4.22669 0.224572 -2.32390 5: -3.97601 -3.34849 0.734852E-02 4.66369 3.97274 Compact vector V so H*A packs column 3: 1: 0.0000000 2: 0.0000000 3: 0.74591407 4: 0.66604118 5: 0.11579795E-02 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.112776 -0.993619 -0.172751E-02 4: 0.00000 0.00000 -0.993619 0.112778 -0.154252E-02 5: 0.00000 0.00000 -0.172751E-02 -0.154252E-02 0.999997 Indirect product A*H: Col 1 2 3 4 5 Row 1: -4.24528 2.93440 -4.62821 -4.41420 -3.70706 2: 0.551240 -4.72686 -2.76892 3.82171 1.18766 3: -2.67704 -4.02239 1.01757 -0.597131 -0.674418 4: 1.23123 0.910576 -0.695792 -4.17081 -2.33154 5: -3.97601 -3.34849 -4.64162 0.512533 3.96553 Direct product A*H: Col 1 2 3 4 5 Row 1: -4.24528 2.93440 -4.62821 -4.41420 -3.70706 2: 0.551240 -4.72686 -2.76892 3.82171 1.18766 3: -2.67704 -4.02239 1.01757 -0.597131 -0.674418 4: 1.23123 0.910576 -0.695792 -4.17081 -2.33154 5: -3.97601 -3.34849 -4.64162 0.512533 3.96553 Product H*A has packed column 3: Col 1 2 3 4 5 Row 1: -4.24528 2.93440 4.91439 4.10657 -3.69225 2: 0.551240 -4.72686 -3.48711 3.18043 1.18654 3: -0.914596 -0.445354 -4.25383 -0.109693 2.37836 4: 2.80494 4.10458 0.668310E-15 1.08864 0.402731 5: -3.97328 -3.34293 0.414322E-18 4.66519 3.97749 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: 1.33946 0.494174 3.29740 0.447499 0.550782 2: 4.27569 2.95022 2.26530 2.83522 2.54995 3: 4.99292 4.30341 1.26111 3.13108 3.32014 4: 1.85400 4.24954 1.74933 0.571852 2.43712 5: 0.933112 0.252607E-01 4.77416 0.726328 3.50836 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.510738 -0.639233 -0.574915 4: 0.00000 0.00000 -0.639233 0.729524 -0.243262 5: 0.00000 0.00000 -0.574915 -0.243262 0.781215 Product A*H: Col 1 2 3 4 5 Row 1: 1.33946 0.494174 -2.28682 -1.91533 -1.57431 2: 4.27569 2.95022 -4.43534 0.186769E-15 0.222045E-15 3: 4.99292 4.30341 -4.55439 0.670393 1.10703 4: 1.85400 4.24954 -2.66013 -1.29391 0.759085 5: 0.933112 0.252607E-01 -4.91964 -3.37537 -0.180641 R8MAT_HOUSE_PRE_TEST R8MAT_HOUSE_PRE computes a Householder premultiplier; Matrix A: Col 1 2 3 4 5 Row 1: 1.39859 2.07483 0.798762 4.76340 1.06970 2: 0.656786 4.28334 4.71307 2.28436 4.77754 3: 0.201365E-01 4.88338 1.59361 0.661444 3.12874 4: 2.09016 1.58414 2.73965 3.94857 0.350204 5: 0.771327 2.91359 1.00063 2.44595 1.34413 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.817232 -0.276327 -0.475047 -0.173507 3: 0.00000 -0.276327 0.957982 -0.722353E-01 -0.263833E-01 4: 0.00000 -0.475047 -0.722353E-01 0.875817 -0.453568E-01 5: 0.00000 -0.173507 -0.263833E-01 -0.453568E-01 0.983434 Product H*A: Col 1 2 3 4 5 Row 1: 1.39859 2.07483 0.798762 4.76340 1.06970 2: -1.66907 -6.10796 -5.76711 -4.34977 -5.16849 3: -0.333530 3.30329 -0.422052E-15 -0.347337 1.61636 4: 1.48215 -1.13227 0.948619E-16 2.21432 -2.24981 5: 0.549258 1.92144 -0.285900E-16 1.81253 0.394494 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: 2.50433 9.76226 9.91655 2: 6.63737 5.83520 3.49870 3: 1.89237 5.62028 0.415990 4: 1.94564 2.60794 8.84609 5: 2.28864 3.36148 1.66163 Maximum value = 9.91655 R8MAT_MAX_INDEX_TEST For an R8MAT: R8MAT_MAX_INDEX locates the maximum entry; Random array: Col 1 2 3 Row 1: 8.85707 4.88392 6.22936 2: 5.62574 5.17460 6.89490 3: 1.40125 7.04142 8.90485 4: 8.93150 6.76091 5.01462 5: 5.27026 6.99922 4.43344 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: 7.79167 8.55574 6.64096 2: 9.56008 0.543217E-02 5.35323 3: 7.98830 4.05821 8.13795 4: 8.58641 4.09593 4.80421 5: 6.20546 6.12527 1.09665 MAXCOL_MINROW = 6.64096 R8MAT_MAXROW_MINCOL_TEST R8MAT_MAXROW_MINCOL computes the maximum over rows of the mininum over columns; Random array: Col 1 2 3 Row 1: 5.62638 0.888732 1.04302 2: 9.55255 2.72292 1.40418 3: 7.75703 0.733860 5.92873 4: 8.73700 0.524248 1.21063 5: 6.88238 4.40033 0.482777 MAXROW_MINCOL = 5.62638 R8MAT_MIN_TEST R8MAT_MIN computes the minimum value of an R8MAT Random array: Col 1 2 3 Row 1: 3.32542 9.06841 6.94033 2: 3.90505 8.81071 6.93663 3: 1.71783 6.03565 8.06351 4: 4.07830 8.92851 1.76716 5: 2.51572 1.39348 1.03756 Minimum value = 1.03756 R8MAT_MIN_INDEX_TEST For an R8MAT: R8MAT_MIN_INDEX locates the minimum entry; Random array: Col 1 2 3 Row 1: 1.76388 2.11351 8.75892 2: 8.92085 6.90901 8.58680 3: 0.554129 2.09190 7.22715 4: 5.38853 8.61377 0.479536 5: 6.03942 5.19495 3.36498 Minimum I,J indices 2 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: 1.47372 5.01622 8.46556 2: 0.316512 1.16931 8.15581 3: 2.93619 9.84795 7.73423 4: 2.85373 7.85680 6.28007 5: 9.88504 3.82336 9.56309 MINCOL_MAXROW = 7.85680 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: 2.91061 5.97777 8.31802 2: 0.528657E-01 4.84814 2.79272 3: 5.97384 7.05414 4.32272 4: 1.44858 3.46562 3.29230 5: 6.81295 7.87696 0.834870 MINROW_MAXCOL = 6.81295 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: -2.20074 3.62942 4.05899 2.60183 2: 4.05590 -4.67459 -3.53958 0.458989 3: -2.11255 4.56084 0.499180 3.75424 4: -4.32422 -0.400844 -1.26283 -3.34444 5: -2.00189 1.34605 -0.305840 -2.78154 Rounded matrix A: Col 1 2 3 4 Row 1: -2.00000 4.00000 4.00000 3.00000 2: 4.00000 -5.00000 -4.00000 0.00000 3: -2.00000 5.00000 0.00000 4.00000 4: -4.00000 0.00000 -1.00000 -3.00000 5: -2.00000 1.00000 0.00000 -3.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.77771 Computed norm = 1.77771 R8MAT_NORM_L1_TEST R8MAT_NORM_L1 computes the L1 norm of an R8MAT; A: Col 1 2 3 4 Row 1: 3.00000 1.00000 -1.00000 1.00000 2: 3.00000 0.00000 5.00000 2.00000 3: 3.00000 4.00000 0.00000 4.00000 4: 0.00000 4.00000 -3.00000 -1.00000 5: 5.00000 3.00000 0.00000 -5.00000 Computed norm = 14.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.485820 0.951627E-01 -0.721774 -0.296275 0.382342 2: -0.871169 -0.227900E-02 0.400958 0.119287 -0.257026 3: -0.255507E-01 -0.948515 -0.951258E-01 -0.249112 -0.168997 4: 0.654747E-01 0.299399 -0.141150 -0.601646 -0.723997 5: 0.101529E-01 0.402178E-01 0.537868 -0.688446 0.484789 A'*A should be identity: Col 1 2 3 4 5 Row 1: 1.00000 0.409942E-16 -0.535229E-16 -0.834776E-16 0.127479E-15 2: 0.409942E-16 1.00000 -0.172921E-15 -0.186763E-15 -0.570288E-16 3: -0.535229E-16 -0.172921E-15 1.00000 0.113006E-15 -0.103334E-15 4: -0.834776E-16 -0.186763E-15 0.113006E-15 1.00000 -0.631517E-16 5: 0.127479E-15 -0.570288E-16 -0.103334E-15 -0.631517E-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: 1.83675 -2.87693 4.77119 2: 1.69200 8.90432 11.2830 3: 7.17571 -0.768426 8.44579 4: 9.28817 -1.76695 12.3131 5: -3.76240 6.82398 13.4184 6: 0.879185E-01 13.2452 3.83431 7: 6.17244 14.3003 -0.321454 8: 10.1902 12.4518 -3.65458 9: 0.415341 4.23831 7.99103 10: 9.68233 1.70666 -2.62386 mean(X) = 4.27785 5.62583 5.54570 std(X) = 4.84218 6.47389 6.18621 max(X) = 10.1902 14.3003 13.4184 min(X) = -3.76240 -2.87693 -3.65458 Matrix XS: Col 1 2 3 Row 1: 0.401298 0.00000 0.493516 2: 0.390923 0.685865 0.874930 3: 0.783948 0.122750 0.708746 4: 0.935351 0.646192E-01 0.935265 5: 0.00000 0.564755 1.00000 6: 0.275957 0.938579 0.438641 7: 0.712042 1.00000 0.195228 8: 1.00000 0.892388 0.00000 9: 0.299424 0.414225 0.682109 10: 0.963600 0.266841 0.603714E-01 mean(XS) = 0.576254 0.495002 0.538881 std(XS) = 0.347045 0.376888 0.362340 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: 2.70578 1.88830 -0.323823 2: -0.291211 12.7333 12.7028 3: 13.8451 13.6196 -1.21104 4: 6.67764 6.66005 6.51832 5: 12.8245 -1.64169 9.52947 6: 8.03105 8.72628 10.2215 7: 3.97202 -4.40747 8.63645 8: 1.68815 5.83658 6.95122 9: -2.15027 -4.28791 0.628256 10: -1.57706 -2.18244 2.94081 mean(X) = 4.57257 3.69446 5.65940 std(X) = 5.66963 6.78679 4.85769 max(X) = 13.8451 13.6196 12.7028 min(X) = -2.15027 -4.40747 -1.21104 New scale interval = [ -1.00000 , 1.00000 ] Matrix XS: Col 1 2 3 Row 1: -0.392818 -0.301520 -0.872470 2: -0.767551 0.901670 1.00000 3: 1.00000 1.00000 -1.00000 4: 0.103809 0.227879 0.111032 5: 0.872390 -0.693152 0.543861 6: 0.273034 0.457116 0.643339 7: -0.234492 -1.00000 0.415496 8: -0.520059 0.136521 0.173258 9: -1.00000 -0.986735 -0.735616 10: -0.928329 -0.753145 -0.403205 mean(XS) = -0.159401 -0.101137 -0.124307E-01 std(XS) = 0.708910 0.752957 0.698253 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.547717 0.547717 0.614586 0.614586 Solution / Computed: 0.821816E-01 0.821816E-01 0.164381 0.164381 Solution / Computed: 0.272178 0.272178 0.118701 0.118701 Solution / Computed: 0.175098 0.175098 0.748914 0.748914 Solution / Computed: 0.719637 0.719637 0.169742E-03 0.169742E-03 R8MAT_SOLVE_3D_TEST R8MAT_SOLVE_3D solves 3D linear systems. Solution / Computed: 0.307168 0.307168 0.798685 0.798685 0.949583 0.949583 Solution / Computed: 0.652005 0.652005 0.652798 0.652798 0.427211 0.427211 Solution / Computed: 0.767095 0.767095 0.921270E-01 0.921270E-01 0.932547 0.932547 Solution / Computed: 0.355613E-02 0.355613E-02 0.516491 0.516491 0.175275 0.175275 Solution / Computed: 0.876337 0.876337 0.368559E-01 0.368559E-01 0.749519 0.749519 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: 10.8072 14.8850 -3.21501 2: 5.59942 1.41806 4.95582 3: 0.804407 3.05436 11.6187 4: 14.6095 -4.66290 13.1193 5: 13.7684 0.245364 13.4060 6: 13.8838 -0.797548 -0.585216 7: 6.81375 5.91474 8.48910 8: -0.443225 12.8070 -0.660451 9: 11.7399 -4.99479 2.15542 10: 7.20136 6.56118 -2.68558 mean(X) = 8.47846 3.44305 4.65980 std(X) = 5.39578 6.69823 6.57682 max(X) = 14.6095 14.8850 13.4060 min(X) = -0.443225 -4.99479 -3.21501 Matrix XS: Col 1 2 3 Row 1: 0.431594 1.70820 -1.19736 2: -0.533572 -0.302316 0.450094E-01 3: -1.42223 -0.580281E-01 1.05809 4: 1.13626 -1.21016 1.28626 5: 0.980394 -0.477392 1.32985 6: 1.00178 -0.633092 -0.797501 7: -0.308520 0.369006 0.582241 8: -1.65346 1.39797 -0.808941 9: 0.604436 -1.25971 -0.380790 10: -0.236684 0.465517 -1.11686 mean(XS) = 0.555112E-17 0.138778E-15 -0.444089E-16 std(XS) = 1.00000 1.00000 1.00000 max(XS) = 1.13626 1.70820 1.32985 min(XS) = -1.65346 -1.25971 -1.19736 R8MAT_SYMM_JACOBI_TEST For a symmetric R8MAT: R8MAT_SYMM_JACOBI diagonalizes; Matrix to diagonalize: Col 1 2 3 4 5 Row 1: 3.68558 -0.313726 0.228967 0.576661E-01 1.25922 2: -0.313726 3.77631 0.391900E-01 0.899942E-01 0.545246 3: 0.228967 0.391900E-01 1.27817 -0.185470 0.624644 4: 0.576661E-01 0.899942E-01 -0.185470 2.96172 0.681753 5: 1.25922 0.545246 0.624644 0.681753 3.29822 Computed Eigenvalues: 5.00000 4.00000 1.00000 3.00000 2.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.247387 0.957843 0.618366 0.692141 0.134708 2: 0.334014 0.842524 0.139881 0.551417 0.328020 3: 0.778481 0.335550 0.170687 0.773496 0.434086 4: 0.514085 0.429953 0.574189 0.866943 0.258965 5: 0.953266 0.858959 0.280876 0.527808 0.481478 The pivot vector P: 1: 5 2: 5 3: 4 4: 5 5: 5 The compressed LU factors: Col 1 2 3 4 5 Row 1: 0.953266 0.858959 0.280876 0.527808 0.481478 2: -0.350389 0.734930 0.545475 0.555167 0.975719E-02 3: -0.816646 0.497891 0.447412 0.607438 -0.249155E-03 4: -0.539288 0.452754E-01 -0.475844 0.446806 0.151925 5: -0.259515 -0.736879 0.805707 -0.738197 -0.662849E-01 The recovered matrix A2: Col 1 2 3 4 5 Row 1: 0.247387 0.957843 0.618366 0.692141 0.134708 2: 0.334014 0.842524 0.139881 0.551417 0.328020 3: 0.778481 0.335550 0.170687 0.773496 0.434086 4: 0.514085 0.429953 0.574189 0.866943 0.258965 5: 0.953266 0.858959 0.280876 0.527808 0.481478 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: 2.15932 5.81400 7.57339 7.89035 2: 6.51796 4.62256 6.75749 8.14839 3: 2.64900 4.61460 7.61633 2.54474 4: 8.23667 3.13615 3.69767 8.77443 5: 5.73977 2.78128 2.29355 8.66001 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.775699 0.689823 0.173433 0.795112 0.974528 2: 0.330070 0.840275 0.300288 0.423490E-01 0.973960 3: 0.719992 0.319847 0.941157 0.315580 0.784355 4: 0.418687 0.487041 0.988156 0.225861 0.495599 5: 0.130824 0.881498E-01 0.927619 0.443818 0.789557E-01 The determinant = 0.750821E-01 R8PLU_INVERSE_TEST R8PLU_INVERSE determines the inverse of a matrix from its compressed PLU factors. Matrix order N = 5 The matrix A: Col 1 2 3 4 5 Row 1: 0.596611 0.930488 0.962836 0.871177 0.835932 2: 0.400594 0.939762 0.813403 0.391013E-01 0.667875 3: 0.944045 0.156067 0.315724 0.560314E-01 0.565001 4: 0.547439 0.397573E-01 0.211660E-01 0.444643 0.516612E-01 5: 0.727591 0.862904 0.622335 0.646550 0.180091 The inverse matrix B: Col 1 2 3 4 5 Row 1: -0.560285 -0.430925 1.08131 -0.297067 0.891592 2: -2.39436 6.79817 -4.30024 9.46463 -3.32123 3: 3.24603 -10.1001 6.38968 -16.6144 7.10933 4: 0.783550 -0.119115 -0.981148 1.74687 -0.618226 5: -0.294047 4.49800 -2.32227 6.99295 -4.48374 The product matrix C = A * B: Col 1 2 3 4 5 Row 1: 1.00000 0.292009E-14 0.128988E-14 0.132979E-14 -0.266454E-14 2: 0.182418E-15 1.00000 0.160760E-14 0.654975E-15 -0.222045E-14 3: -0.112898E-15 0.559257E-15 1.00000 0.389043E-15 -0.444089E-15 4: -0.298237E-17 0.169912E-15 -0.842555E-17 1.00000 -0.194289E-15 5: -0.265337E-15 0.175931E-14 0.104198E-14 -0.485518E-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.734772 0.506102 0.433608 0.485420 0.648421 2: 0.718512 0.285378 0.797278 0.310347 0.359634E-01 3: 0.345952 0.995546 0.606656 0.144786 0.288470E-01 4: 0.866399 0.885565E-01 0.632221 0.690248 0.536671 5: 0.645115 0.949937E-01 0.539274 0.726423 0.819872 The right hand side B (computed from A): 1: 8.2315831 2: 5.1023072 3: 4.8803893 4: 8.3845220 5: 9.4579736 The right hand side B (computed from PLU): 1: 8.2315831 2: 5.1023072 3: 4.8803893 4: 8.3845220 5: 9.4579736 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.172564 0.307353 0.724648 0.429010 0.360586 2: 0.928011 0.701658 0.690354 0.347659 0.392400 3: 0.935933 0.622811 0.781860 0.905657 0.622525 4: 0.179249E-01 0.208576 0.498562 0.906463 0.285452 5: 0.585891 0.995545E-01 0.394390 0.163245 0.282333 The right hand side B: 1: 6.4801818 2: 7.7550243 3: 11.262391 4: 6.9838741 5: 4.0328143 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.341054 0.811994 0.471320 0.619619E-01 0.667778 2: 0.448569 0.313277 0.771883E-01 0.931772 0.430006 3: 0.352957 0.776868 0.166783 0.708893 0.208162 4: 0.852227 0.316762 0.244510 0.562838E-01 0.216058 5: 0.411551 0.115576 0.894880 0.470731 0.280240 The pivot vector P: 1: 4 2: 4 3: 5 4: 4 5: 5 The compressed LU factors: Col 1 2 3 4 5 Row 1: 0.852227 0.316762 0.244510 0.562838E-01 0.216058 2: -0.526349 0.685228 0.373470 0.394376E-01 0.581313 3: -0.414158 -0.942282 0.797183 0.445703 0.207625 4: -0.400192 -0.213870 0.164809 0.967169 0.226176 5: -0.482912 0.545696E-01 0.359261 -0.835992 -0.543571 The recovered matrix A2: Col 1 2 3 4 5 Row 1: 0.341054 0.811994 0.471320 0.619619E-01 0.667778 2: 0.448569 0.313277 0.771883E-01 0.931772 0.430006 3: 0.352957 0.776868 0.166783 0.708893 0.208162 4: 0.852227 0.316762 0.244510 0.562838E-01 0.216058 5: 0.411551 0.115576 0.894880 0.470731 0.280240 R8ROWS_TO_R8MAT_TEST R8ROWS_TO_R8MAT allows an R8MAT to be initialized by data stored ROW-WISE in a vector. The data vector: 1: 11.000000 2: 12.000000 3: 13.000000 4: 14.000000 5: 21.000000 6: 22.000000 7: 23.000000 8: 24.000000 9: 31.000000 10: 32.000000 11: 33.000000 12: 34.000000 The data copied into an array: Col 1 2 3 4 Row 1: 11.0000 12.0000 13.0000 14.0000 2: 21.0000 22.0000 23.0000 24.0000 3: 31.0000 32.0000 33.0000 34.0000 R8SLMAT_PRINT_TEST R8SLMAT_PRINT prints a strictly lower triangular matrix stored compactly. Only the (possibly) nonzero elements are printed. R8SLMAT Col 1 2 3 4 5 6 Row 2 21 3 31 32 4 41 42 43 5 51 52 53 54 6 61 62 63 64 65 7 71 72 73 74 75 76 R8SLMAT Col 1 2 3 Row 2 21 3 31 32 4 41 42 43 5 51 52 53 6 61 62 63 7 71 72 73 R8SLMAT Col 1 2 3 Row 2 21 3 31 32 4 41 42 43 R8VEC_AMAX_TEST For a R8VEC: R8VEC_AMAX: maximum magnitude entry; Input vector: 1: -1.1821659 2: 1.3128848 3: 3.8628197 4: 0.51010551 5: -4.6678094 6: -4.3246166 7: 1.3771006 8: -3.4541001 9: -0.91921703 10: -0.28583129 Maximum absolute: 4.66781 R8VEC_AMIN_TEST For a R8VEC: R8VEC_AMIN: minimum magnitude entry. Input vector: 1: -1.3150588 2: 4.4430828 3: 7.7913391 4: -5.9618161 5: 7.9640220 6: -8.6904971 7: -0.39626212 8: 7.6853571 9: 5.2398055 10: -2.5501340 Minimum absolute: 0.396262 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: -2.0471860 2: 7.1024434 3: 9.6310490 4: -8.3559767 5: 2.9477551 Vector V2: 1: 0.86873110 2: 2.4209141 3: -1.4091802 4: 2.1447146 5: 5.6693189 L-Infinity norm of V1-V2 = 11.0402 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.325295 0.823307 2 0.407486 0.925605 3 0.286714 0.909414 4 0.655242 0.280506 5 0.505463 0.654928 6 0.472895E-01 0.653750 7 0.613335 0.121633 8 0.184791 0.303961 9 0.160741 0.833263 10 0.662194 0.381572 V1 dot V2 = 1.96887 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.29945442 2: 0.16977371 3: 0.60203005 4: 0.45536738 5: 0.28058497 6: 0.47969039 7: 0.33343142 8: 0.18663477 9: 0.33222638 10: 0.59869477 Fractile Value 1 0.169774 6 0.333431 R8VEC_HEAP_D_EXTRACT_TEST For a heap descending sorted R8VEC, R8VEC_HEAP_D_EXTRACT extracts the maximum value; Inserting value 0.5397 Current maximum value is 0.5397 Inserting value 7.4910 Current maximum value is 7.4910 Inserting value 2.1808 Current maximum value is 7.4910 Inserting value 1.9202 Current maximum value is 7.4910 Inserting value 9.9666 Current maximum value is 9.9666 Inserting value 8.1576 Current maximum value is 9.9666 Inserting value 2.4157 Current maximum value is 9.9666 Inserting value 6.0322 Current maximum value is 9.9666 Inserting value 3.1887 Current maximum value is 9.9666 Inserting value 8.5121 Current maximum value is 9.9666 Current heap as a vector: 1: 9.9665775 2: 8.5121031 3: 8.1575581 4: 6.0322154 5: 7.4910075 6: 2.1808159 7: 2.4157106 8: 0.53967124 9: 3.1886842 10: 1.9202145 Now extract the maximum several times. Extracting maximum element = 9.9666 Extracting maximum element = 8.5121 Extracting maximum element = 8.1576 Extracting maximum element = 7.4910 Extracting maximum element = 6.0322 Current heap as a vector: 1: 3.1886842 2: 2.4157106 3: 2.1808159 4: 1.9202145 5: 0.53967124 R8VEC_HEAP_D_INSERT_TEST For a heap descending sorted R8VEC, R8VEC_HEAP_D_INSERT inserts a value into the heap. Inserting value 5.5445 Current maximum value is 5.5445 Inserting value 5.2243 Current maximum value is 5.5445 Inserting value 6.7374 Current maximum value is 6.7374 Inserting value 7.5566 Current maximum value is 7.5566 Inserting value 3.2314 Current maximum value is 7.5566 Inserting value 8.0120 Current maximum value is 8.0120 Inserting value 1.3819 Current maximum value is 8.0120 Inserting value 3.1984 Current maximum value is 8.0120 Inserting value 5.1956 Current maximum value is 8.0120 Inserting value 0.3175 Current maximum value is 8.0120 Current heap as a vector: 1: 8.0120211 2: 6.7373823 3: 7.5565555 4: 5.2243108 5: 3.2313614 6: 5.5444682 7: 1.3819124 8: 3.1984064 9: 5.1955919 10: 0.31747039 R8VEC_HEAP_D_MAX_TEST For a heap descending sorted R8VEC, R8VEC_HEAP_D_MAX reports the maximum value. Inserting value 1.5483 Current maximum value is 1.5483 Inserting value 0.7316 Current maximum value is 1.5483 Inserting value 3.9993 Current maximum value is 3.9993 Inserting value 9.7802 Current maximum value is 9.7802 Inserting value 1.8315 Current maximum value is 9.7802 Inserting value 0.8118 Current maximum value is 9.7802 Inserting value 3.1783 Current maximum value is 9.7802 Inserting value 0.3187 Current maximum value is 9.7802 Inserting value 4.8692 Current maximum value is 9.7802 Inserting value 2.0680 Current maximum value is 9.7802 Current heap as a vector: 1: 9.7801984 2: 4.8691640 3: 3.1783128 4: 3.9993002 5: 2.0679850 6: 0.81182703 7: 1.5482891 8: 0.31867500 9: 0.73157561 10: 1.8314977 R8VEC_HISTOGRAM_TEST R8VEC_HISTOGRAM histograms an R8VEC. Uniform data: Histogram of data: 0.0000 0 0.0000 0.0500 63 0.0500 0.1000 40 0.1000 0.1500 43 0.1500 0.2000 48 0.2000 0.2500 57 0.2500 0.3000 44 0.3000 0.3500 48 0.3500 0.4000 67 0.4000 0.4500 43 0.4500 0.5000 44 0.5000 0.5500 61 0.5500 0.6000 63 0.6000 0.6500 39 0.6500 0.7000 57 0.7000 0.7500 49 0.7500 0.8000 39 0.8000 0.8500 47 0.8500 0.9000 51 0.9000 0.9500 53 0.9500 1.0000 44 1.0000 0 Normal data: Histogram of data: -3.0000 0 -3.0000 -2.7000 3 -2.7000 -2.4000 2 -2.4000 -2.1000 5 -2.1000 -1.8000 23 -1.8000 -1.5000 35 -1.5000 -1.2000 49 -1.2000 -0.9000 69 -0.9000 -0.6000 80 -0.6000 -0.3000 107 -0.3000 0.0000 116 0.0000 0.3000 132 0.3000 0.6000 92 0.6000 0.9000 108 0.9000 1.2000 62 1.2000 1.5000 52 1.5000 1.8000 31 1.8000 2.1000 12 2.1000 2.4000 17 2.4000 2.7000 2 2.7000 3.0000 2 3.0000 1 R8VEC_HOUSE_COLUMN_TEST R8VEC_HOUSE_COLUMN returns the compact form of a Householder matrix that "packs" a column of a matrix. Matrix A: Col 1 2 3 4 Row 1: 1.71709 -2.94703 -3.45691 2.55816 2: -3.46978 -2.41259 3.15924 -4.25043 3: 0.982178 3.83208 2.46034 3.43265 4: -3.48503 -2.32535 4.53603 0.447624 Working on column K = 1 Householder matrix H: Col 1 2 3 4 Row 1: -0.323934 0.654584 -0.185291 0.657461 2: 0.654584 0.676359 0.916120E-01 -0.325064 3: -0.185291 0.916120E-01 0.974068 0.920147E-01 4: 0.657461 -0.325064 0.920147E-01 0.673507 Product H*A: Col 1 2 3 4 Row 1: -5.30074 -2.86347 5.71418 -3.95268 2: 0.666134E-15 -2.45390 -1.37516 -1.03132 3: -0.222045E-15 3.84378 3.74388 2.52143 4: 0.888178E-15 -2.36684 -0.183011E-01 3.68088 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.477607 0.748119 -0.460662 3: 0.00000 0.748119 0.621224 0.233235 4: 0.00000 -0.460662 0.233235 0.856383 Product H*A: Col 1 2 3 4 Row 1: -5.30074 -2.86347 5.71418 -3.95268 2: -0.893416E-15 5.13792 3.46608 0.683251 3: 0.567563E-15 0.444089E-15 1.29274 1.65333 4: 0.401970E-15 -0.333067E-15 1.49101 4.21542 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.655082 -0.755558 4: 0.00000 0.00000 -0.755558 0.655082 Product H*A: Col 1 2 3 4 Row 1: -5.30074 -2.86347 5.71418 -3.95268 2: -0.893416E-15 5.13792 3.46608 0.683251 3: -0.675512E-15 -0.392634E-16 -1.97340 -4.26806 4: -0.165504E-15 -0.553721E-15 0.00000 1.51226 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. 9.00 16.00 8.00 10.00 6.00 6.00 9.00 14.00 1.00 18.00 5.00 1.00 15.00 7.00 1.00 14.00 9.00 1.00 16.00 16.00 Indexed list of entries: I INDX(I) X(I) X(INDX(I)) 1 11 8.00 1.00 2 20 7.00 1.00 3 17 9.00 1.00 4 14 16.00 1.00 5 13 8.00 5.00 6 7 10.00 6.00 7 8 6.00 6.00 8 2 6.00 7.00 9 23 9.00 7.00 10 16 14.00 7.00 11 1 1.00 8.00 12 5 18.00 8.00 13 24 5.00 8.00 14 3 1.00 9.00 15 19 15.00 9.00 16 9 7.00 9.00 17 6 1.00 10.00 18 10 14.00 14.00 19 18 9.00 14.00 20 15 1.00 15.00 21 4 16.00 16.00 22 22 16.00 16.00 23 21 7.00 16.00 24 12 8.00 18.00 R8VEC_INDEX_DELETE_ALL_TEST R8VEC_INDEX_DELETE_ALL deletes all copies of a particular value. 12.00 13.00 8.00 0.00 5.00 9.00 12.00 0.00 14.00 18.00 10.00 2.00 17.00 13.00 16.00 0.00 3.00 7.00 16.00 8.00 Indexed list of entries: I INDX(I) X(I) X(INDX(I)) 1 6 8.00 0.00 2 18 7.00 0.00 3 10 12.00 0.00 4 14 13.00 2.00 5 19 8.00 3.00 6 7 0.00 5.00 7 2 5.00 7.00 8 20 9.00 7.00 9 23 12.00 7.00 10 1 0.00 8.00 11 22 14.00 8.00 12 5 18.00 8.00 13 24 10.00 8.00 14 8 2.00 9.00 15 13 17.00 10.00 16 3 13.00 12.00 17 9 16.00 12.00 18 4 0.00 13.00 19 16 3.00 13.00 20 11 7.00 14.00 21 17 16.00 16.00 22 21 8.00 16.00 23 15 7.00 17.00 24 12 8.00 18.00 Indexed list of entries: I INDX(I) X(I) X(INDX(I)) 1 5 8.00 0.00 2 17 12.00 0.00 3 9 13.00 0.00 4 13 8.00 2.00 5 18 0.00 3.00 6 6 5.00 5.00 7 1 9.00 8.00 8 20 12.00 8.00 9 4 0.00 8.00 10 21 14.00 8.00 11 7 18.00 9.00 12 12 10.00 10.00 13 2 2.00 12.00 14 8 17.00 12.00 15 3 13.00 13.00 16 15 16.00 13.00 17 10 0.00 14.00 18 16 3.00 16.00 19 19 16.00 16.00 20 14 8.00 17.00 21 11 8.00 18.00 R8VEC_INDEX_DELETE_DUPES_TEST R8VEC_INDEX_DELETE_DUPES deletes duplicates. Generate some random values: 15.00 18.00 18.00 3.00 18.00 8.00 18.00 16.00 4.00 14.00 16.00 4.00 15.00 18.00 18.00 4.00 9.00 1.00 2.00 6.00 Indexed list of entries: I INDX(I) X(I) X(INDX(I)) 1 20 8.00 1.00 2 21 7.00 2.00 3 6 15.00 3.00 4 11 18.00 4.00 5 14 18.00 4.00 6 18 3.00 4.00 7 22 18.00 6.00 8 2 8.00 7.00 9 23 18.00 7.00 10 1 16.00 8.00 11 24 4.00 8.00 12 8 14.00 8.00 13 19 16.00 9.00 14 12 4.00 14.00 15 3 15.00 15.00 16 15 18.00 15.00 17 10 18.00 16.00 18 13 4.00 16.00 19 4 9.00 18.00 20 5 1.00 18.00 21 7 2.00 18.00 22 9 6.00 18.00 23 16 7.00 18.00 24 17 8.00 18.00 Call R8VEC_INDEX_DELETE_DUPES to delete duplicates: Indexed list of unique entries: I INDX(I) X(I) 1 1 1.00 2 2 2.00 3 3 3.00 4 4 4.00 5 5 6.00 6 6 7.00 7 7 8.00 8 8 9.00 9 9 14.00 10 10 15.00 11 11 16.00 12 12 18.00 R8VEC_INDEX_DELETE_ONE_TEST R8VEC_INDEX_DELETE_ONE deletes one copies of a particular value. 3.00 13.00 12.00 7.00 9.00 1.00 1.00 19.00 13.00 19.00 1.00 0.00 16.00 1.00 3.00 7.00 15.00 5.00 10.00 18.00 Indexed list of entries: I INDX(I) X(I) X(INDX(I)) 1 14 8.00 0.00 2 8 7.00 1.00 3 13 3.00 1.00 4 9 13.00 1.00 5 16 12.00 1.00 6 3 7.00 3.00 7 17 9.00 3.00 8 20 1.00 5.00 9 2 1.00 7.00 10 6 19.00 7.00 11 18 13.00 7.00 12 23 19.00 7.00 13 1 1.00 8.00 14 24 0.00 8.00 15 7 16.00 9.00 16 21 1.00 10.00 17 5 3.00 12.00 18 4 7.00 13.00 19 11 15.00 13.00 20 19 5.00 15.00 21 15 10.00 16.00 22 22 18.00 18.00 23 10 7.00 19.00 24 12 8.00 19.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 7.00 0.00 2 7 3.00 1.00 3 12 13.00 1.00 4 8 12.00 1.00 5 15 7.00 1.00 6 2 9.00 3.00 7 16 1.00 3.00 8 19 1.00 5.00 9 1 19.00 7.00 10 5 13.00 7.00 11 17 19.00 7.00 12 22 1.00 7.00 13 23 0.00 8.00 14 6 16.00 9.00 15 20 1.00 10.00 16 4 3.00 12.00 17 3 7.00 13.00 18 10 15.00 13.00 19 18 5.00 15.00 20 14 10.00 16.00 21 21 18.00 18.00 22 9 7.00 19.00 23 11 8.00 19.00 R8VEC_INDEX_INSERT_UNIQUE_TEST R8VEC_INDEX_INSERT_UNIQUE inserts unique values into an index sorted array. Generate some random values: 10.00 10.00 10.00 3.00 4.00 11.00 13.00 19.00 3.00 1.00 13.00 10.00 15.00 5.00 14.00 3.00 8.00 14.00 8.00 15.00 Indexed list of entries: I INDX(I) X(I) X(INDX(I)) 1 7 10.00 1.00 2 2 3.00 3.00 3 3 4.00 4.00 4 9 11.00 5.00 5 11 13.00 8.00 6 1 19.00 10.00 7 4 1.00 11.00 8 5 15.00 13.00 9 10 5.00 14.00 10 8 14.00 15.00 11 6 8.00 19.00 R8VEC_INDEX_ORDER_TEST R8VEC_INDEX_ORDER sorts an index sorted array. Generate some random values: 9.00 1.00 8.00 17.00 5.00 2.00 11.00 2.00 9.00 19.00 13.00 6.00 10.00 9.00 10.00 11.00 10.00 8.00 7.00 10.00 Indexed list of unique entries: I INDX(I) X(I) X(INDX(I)) 1 2 9.00 1.00 2 6 1.00 2.00 3 5 8.00 5.00 4 10 17.00 6.00 5 12 5.00 7.00 6 3 2.00 8.00 7 1 11.00 9.00 8 11 19.00 10.00 9 7 13.00 11.00 10 9 6.00 13.00 11 4 10.00 17.00 12 8 7.00 19.00 Now call R8VEC_INDEX_ORDER to carry out the sorting: X: 1: 1.0000000 2: 2.0000000 3: 5.0000000 4: 6.0000000 5: 7.0000000 6: 8.0000000 7: 9.0000000 8: 10.000000 9: 11.000000 10: 13.000000 11: 17.000000 12: 19.000000 R8VEC_INDEX_SEARCH_TEST R8VEC_INDEX_SEARCH searches for an entry with a given value. Generate some random values: 17.00 13.00 10.00 2.00 7.00 3.00 10.00 6.00 2.00 4.00 19.00 10.00 5.00 3.00 8.00 4.00 5.00 4.00 14.00 16.00 Indexed list of entries: I INDX(I) X(I) X(INDX(I)) 1 4 17.00 2.00 2 6 13.00 3.00 3 8 10.00 4.00 4 10 2.00 5.00 5 7 7.00 6.00 6 5 3.00 7.00 7 11 6.00 8.00 8 3 4.00 10.00 9 2 19.00 13.00 10 12 5.00 14.00 11 13 8.00 16.00 12 1 14.00 17.00 13 9 16.00 19.00 Results of search for given XVAL: XVAL Less Equal More 0.00 0 0 1 1.00 0 0 1 2.00 0 1 2 3.00 1 2 3 4.00 2 3 4 5.00 3 4 5 6.00 4 5 6 7.00 5 6 7 8.00 6 7 8 9.00 7 0 8 10.00 7 8 9 11.00 8 0 9 12.00 8 0 9 13.00 8 9 10 14.00 9 10 11 15.00 10 0 11 16.00 10 11 12 17.00 11 12 13 18.00 12 0 13 19.00 12 13 14 20.00 13 0 14 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.94565125 2: 0.67863551 3: 0.80968851 4: 0.65254317 5: 0.27863465 6: 0.93225945 7: 0.46741316 8: 0.41598990 9: 0.97098528 10: 0.16082335 11: 0.75256781 12: 0.65981824 13: 0.44138002 14: 0.50758017 15: 0.53947961 16: 0.36500426 17: 0.96489063 18: 0.19181279 19: 0.72990317 20: 0.63440480 I INDX R(INDX(I)) 1 10 0.160823 2 18 0.191813 3 5 0.278635 4 16 0.365004 5 8 0.415990 6 13 0.441380 7 7 0.467413 8 14 0.507580 9 15 0.539480 10 20 0.634405 11 4 0.652543 12 12 0.659818 13 2 0.678636 14 19 0.729903 15 11 0.752568 16 3 0.809689 17 6 0.932259 18 1 0.945651 19 17 0.964891 20 9 0.970985 R_LO 0.707873 14 19 0.729903 15 11 0.752568 R_HI 0.806357 Array 1: 0.85907868E-01 2: 0.24114943 3: 0.66102455 4: 0.41809806E-01 5: 0.15863058 6: 0.42792309E-02 7: 0.79190988E-01 8: 0.25050699 9: 0.70358897 10: 0.53187061 11: 0.46368613E-01 12: 0.81497516 13: 0.38155925 14: 0.68251385 15: 0.17761961 16: 0.70834720 17: 0.17291524 18: 0.91057694 19: 0.18209508E-01 20: 0.30874352 I INDX R(INDX(I)) 1 6 0.427923E-02 2 19 0.182095E-01 3 4 0.418098E-01 4 11 0.463686E-01 5 7 0.791910E-01 6 1 0.859079E-01 7 5 0.158631 8 17 0.172915 9 15 0.177620 10 2 0.241149 11 8 0.250507 12 20 0.308744 13 13 0.381559 14 10 0.531871 15 3 0.661025 16 14 0.682514 17 9 0.703589 18 16 0.708347 19 12 0.814975 20 18 0.910577 R_LO 0.596740 15 3 0.661025 16 14 0.682514 17 9 0.703589 18 16 0.708347 19 12 0.814975 R_HI 0.839855 Array 1: 0.21474358 2: 0.78004327 3: 0.40237019 4: 0.85978447 5: 0.32686131 6: 0.10967264 7: 0.16890281 8: 0.26166473 9: 0.12976239 10: 0.11045190E-01 11: 0.70277271 12: 0.11968210E-01 13: 0.83851887 14: 0.10957460 15: 0.65049748 16: 0.88051198 17: 0.21050111 18: 0.10440248E-01 19: 0.28454221 20: 0.79044879E-01 I INDX R(INDX(I)) 1 18 0.104402E-01 2 10 0.110452E-01 3 12 0.119682E-01 4 20 0.790449E-01 5 14 0.109575 6 6 0.109673 7 9 0.129762 8 7 0.168903 9 17 0.210501 10 1 0.214744 11 8 0.261665 12 19 0.284542 13 5 0.326861 14 3 0.402370 15 15 0.650497 16 11 0.702773 17 2 0.780043 18 13 0.838519 19 4 0.859784 20 16 0.880512 R_LO 0.312375 13 5 0.326861 14 3 0.402370 15 15 0.650497 R_HI 0.658343 Array 1: 0.40321568 2: 0.24998357 3: 0.15740472 4: 0.77546041 5: 0.17789282E-01 6: 0.78896258 7: 0.88248670 8: 0.79521072 9: 0.42715454E-01 10: 0.67390850 11: 0.70714068 12: 0.23762187 13: 0.28418672 14: 0.26426741 15: 0.99902612 16: 0.69600080 17: 0.18400022 18: 0.26501787 19: 0.69160703 20: 0.24108067 I INDX R(INDX(I)) 1 5 0.177893E-01 2 9 0.427155E-01 3 3 0.157405 4 17 0.184000 5 12 0.237622 6 20 0.241081 7 2 0.249984 8 14 0.264267 9 18 0.265018 10 13 0.284187 11 1 0.403216 12 10 0.673908 13 19 0.691607 14 16 0.696001 15 11 0.707141 16 4 0.775460 17 6 0.788963 18 8 0.795211 19 7 0.882487 20 15 0.999026 R_LO 0.366666 11 1 0.403216 R_HI 0.534175 Array 1: 0.59168579 2: 0.93574468 3: 0.73108640 4: 0.46421247 5: 0.60236766 6: 0.14249705 7: 0.37756890 8: 0.29066830 9: 0.13324307 10: 0.88782906 11: 0.23667836E-01 12: 0.53711579 13: 0.87042019 14: 0.62250516 15: 0.81995860 16: 0.75739795 17: 0.68916644 18: 0.45204799E-01 19: 0.81728902 20: 0.37812741 I INDX R(INDX(I)) 1 11 0.236678E-01 2 18 0.452048E-01 3 9 0.133243 4 6 0.142497 5 8 0.290668 6 7 0.377569 7 20 0.378127 8 4 0.464212 9 12 0.537116 10 1 0.591686 11 5 0.602368 12 14 0.622505 13 17 0.689166 14 3 0.731086 15 16 0.757398 16 19 0.817289 17 15 0.819959 18 13 0.870420 19 10 0.887829 20 2 0.935745 R_LO 0.648315 13 17 0.689166 14 3 0.731086 R_HI 0.738844 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: 8.5829651 2: 6.3558521 3: -4.0806463 4: -7.3473410 5: -2.6814124 6: 2.7341888 7: 7.9981740 8: -1.6096790 9: 4.5807193 10: -7.4525473 Maximum: 8.58297 R8VEC_MAX_ABS_INDEX_TEST R8VEC_MAX_ABS_INDEX: index of entry of maximum absolute value; Input vector: 1: 6.6354064 2: 8.9849470 3: -5.4435052 4: -7.7616382 5: -1.6264800 6: 8.0434323 7: 4.5080155 8: -7.8996699 9: 5.0572599 10: 6.8168124 Index of entry of maximum absolute value: 2 R8VEC_MAX_INDEX_TEST For a R8VEC: R8VEC_MAX_INDEX: index of maximum entry; Input vector: 1: -3.2734651 2: 6.4599844 3: 4.6789475 4: -3.6325984 5: -1.9331234 6: 0.98676272 7: 1.7353841 8: -4.6582158 9: -4.8310705 10: 5.8732541 Maximum index: 2 R8VEC_MEAN_TEST For a R8VEC: R8VEC_MEAN: mean value; Input vector: 1: 1.8627638 2: 9.9024276 3: -6.5347390 4: 2.8222395 5: -2.0704726 6: -7.7771207 7: 9.3796496 8: -9.8751631 9: 5.7434962 10: -1.9963884 Mean: 0.145669 R8VEC_MEAN_GEOMETRIC_TEST R8VEC_MEAN_GEOMETRIC computes the geometric mean of an R8VEC. Input vector: 1: 3.6601834 2: 3.1480284 3: 0.11446148 4: 4.7108416 5: 1.6136561 6: 0.20438263 7: 3.2952184 8: 2.3903092 9: 1.6567926 10: 0.17404442 Geometric mean: 1.16622 R8VEC_MEAN_RUNNING_TEST R8VEC_MEAN_RUNNING returns the running averages of an R8VEC. Random R8VEC: 1: -2.3190124 2: -4.0243121 3: -1.3856776 4: -2.2099408 5: 0.55941874 6: -4.0207027 7: 1.7585839 8: 7.0500079 9: 9.9985083 10: 0.39846391 Running averages: 1: 0.0000000 2: -2.3190124 3: -3.1716623 4: -2.5763340 5: -2.4847357 6: -1.8759048 7: -2.2333711 8: -1.6630919 9: -0.57395438 10: 0.60076369 11: 0.58053371 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.193602 0.193602 0.193602 2 0.402339 0.297970 0.297970 3 0.421605 0.339182 0.339182 4 0.254537 0.318021 0.318021 5 0.407823 0.335981 0.335981 6 0.892344 0.428708 0.428708 7 0.646451 0.459814 0.459814 8 0.328303E-01 0.406441 0.406441 9 0.286439 0.393108 0.393108 10 0.801609 0.433958 0.433958 R8VEC_MEDIAN_TEST For a R8VEC: R8VEC_MEDIAN: median value; Input vector: 1: 2.0532640 2: 8.1642668 3: -4.6487913 4: -9.5958347 5: 7.0563781 6: 8.2426875 7: -5.3155461 8: 4.6843355 9: -1.9630001 10: -4.2061523 Median: -1.96300 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.4208216 2: 2.1999003 3: 2.7695448 4: -4.8047162 5: 0.24414336 6: -0.37934980 7: -6.5283177 8: 6.4928648 9: 0.14813785 10: 6.8457016 Minimum: -6.52832 R8VEC_MIN_INDEX_TEST For a R8VEC: R8VEC_MIN_INDEX: index of minimum entry; Input vector: 1: 2.6468111 2: -3.3166169 3: 5.2963094 4: -7.6573306 5: 7.9738608 6: -7.0256295 7: -5.0399307 8: 4.3429980 9: -1.7884298 10: -5.4010581 Minimum index: 4 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.1614314 2: 4.4347797 3: -1.7128141 4: 1.9185719 5: 4.6693982 Rounded vector A: 1: 1.0000000 2: 4.0000000 3: -2.0000000 4: 2.0000000 5: 5.0000000 R8VEC_NORM_TEST R8VEC_NORM computes the L2 norm of an R8VEC. Vector X: 1: -2.0038605 2: -1.2502262 3: -2.5131250 4: -1.4828821 5: 7.6215395 R8VEC_NORM ( X ) = 8.49595 R8VEC_NORM_AFFINE_TEST R8VEC_NORM_AFFINE computes the L2 norm of the difference of two R8VECs. R8VEC_NORM_AFFINE(X,Y) = 17.8679 R8VEC_NORM (X-Y): 17.8679 R8VEC_NORM_L0_TEST R8VEC_NORM_L0 computes the L0 "norm" of an R8VEC. Input vector: 1: 0.0000000 2: -1.0000000 3: -2.0000000 4: -1.0000000 5: 2.0000000 6: -1.0000000 7: 2.0000000 8: 1.0000000 9: 1.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: 1.1975605 2: -9.7988111 3: -2.1411894 4: -1.0120207 5: -6.8512502 6: -8.2398462 7: 4.0273174 8: 5.3448086 9: -2.6317055 10: 6.0835038 L1 norm: 47.3280 R8VEC_NORM_L2_TEST R8VEC_NORM_L2 computes the L2 norm of an R8VEC. Input vector: 1: 1.8747472 2: -1.0436357 3: 9.5446057 4: -5.8774372 5: 0.58620198 6: 9.4970509 7: -8.9019000 8: 4.4555243 9: 6.6422721 10: -2.4413688 L2 norm: 19.2344 R8VEC_NORM_LI_TEST R8VEC_NORM_LI computes the Loo norm of an R8VEC. Input vector: 1: -3.9801690 2: 9.8320710 3: -4.4403250 4: 5.4672549 5: 4.8642816 6: 4.5090101 7: 7.8320998 8: 4.7790299 9: -2.0836032 10: 9.0115436 L-Infinity norm: 9.83207 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.877517 2: 14.713573 3: 15.273458 4: 15.031255 5: 14.897332 6: 14.729637 7: 14.970996 8: 14.593630 9: 15.379930 10: 14.634676 R8VEC_NORMALIZE_L1_TEST For a R8VEC: R8VEC_NORMALIZE_L1: make unit sum; Input vector: 1: -2.9452254 2: -3.1537811 3: 8.2387918 4: -2.4084657 5: 0.65436449 6: -4.0469103 7: -8.4401625 8: -3.7499952 9: 1.6907675 10: -2.2365719 After calling R8VEC_NORMALIZE_L1: 1: 0.17961771 2: 0.19233670 3: -0.50245149 4: 0.14688285 5: -0.39907115E-01 6: 0.24680514 7: 0.51473230 8: 0.22869745 9: -0.10311326 10: 0.13639972 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: 101.00000 2: 107.00000 3: 102.00000 4: 109.00000 5: 103.00000 6: 104.00000 7: 108.00000 8: 106.00000 9: 110.00000 10: 105.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.0041630 2: 1.8646776 3: -1.2428091 4: 14.987237 5: 0.29411780 6: 7.3954542 7: 2.7285273 8: -0.39435094 9: -4.4876562 10: 2.5895162 mean(X) = 2.77389 std(X) = 5.07890 max(X) = 14.9872 min(X) = -4.48766 Vector XS: 1: 0.43603932 2: 0.32618067 3: 0.16661694 4: 1.0000000 5: 0.24553531 6: 0.61017589 7: 0.37053777 8: 0.21018371 9: 0.0000000 10: 0.36339980 mean(XS) = 0.372867 std(XS) = 0.260792 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: 10.520665 2: -4.2178969 3: 11.176788 4: 5.9670459 5: -3.4222777 6: 13.179837 7: -1.4933175 8: -4.8152913 9: 6.3852851 10: 8.9513212 mean(X) = 4.22322 std(X) = 6.65117 max(X) = 13.1798 min(X) = -4.81529 Using interval [ -1.00000 , 1.00000 ] Vector XS: 1: 0.70445651 2: -0.93360487 3: 0.77737881 4: 0.19836184 5: -0.84517881 6: 1.0000000 7: -0.63079186 8: -1.0000000 9: 0.24484544 10: 0.53003775 mean(XS) = 0.455048E-02 std(XS) = 0.739219 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.22068129E-01 2: 0.79124562E-01 3: 0.81049014E-01 4: 0.20084934 5: 0.20912075 6: 0.40458243 7: 0.43263784 8: 0.51824142 9: 0.55289510 10: 0.57064119 Search the array for the value 0.552895 SEARCH RESULT: The value occurs in index 9 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: 5.1423599 2: 8.0653041 3: 3.7023256 4: -0.31857168 5: 4.9847382 6: -0.30745814 7: -3.8823304 8: 7.9013520 9: 2.4136541 10: 2.6157239 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 -2.80303 0.443518E-02 2 -2.80003 0.444853E-02 3 -1.53834 0.157094E-01 4 -6.13339 0.158692E-03 5 -9.84408 0.388170E-05 6 -1.71373 0.131823E-01 7 -6.30657 0.133458E-03 8 2.50339 0.894250 9 -0.903167E-01 0.668387E-01 10 -4.46732 0.839694E-03 R8VEC_SORT_BUBBLE_A_TEST R8VEC_SORT_BUBBLE_A ascending sorts a R8VEC. Original array: 1: 8.0225181 2: 44.305081 3: 39.724830 4: 20.318481 5: 11.799077 6: 8.1093256 7: 12.716759 8: 12.763200 9: 13.235102 10: 56.988504 Ascending sorted array: 1: 3.8036529 2: 8.0225181 3: 8.1093256 4: 11.104438 5: 11.611266 6: 11.799077 7: 12.716759 8: 12.763200 9: 13.235102 10: 17.590404 R8VEC_SORT_HEAP_A_TEST R8VEC_SORT_HEAP_A ascending sorts a R8VEC. Original array: 1: 41.695457 2: 3.8605710 3: 51.987957 4: 33.360038 5: 16.357168 6: 9.9303340 7: 17.698765 8: 3.6887970 9: 45.791266 10: 44.275254 Ascending sorted array: 1: 1.5844553 2: 3.6887970 3: 3.8605710 4: 9.0725298 5: 9.9303340 6: 16.357168 7: 17.698765 8: 17.722827 9: 17.769296 10: 20.081657 R8VEC_SORT_HEAP_D_TEST R8VEC_SORT_HEAP_D descending sorts a R8VEC. Original array: 1: 20.748871 2: 3.2639969 3: 11.553597 4: 50.246802 5: 31.137961 6: 36.067677 7: 36.715239 8: 51.551929 9: 3.7767497 10: 24.898162 Descending sorted array: 1: 55.337829 2: 55.294699 3: 54.652817 4: 51.551929 5: 50.246802 6: 43.711238 7: 37.643330 8: 36.715239 9: 36.067677 10: 34.008846 R8VEC_SORT_HEAP_INDEX_A_TEST R8VEC_SORT_HEAP_INDEX_A creates an ascending sort index for a R8VEC. Unsorted array: 1: 16.302682 2: 7.5953290 3: 6.6659273 4: 14.737604 5: 57.327214 6: 19.374173 7: 0.18859311 8: 31.829791 9: 0.94320882 10: 9.8534711 After indexed ascending sort: I, INDX(I), A(I) 1 7 16.3027 2 9 7.59533 3 3 6.66593 4 2 14.7376 5 19 57.3272 6 10 19.3742 7 16 0.188593 8 17 31.8298 9 4 0.943209 10 1 9.85347 11 6 26.0515 12 11 54.5262 13 8 42.8147 14 14 32.4547 15 20 44.5678 16 13 11.2524 17 18 12.0089 18 15 43.1244 19 12 9.41226 20 5 35.2330 Now use the index array to carry out the permutation implicitly. INDX(I), A(INDX(I)) 7 0.188593 9 0.943209 3 6.66593 2 7.59533 19 9.41226 10 9.85347 16 11.2524 17 12.0089 4 14.7376 1 16.3027 6 19.3742 11 26.0515 8 31.8298 14 32.4547 20 35.2330 13 42.8147 18 43.1244 15 44.5678 12 54.5262 5 57.3272 Call R8VEC_PERMUTE to carry out the permutation explicitly. I, A(I) 1: 0.18859311 2: 0.94320882 3: 6.6659273 4: 7.5953290 5: 9.4122647 6: 9.8534711 7: 11.252373 8: 12.008899 9: 14.737604 10: 16.302682 11: 19.374173 12: 26.051487 13: 31.829791 14: 32.454729 15: 35.233043 16: 42.814746 17: 43.124425 18: 44.567781 19: 54.526217 20: 57.327214 R8VEC_SORT_HEAP_INDEX_D_TEST R8VEC_SORT_HEAP_INDEX_D creates a descending sort index for a R8VEC. Unsorted array: 1: 4.2917978 2: 56.226911 3: 9.1588270 4: 48.870350 5: 51.110281 6: 11.695218 7: 56.403650 8: 26.323089 9: 50.466934 10: 4.3909671 After indexed descending sort: I, INDX(I), A(I) 1 7 4.29180 2 2 56.2269 3 17 9.15883 4 15 48.8703 5 11 51.1103 6 5 11.6952 7 9 56.4036 8 4 26.3231 9 19 50.4669 10 13 4.39097 11 12 51.6075 12 8 30.5228 13 20 41.5971 14 6 4.37516 15 3 52.5056 16 18 0.473093 17 10 53.2869 18 14 6.69330 19 1 42.5122 20 16 14.0836 Now use the index array to carry out the permutation implicitly. INDX(I), ARRAY(INDX(I)) 7 56.4036 2 56.2269 17 53.2869 15 52.5056 11 51.6075 5 51.1103 9 50.4669 4 48.8703 19 42.5122 13 41.5971 12 30.5228 8 26.3231 20 14.0836 6 11.6952 3 9.15883 18 6.69330 10 4.39097 14 4.37516 1 4.29180 16 0.473093 R8VEC_SORT_HEAP_MASK_A_TEST R8VEC_SORT_HEAP_MASK_A creates an ascending sort index for a masked R8VEC. Unsorted array: 1: 49.077395 2: 10.862435 3: 2.8126536 4: 15.062804 5: 50.700145 6: 27.556867 7: 5.7404992 8: 57.245204 9: 32.601052 10: 52.761511 11: 58.544012 12: 52.397908 13: 26.961406 14: 55.180857 15: 6.6395795 16: 11.066416 17: 13.898731 18: 57.341690 19: 11.705584 20: 40.524591 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 10.8624 2: 4 15.0628 3: 7 5.74050 4: 8 57.2452 5: 9 32.6011 6: 12 52.3979 7: 13 26.9614 8: 16 11.0664 9: 18 57.3417 10: 19 11.7056 After masked indexed ascending sort: I, INDX(I), MASK(INDX(I)), A(MASK(INDX(I))) 1 3 7 5.74050 2 1 2 10.8624 3 8 16 11.0664 4 10 19 11.7056 5 2 4 15.0628 6 7 13 26.9614 7 5 9 32.6011 8 6 12 52.3979 9 4 8 57.2452 10 9 18 57.3417 Call I4VEC_PERMUTE to carry out the index permutation explicitly on the MASK vector. The reordered mask array: 1: 7 2: 2 3: 16 4: 19 5: 4 6: 13 7: 9 8: 12 9: 8 10: 18 Masked vector printout: The reordered masked sorted array: 1: 7 5.74050 2: 2 10.8624 3: 16 11.0664 4: 19 11.7056 5: 4 15.0628 6: 13 26.9614 7: 9 32.6011 8: 12 52.3979 9: 8 57.2452 10: 18 57.3417 R8VEC_SORT_INSERT_A_TEST R8VEC_SORT_INSERT_A ascending sorts a R8VEC. Unsorted array: 1: 32.885366 2: 25.126662 3: 14.438589 4: 4.2373092 5: 7.7924009 6: 9.1674743 7: 37.118387 8: 43.448999 9: 6.0089740 10: 26.250364 Sorted array: 1: 4.2373092 2: 6.0089740 3: 7.7924009 4: 9.1674743 5: 13.760235 6: 14.438589 7: 16.348227 8: 17.030080 9: 18.851907 10: 23.997208 R8VEC_SORT_INSERT_INDEX_A_TEST R8VEC_SORT_INSERT_INDEX_A creates an ascending sort index for a R8VEC. Unsorted array: 1: 29.925339 2: 35.339970 3: 8.5600325 4: 43.030584 5: 26.238174 6: 33.791731 7: 49.949965 8: 7.9055740 9: 27.404907 10: 12.217638 After indexed ascending sort: I, INDX(I), A(I) 1 8 29.9253 2 3 35.3400 3 10 8.56003 4 18 43.0306 5 17 26.2382 6 15 33.7917 7 5 49.9500 8 11 7.90557 9 9 27.4049 10 1 12.2176 11 14 26.9452 12 6 57.3795 13 2 42.9031 14 13 30.9097 15 4 25.0698 16 16 47.0541 17 20 25.0594 18 7 19.1180 19 19 50.7711 20 12 47.7915 Now use the index array to carry out the permutation implicitly. I, INDX(I), A(INDX(I)) 1 8 7.90557 2 3 8.56003 3 10 12.2176 4 18 19.1180 5 17 25.0594 6 15 25.0698 7 5 26.2382 8 11 26.9452 9 9 27.4049 10 1 29.9253 11 14 30.9097 12 6 33.7917 13 2 35.3400 14 13 42.9031 15 4 43.0306 16 16 47.0541 17 20 47.7915 18 7 49.9500 19 19 50.7711 20 12 57.3795 Call R8VEC_PERMUTE to carry out the permutation explicitly. Permuted data 1: 7.9055740 2: 8.5600325 3: 12.217638 4: 19.118003 5: 25.059362 6: 25.069767 7: 26.238174 8: 26.945237 9: 27.404907 10: 29.925339 R8VEC_SORT_QUICK_A_TEST R8VEC_SORT_QUICK_A sorts a R8VEC using quick sort. Unsorted array: 1: 7.0090874 2: 6.7672400 3: 2.1309495 4: 2.4738116 5: 8.6537314 6: 0.84356272 7: 9.2681320 8: 4.3599687 9: 6.0412664 10: 8.9787202 11: 4.8385161 12: 7.3016743 13: 9.3031251 14: 8.7398213 15: 0.74210668 16: 8.5552490 17: 5.4655031 18: 9.0846701 19: 3.9980799 20: 8.5223891 Sorted array: 1: 0.74210668 2: 0.84356272 3: 2.1309495 4: 2.4738116 5: 3.9980799 6: 4.3599687 7: 4.8385161 8: 5.4655031 9: 6.0412664 10: 6.7672400 11: 7.0090874 12: 7.3016743 13: 8.5223891 14: 8.5552490 15: 8.6537314 16: 8.7398213 17: 8.9787202 18: 9.0846701 19: 9.2681320 20: 9.3031251 R8VEC_SORTED_MERGE_A_TEST For ascending order: R8VEC_SORTED_MERGE_A merges two sorted R8VEC's; Sorted vector A: 1: 0.16424201 2: 0.19252732 3: 0.20502548 4: 0.47578036 5: 0.64520074 6: 0.72649854 7: 0.73291267 8: 0.81987209 9: 0.83490886 10: 0.92621060 Sorted vector B: 1: 0.49070564E-01 2: 0.87557785E-01 3: 0.15223154 4: 0.22611980 5: 0.26618981 6: 0.27247579 7: 0.77790259 8: 0.79869411 9: 0.82544376 10: 0.99140337 Merged vector C: 1: 0.49070564E-01 2: 0.87557785E-01 3: 0.15223154 4: 0.16424201 5: 0.19252732 6: 0.20502548 7: 0.22611980 8: 0.26618981 9: 0.27247579 10: 0.47578036 11: 0.64520074 12: 0.72649854 13: 0.73291267 14: 0.77790259 15: 0.79869411 16: 0.81987209 17: 0.82544376 18: 0.83490886 19: 0.92621060 20: 0.99140337 R8VEC_SORTED_NEAREST_TEST R8VEC_SORTED_NEAREST finds the nearest entry in a sorted R8VEC. Sorted array: 1: 1.5891129 2: 1.9053109 3: 2.2477168 4: 2.3640109 5: 4.0491860 6: 4.9107653 7: 5.4741622 8: 5.8782815 9: 7.4947641 10: 8.0388040 Test Nearest Value Index Value 9.8793 10 8.0388 8.9868 10 8.0388 5.4691 7 5.4742 7.0520 9 7.4948 5.2191 7 5.4742 1.1351 1 1.5891 6.3327 8 5.8783 9.0072 10 8.0388 1.8734 2 1.9053 8.1714 10 8.0388 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.41117683E-01 2: 0.20291735 3: 0.23540895 4: 0.36258147 5: 0.51438271 6: 0.65410099 7: 0.70158953 8: 0.70920664 9: 0.73150730 10: 0.92340034 R_LO 0.103083 2 0.202917 3 0.235409 4 0.362581 5 0.514383 R_HI 0.517638 Sorted array R: 1: 0.10959630 2: 0.19987785 3: 0.36465212 4: 0.41564412 5: 0.53031259 6: 0.60182739 7: 0.60901404 8: 0.65256567 9: 0.67952846 10: 0.80283775 R_LO 0.366585 4 0.415644 5 0.530313 6 0.601827 7 0.609014 8 0.652566 9 0.679528 10 0.802838 R_HI 0.856168 Sorted array R: 1: 0.11777962 2: 0.37601617 3: 0.43435266 4: 0.45360602 5: 0.53177880 6: 0.56280317 7: 0.59768074 8: 0.60919844 9: 0.69407626 10: 0.98449273 R_LO 0.424301 3 0.434353 4 0.453606 5 0.531779 6 0.562803 R_HI 0.577216 Sorted array R: 1: 0.20215012 2: 0.35868824 3: 0.52865290 4: 0.59174294 5: 0.60245276 6: 0.61056633 7: 0.74169655 8: 0.79764416 9: 0.83773503 10: 0.99524052 R_LO 0.867377E-01 1 0.202150 R_HI 0.292664 Sorted array R: 1: 0.14766117 2: 0.50158489 3: 0.65639367 4: 0.67751769 5: 0.71651750 6: 0.72595655 7: 0.73251088 8: 0.74363953 9: 0.80883522 10: 0.88208526 R_LO 0.187153 2 0.501585 3 0.656394 4 0.677518 5 0.716517 6 0.725957 7 0.732511 8 0.743640 R_HI 0.796294 R8VEC_SORTED_SPLIT_TEST R8VEC_SORTED_SPLIT splits a sorted R8VEC into entries less than and greater than a splitting value. The sorted array: 1: 0.0000000 2: 0.0000000 3: 0.50000000 4: 0.50000000 5: 0.50000000 6: 0.50000000 7: 1.0000000 8: 1.0000000 9: 1.0000000 10: 1.0000000 11: 1.0000000 12: 1.0000000 13: 1.5000000 14: 2.0000000 15: 2.5000000 16: 2.5000000 17: 2.5000000 18: 3.0000000 19: 3.0000000 20: 4.0000000 21: 4.0000000 22: 4.0000000 23: 4.0000000 24: 4.5000000 25: 5.0000000 Splitting value is 2.50000 Lower index I_LT = 14 Upper index I_GT = 18 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: 11.000000 2: 5.0000000 3: 0.0000000 4: 10.000000 5: 4.0000000 6: 23.000000 7: 3.0000000 8: 17.000000 9: 21.000000 10: 7.0000000 Unique entries 1: 0.0000000 2: 1.0000000 3: 2.0000000 4: 3.0000000 5: 4.0000000 6: 5.0000000 7: 7.0000000 8: 8.0000000 9: 10.000000 10: 11.000000 11: 17.000000 12: 18.000000 13: 19.000000 14: 20.000000 15: 21.000000 16: 23.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 29 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: 12.500000 2: 1.5000000 3: 25.500000 4: 13.500000 5: 21.500000 6: 22.500000 7: 13.500000 8: 25.500000 9: 10.500000 10: 14.500000 11: 25.500000 12: 28.500000 13: 24.500000 14: 19.500000 15: 4.5000000 16: 28.500000 17: 9.5000000 18: 4.5000000 19: 3.5000000 20: 28.500000 21: 27.500000 22: 13.500000 23: 9.5000000 24: 27.500000 25: 29.500000 26: 7.5000000 27: 21.500000 28: 12.500000 29: 24.500000 30: 0.50000000 Ascending sorted array: 1: 0.50000000 2: 1.5000000 3: 3.5000000 4: 4.5000000 5: 4.5000000 6: 7.5000000 7: 9.5000000 8: 9.5000000 9: 10.500000 10: 12.500000 11: 12.500000 12: 13.500000 13: 13.500000 14: 13.500000 15: 14.500000 16: 19.500000 17: 21.500000 18: 21.500000 19: 22.500000 20: 24.500000 21: 24.500000 22: 25.500000 23: 25.500000 24: 25.500000 25: 27.500000 26: 27.500000 27: 28.500000 28: 28.500000 29: 28.500000 30: 29.500000 R8VEC_SORTED_UNIQUE_HIST counts 18 unique entries. Value Multiplicity 1 0.500000 1 2 1.50000 1 3 3.50000 1 4 4.50000 2 5 7.50000 1 6 9.50000 2 7 10.5000 1 8 12.5000 2 9 13.5000 3 10 14.5000 1 11 19.5000 1 12 21.5000 2 13 22.5000 1 14 24.5000 2 15 25.5000 3 16 27.5000 2 17 28.5000 3 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: 1.0000000 2: 3.5000000 3: 1.5000000 4: 3.0000000 5: 1.5000000 6: 3.5000000 7: 2.0000000 8: 4.5000000 9: 3.0000000 10: 1.0000000 11: 1.0000000 12: 1.0000000 13: 1.0000000 14: 3.5000000 15: 4.0000000 16: 1.0000000 17: 5.0000000 18: 4.0000000 19: 0.0000000 20: 3.5000000 21: 5.0000000 22: 3.0000000 23: 4.0000000 24: 4.5000000 25: 4.5000000 Splitting value is 2.75000 The split array: 1: 1.0000000 2: 0.0000000 3: 1.5000000 4: 1.0000000 5: 1.5000000 6: 1.0000000 7: 2.0000000 8: 1.0000000 9: 1.0000000 10: 1.0000000 11: 3.0000000 12: 4.5000000 13: 3.5000000 14: 4.0000000 15: 3.5000000 16: 5.0000000 17: 4.0000000 18: 3.0000000 19: 3.5000000 20: 5.0000000 21: 3.0000000 22: 4.0000000 23: 4.5000000 24: 4.5000000 25: 3.5000000 Array entries <= SPLIT up to index 10 R8VEC_STANDARDIZE_TEST R8VEC_STANDARDIZE shifts and scales an R8VEC so that it has zero mean and unit standard deviation. Vector X: 1: 2.4983347 2: 14.363116 3: -1.2131998 4: 13.405522 5: 9.8761123 6: 2.8992577 7: 0.98516459 8: 7.1553519 9: 7.6177382 10: 3.8907145 mean(X) = 6.14781 std(X) = 5.23923 max(X) = 14.3631 min(X) = -1.21320 Vector XS: 1: -0.69656799 2: 1.5680382 3: -1.4049809 4: 1.3852641 5: 0.71161308 6: -0.62004465 7: -0.98538362 8: 0.19230720 9: 0.28056192 10: -0.43080735 mean(XS) = 0.144329E-15 std(XS) = 1.00000 max(XS) = 1.56804 min(XS) = -1.40498 r8vec_std_test(): r8vec_std() computes the standard deviation of an R8VEC. Vector: 1: 1.3337354 2: 4.2669947 3: 2.4572596 4: -3.9143385 5: 1.1421207 6: -1.7660518 7: -0.24041496 8: 3.0060451 9: -1.8652224 10: 2.6282426 STD: 2.45525 r8vec_std_sample_test(0 r8vec_std_sample() computes the sample standard deviation of an R8VEC. Vector: 1: 4.2722101 2: -2.5951327 3: -4.3590065 4: -1.5633224 5: 4.2625388 6: -4.7769048 7: 0.69216562 8: -3.8163527 9: 1.7009495 10: -3.4344417 STD: 3.46254 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.562523 0.00000 0.00000 2 0.960142 0.281159 0.281159 3 0.455322 0.265969 0.265969 4 0.207283 0.313442 0.313442 5 0.211668 0.309972 0.309972 6 0.789471 0.304781 0.304781 7 0.896908 0.310692 0.310692 8 0.986080 0.320960 0.320960 9 0.412912 0.309117 0.309117 10 0.134913 0.327759 0.327759 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.750369 0.00000 0.00000 2 0.917577 0.836037E-01 0.836037E-01 3 0.859911 0.693486E-01 0.693486E-01 4 0.588987 0.125175 0.125175 5 0.915515 0.124529 0.124529 6 0.370452 0.198312 0.198312 7 0.311729 0.235633 0.235633 8 0.980526 0.242678 0.242678 9 0.202052E-01 0.315595 0.315595 10 0.254985 0.320373 0.320373 R8VEC_SUM_TEST R8VEC_SUM computes the sum of an R8VEC. Input vector: 1: -0.19672203 2: -2.1805957 3: 2.0363174 4: 3.6704863 5: 6.3354485 6: -9.0072404 7: 3.9962065 8: -1.2468192 9: -1.8585892 10: 1.9138573 SUM: 3.46235 R8VEC_SUM_RUNNING_TEST R8VEC_SUM_RUNNING eturns the running sums of an R8VEC. R8VEC: 1: -4.1774262 2: -0.89088110 3: 3.2784610 4: 9.6547329 5: 7.8275519 6: -0.45856077 7: 3.6430338 8: 6.0134586 9: 5.3629171 10: -3.8805584 Running sums: 1: 0.0000000 2: -4.1774262 3: -5.0683073 4: -1.7898464 5: 7.8648866 6: 15.692438 7: 15.233878 8: 18.876912 9: 24.890370 10: 30.253287 11: 26.372729 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.57696857 2: 0.67572150 3: 0.29207903 4: 0.96049006 5: 0.87777516 6: 0.73506128 7: 0.94711356 8: 0.89712885 9: 0.43146600 10: 0.40901161 11: 0.11993612 12: 0.63432971 13: 0.19625167 14: 0.32952916 15: 0.99686244 16: 0.71857101 17: 0.75349601E-01 18: 0.63528569 19: 0.51787496 20: 0.96453113 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: 18.001144 2: 12.499537 3: 13.666310 4: 18.104747 5: 19.571636 6: 12.786929 7: 18.732794 8: 14.094897 9: 12.199767 10: 16.631797 Random R8VEC: 1: 10.078810 2: 18.729719 3: 14.460449 4: 18.293675 5: 17.443988 6: 16.893966 7: 14.497961 8: 12.215871 9: 16.167026 10: 17.363398 Random R8VEC: 1: 14.327777 2: 15.278254 3: 13.224797 4: 12.580704 5: 10.739037 6: 14.542664 7: 15.286914 8: 19.942222 9: 12.147783 10: 11.834939 R8VEC_UNIFORM_UNIT_TEST R8VEC_UNIFORM_UNIT returns a random point on the surface of the unit M sphere. Random unit vector: 1: -0.36885531 2: -0.54918452 3: 0.68283546 4: 0.11322259 5: -0.28854550 Random unit vector: 1: -0.18674429 2: -0.46451824 3: 0.86347191 4: -0.61125881E-01 5: 0.54107319E-02 Random unit vector: 1: 0.14379337E-01 2: 0.28696583 3: 0.77416264 4: 0.55034621 5: 0.12343052 Random unit vector: 1: 0.79316764 2: -0.64456290E-03 3: -0.35883076E-01 4: 0.59546228 5: 0.12256326 Random unit vector: 1: 0.65123845E-01 2: 0.79293132 3: 0.37509573 4: 0.23119392 5: 0.41577803 r8vec_variance_test() r8vec_variance() computes the variance of an R8VEC. Vector: 1: 1.4661901 2: -1.5565318 3: 2.4587988 4: 1.9538084 5: -1.1349043 6: 1.0971854 7: 4.0745890 8: 0.18383722 9: 3.3197211 10: -2.6304530 Variance: 4.29799 R8VEC_VARIANCE_CIRCULAR_TEST R8VEC_VARIANCE_CIRCULAR computes the circular variance of an R8VEC. Uniform Vector in [-PI,+PI]: 1: -2.1729118 2: -1.0317257 3: 1.6311642 4: -1.1184183 5: 1.5772748 6: -2.4988203 7: 0.95841564 8: 2.2267162 9: -1.7837680 10: 1.4958274 Circular variance: 0.920692 Normal vector, mean 0, variance 1 1: 1.1376099 2: 0.70770913 3: -0.41263145 4: -0.26924957 5: -0.55637955 6: 0.92204146 7: 0.56715130E-02 8: -0.42497625 9: -0.25711783 10: 0.50548525 Circular variance: 0.167566 R8VEC_VARIANCE_SAMPLE_TEST R8VEC_VARIANCE_SAMPLE computes the sample variance of an R8VEC. Vector: 1: -1.2746641 2: 2.3835586 3: 1.3372806 4: -4.0564438 5: -2.5282319 6: 3.9465371 7: 2.7892129 8: 3.6095281 9: 4.3262169 10: 2.8884437 Variance: 8.59672 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.851578 0.00000 0.00000 2 0.364613 0.118567 0.118567 3 0.440360E-01 0.165338 0.165338 4 0.659179 0.124518 0.124518 5 0.264366 0.102675 0.102675 6 0.302368 0.851501E-01 0.851501E-01 7 0.615704 0.767499E-01 0.767499E-01 8 0.299550 0.683622E-01 0.683622E-01 9 0.967531 0.925004E-01 0.925004E-01 10 0.742484 0.888299E-01 0.888299E-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.103343 0.00000 0.00000 2 0.619241 0.665378E-01 0.665378E-01 3 0.865233 0.100793 0.100793 4 0.613761E-01 0.116644 0.116644 5 0.536946 0.958010E-01 0.958010E-01 6 0.988188 0.121995 0.121995 7 0.238766 0.114886 0.114886 8 0.628277 0.102690 0.102690 9 0.419638 0.920024E-01 0.920024E-01 10 0.957547 0.102002 0.102002 R8VEC2_PRINT_TEST R8VEC2_PRINT prints a pair of R8VEC's. Squares and square roots: 1 1.00000 1.00000 2 4.00000 1.41421 3 9.00000 1.73205 4 16.0000 2.00000 5 25.0000 2.23607 R8VEC2_PRINT_SOME_TEST R8VEC2_PRINT_SOME prints some of a pair of R8VEC's. No more than 10 lines of two vectors: 1 1.00000 1.00000 2 4.00000 1.41421 3 9.00000 1.73205 4 16.0000 2.00000 5 25.0000 2.23607 6 36.0000 2.44949 7 49.0000 2.64575 8 64.0000 2.82843 ...... .............. .............. 100 10000.0 10.0000 R8VEC2_SORT_A_TEST R8VEC2_SORT_A ascending sorts a pair of R8VEC's; The pair of arrays: 1 2.29568 9.20222 2 2.81709 8.84765 3 2.29568 9.20222 4 1.08776 8.20751 5 1.92433 9.41876 6 2.81709 8.84765 7 2.93192 6.37079 8 2.72166 7.63358 9 2.29568 9.20222 10 1.37251 5.77191 Arrays after ascending sort: 1 1.08776 8.20751 2 1.37251 5.77191 3 1.92433 9.41876 4 2.29568 9.20222 5 2.29568 9.20222 6 2.29568 9.20222 7 2.72166 7.63358 8 2.81709 8.84765 9 2.81709 8.84765 10 2.93192 6.37079 R8VEC2_SORT_D_TEST R8VEC2_SORT_D descending sorts a pair of R8VEC's. The pair of arrays: 1 2.35132 5.29367 2 2.06691 5.33127 3 2.35132 5.29367 4 2.42635 9.85951 5 2.10833 9.30648 6 2.06691 5.33127 7 2.76348 7.07158 8 1.76473 9.77045 9 2.35132 5.29367 10 2.80926 7.64793 Arrays after descending sort: 1 2.80926 7.64793 2 2.76348 7.07158 3 2.42635 9.85951 4 2.35132 5.29367 5 2.35132 5.29367 6 2.35132 5.29367 7 2.10833 9.30648 8 2.06691 5.33127 9 2.06691 5.33127 10 1.76473 9.77045 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.650000 0.00000 2 1.00000 0.750000 3 0.750000 1.00000 4 0.300000 0.400000 5 0.350000 0.650000 6 0.700000 0.550000 7 0.600000 0.250000 8 0.00000 0.200000 9 0.500000E-01 0.550000 10 0.850000 0.450000 11 0.600000 0.800000 12 0.150000 0.700000 13 0.400000 0.550000 14 1.00000 0.00000 15 0.950000 0.00000 16 0.850000 0.550000 17 0.950000 0.950000 18 1.00000 0.800000 19 1.00000 0.500000 20 0.150000 0.600000 After sorting: I, INDX(I), X(I), Y(I) 1 8 0.650000 0.00000 2 9 1.00000 0.750000 3 20 0.750000 1.00000 4 12 0.300000 0.400000 5 4 0.350000 0.650000 6 5 0.700000 0.550000 7 13 0.600000 0.250000 8 7 0.00000 0.200000 9 11 0.500000E-01 0.550000 10 1 0.850000 0.450000 11 6 0.600000 0.800000 12 3 0.150000 0.700000 13 10 0.400000 0.550000 14 16 1.00000 0.00000 15 15 0.950000 0.00000 16 17 0.850000 0.550000 17 14 0.950000 0.950000 18 19 1.00000 0.800000 19 2 1.00000 0.500000 20 18 0.150000 0.600000 Now use the index array to carry out the permutation implicitly. I, INDX(I), X(INDX(I)), Y(INDX(I)) 1 8 0.00000 0.200000 2 9 0.500000E-01 0.550000 3 20 0.150000 0.600000 4 12 0.150000 0.700000 5 4 0.300000 0.400000 6 5 0.350000 0.650000 7 13 0.400000 0.550000 8 7 0.600000 0.250000 9 11 0.600000 0.800000 10 1 0.650000 0.00000 11 6 0.700000 0.550000 12 3 0.750000 1.00000 13 10 0.850000 0.450000 14 16 0.850000 0.550000 15 15 0.950000 0.00000 16 17 0.950000 0.950000 17 14 1.00000 0.00000 18 19 1.00000 0.500000 19 2 1.00000 0.750000 20 18 1.00000 0.800000 R8VEC_PERMUTE carries out the permutation. I, X(I), Y(I) 1 0.00000 0.200000 2 0.500000E-01 0.550000 3 0.150000 0.600000 4 0.150000 0.700000 5 0.300000 0.400000 6 0.350000 0.650000 7 0.400000 0.550000 8 0.600000 0.250000 9 0.600000 0.800000 10 0.650000 0.00000 11 0.700000 0.550000 12 0.750000 1.00000 13 0.850000 0.450000 14 0.850000 0.550000 15 0.950000 0.00000 16 0.950000 0.950000 17 1.00000 0.00000 18 1.00000 0.500000 19 1.00000 0.750000 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.46625 7.38903 2 2.93930 5.19791 3 1.46625 7.38903 4 1.23379 8.64312 5 1.14319 9.00565 6 2.93930 5.19791 7 2.19139 7.37683 8 1.51509 6.59427 9 1.46625 7.38903 10 1.25555 8.38990 Arrays after ascending sort: 1 1.14319 9.00565 2 1.23379 8.64312 3 1.25555 8.38990 4 1.46625 7.38903 5 1.46625 7.38903 6 1.46625 7.38903 7 1.51509 6.59427 8 2.19139 7.37683 9 2.93930 5.19791 10 2.93930 5.19791 UNIQed array: 1 1.14319 9.00565 2 1.23379 8.64312 3 1.25555 8.38990 4 1.46625 7.38903 5 1.51509 6.59427 6 2.19139 7.37683 7 2.93930 5.19791 R8VEC2_SORTED_UNIQUE_INDEX_TEST For a pair of R8VEC's: R8VEC2_SORTED_UNIQUE_INDEX indexes unique entries. Sorted arrays: 1 1.02373 5.55501 2 1.05763 5.15306 3 1.46245 8.66958 4 1.46245 8.66958 5 1.70719 8.36446 6 2.19843 5.54334 7 2.20700 6.92425 8 2.78689 8.55048 9 2.78689 8.55048 10 2.78689 8.55048 The number of unique elements is 7 Index of Unique Elements: 1: 1 2: 2 3: 3 4: 5 5: 6 6: 7 7: 8 After Indexed Nonunique Deletion. 1 1.02373 5.55501 2 1.05763 5.15306 3 1.46245 8.66958 4 1.70719 8.36446 5 2.19843 5.54334 6 2.20700 6.92425 7 2.78689 8.55048 R8VEC2_SUM_MAX_INDEX_TEST For a pair of R8VEC's: R8VEC2_SUM_MAX_INDEX: index of the sum vector with maximum value. The pair of vectors: 1 5.42844 2.08559 2 2.74533 2.16627 3 4.55159 1.87543 4 8.22033 2.12714 5 0.133839 1.78946 6 0.586855 3.92039 7 6.28861 1.76011 8 6.40331 1.11323 9 4.49382 4.84410 10 9.05686 3.73947 Index of maximum in A+B: 10 r8lib_test() Normal end of execution. 23 June 2024 10:49:16.043 AM