25 March 2017 10:08:10.233 AM R8LIB_PRB FORTRAN77 version Test the R8LIB library. 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)) 113.394 2 110.000 209.321 12 210.000 192.836 10 190.000 158.020 7 160.000 138.990 5 140.000 93.5954 0 90.0000 118.485 3 120.000 99.2944 1 100.000 90.6978 0 90.0000 167.416 8 170.000 PERM_UNIFORM_TEST PERM_UNIFORM randomly selects a permutation. 3 10 9 7 4 6 8 5 1 2 7 2 6 3 9 5 1 10 4 8 1 2 9 3 5 6 8 10 4 7 4 9 5 8 1 10 3 6 7 2 2 8 6 5 1 7 9 3 4 10 R8_ABS_TEST R8_ABS returns the absolute value of an R8. X R8_ABS(X) -1.252654 1.252654 4.650541 4.650541 3.636074 3.636074 1.493564 1.493564 0.322457 0.322457 -2.471050 2.471050 -0.939378 0.939378 -2.120346 2.120346 -2.649368 2.649368 2.071726 2.071726 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_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_ADD_TEST R8_ADD adds two R8's. R1 R2 R3 R4 R1+R2 R8_ADD(R1,R2) -281.582 456.318 174.736 174.736 329.509 61.6954 391.205 391.205 -84.6929 -433.881 -518.574 -518.574 -242.422 -390.043 -632.465 -632.465 -456.171 133.966 -322.205 -322.205 R8_AGM_TEST: R8_AGM computes the arithmetic geometric mean. X Y AGM AGM Exact Computed 22.000000 96.000000 52.27464119870424 52.27464119870424 83.000000 56.000000 68.83653005985852 68.83653005985852 42.000000 7.000000 20.65930119673401 20.65930119673401 26.000000 11.000000 17.69685487374365 17.69685487374367 4.000000 63.000000 23.86704972175330 23.86704972175330 6.000000 45.000000 20.71701598280599 20.71701598280599 40.000000 75.000000 56.12784225561668 56.12784225561668 80.000000 0.000000 0.000000000000000 0.000000000000000 90.000000 35.000000 59.26956508122964 59.26956508122989 9.000000 1.000000 3.936235503649555 3.936235503649556 53.000000 53.000000 53.00000000000000 53.00000000000000 1.000000 2.000000 1.456791031046907 1.456791031046907 1.000000 4.000000 2.243028580287603 2.243028580287603 1.000000 8.000000 3.615756177597363 3.615756177597363 1.500000 8.000000 4.081692408022163 4.081692408022163 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 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_COSD_TEST R8_COSD computes the cosine of an angle given in degrees. ANGLE R8_COSD(ANGLE) 0.00 1.00000 10.00 0.984808 20.00 0.939693 30.00 0.866025 40.00 0.766044 50.00 0.642788 60.00 0.500000 70.00 0.342020 80.00 0.173648 90.00 0.612323E-16 100.00 -0.173648 110.00 -0.342020 120.00 -0.500000 130.00 -0.642788 140.00 -0.766044 150.00 -0.866025 160.00 -0.939693 170.00 -0.984808 180.00 -1.00000 190.00 -0.984808 200.00 -0.939693 210.00 -0.866025 220.00 -0.766044 230.00 -0.642788 240.00 -0.500000 250.00 -0.342020 260.00 -0.173648 270.00 -0.183697E-15 280.00 0.173648 290.00 0.342020 300.00 0.500000 310.00 0.642788 320.00 0.766044 330.00 0.866025 340.00 0.939693 350.00 0.984808 360.00 1.00000 R8_COTD_TEST R8_COTD computes the cotangent of an angle given in degrees. ANGLE R8_COTD(ANGLE) 0.00 Undefined 10.00 5.67128 20.00 2.74748 30.00 1.73205 40.00 1.19175 50.00 0.839100 60.00 0.577350 70.00 0.363970 80.00 0.176327 90.00 0.612323E-16 100.00 -0.176327 110.00 -0.363970 120.00 -0.577350 130.00 -0.839100 140.00 -1.19175 150.00 -1.73205 160.00 -2.74748 170.00 -5.67128 180.00 Undefined 190.00 5.67128 200.00 2.74748 210.00 1.73205 220.00 1.19175 230.00 0.839100 240.00 0.577350 250.00 0.363970 260.00 0.176327 270.00 0.183697E-15 280.00 -0.176327 290.00 -0.363970 300.00 -0.577350 310.00 -0.839100 320.00 -1.19175 330.00 -1.73205 340.00 -2.74748 350.00 -5.67128 360.00 Undefined R8_CSCD_TEST R8_CSCD computes the cosecant of an angle given in degrees. ANGLE R8_CSCD(ANGLE) 0.00 Undefined 10.00 5.75877 20.00 2.92380 30.00 2.00000 40.00 1.55572 50.00 1.30541 60.00 1.15470 70.00 1.06418 80.00 1.01543 90.00 1.00000 100.00 1.01543 110.00 1.06418 120.00 1.15470 130.00 1.30541 140.00 1.55572 150.00 2.00000 160.00 2.92380 170.00 5.75877 180.00 Undefined 190.00 -5.75877 200.00 -2.92380 210.00 -2.00000 220.00 -1.55572 230.00 -1.30541 240.00 -1.15470 250.00 -1.06418 260.00 -1.01543 270.00 -1.00000 280.00 -1.01543 290.00 -1.06418 300.00 -1.15470 310.00 -1.30541 320.00 -1.55572 330.00 -2.00000 340.00 -2.92380 350.00 -5.75877 360.00 Undefined R8_CUBE_ROOT_TEST R8_CUBE_ROOT computes the cube root of an R8. X Y Y^3 -5.63163 -1.77915 -5.63163 9.12635 2.08977 9.12635 6.59018 1.87485 6.59018 1.23391 1.07258 1.23391 -1.69386 -1.19204 -1.69386 -8.67763 -2.05495 -8.67763 -4.84844 -1.69252 -4.84844 -7.80086 -1.98327 -7.80086 -9.12342 -2.08955 -9.12342 2.67931 1.38891 2.67931 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_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_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_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_FRACTIONAL_TEST R8_FRACTIONAL returns the fractional part of an R8. X R8_FRACTIONAL(X) -1.252654 0.252654 4.650541 0.650541 3.636074 0.636074 1.493564 0.493564 0.322457 0.322457 -2.471050 0.471050 -0.939378 0.939378 -2.120346 0.120346 -2.649368 0.649368 2.071726 0.071726 R8_GAMMA_TEST: R8_GAMMA evaluates the Gamma function. 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 evaluates the logarithm of the Gamma function. X Log(Gamma(X)) R8_GAMMA_LOG(X) 0.2000000000000000 1.524063822430784 1.524063822430784 0.4000000000000000 0.7966778177017837 0.7966778177017837 0.6000000000000000 0.3982338580692348 0.3982338580692349 0.8000000000000000 0.1520596783998375 0.1520596783998376 1.0000000000000000 0.000000000000000 0.000000000000000 1.1000000000000001 -0.4987244125983972E-01 -0.4987244125983976E-01 1.2000000000000000 -0.8537409000331583E-01 -0.8537409000331585E-01 1.3000000000000000 -0.1081748095078604 -0.1081748095078605 1.3999999999999999 -0.1196129141723712 -0.1196129141723713 1.5000000000000000 -0.1207822376352452 -0.1207822376352453 1.6000000000000001 -0.1125917656967557 -0.1125917656967558 1.7000000000000000 -0.9580769740706586E-01 -0.9580769740706586E-01 1.8000000000000000 -0.7108387291437215E-01 -0.7108387291437215E-01 1.8999999999999999 -0.3898427592308333E-01 -0.3898427592308337E-01 2.0000000000000000 0.000000000000000 0.000000000000000 3.0000000000000000 0.6931471805599453 0.6931471805599454 4.0000000000000000 1.791759469228055 1.791759469228055 10.0000000000000000 12.80182748008147 12.80182748008147 20.0000000000000000 39.33988418719949 39.33988418719949 30.0000000000000000 71.25703896716801 71.25703896716800 R8_HUGE_TEST R8_HUGE returns a "huge" R8; R8_HUGE ( ) = 0.1797693134862316+309 R8_LOG_2_TEST R8_LOG_2 computes the logarithm base 2. X R8_LOG_2 0.00000 -0.100000E+31 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_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.8158 4.5632 4.5632 3.2951 0.6170 3.2951 -0.8469 -4.3388 -0.8469 -2.4242 -3.9004 -2.4242 -4.5617 1.3397 1.3397 -4.3827 -0.5046 -0.5046 -0.9869 2.5467 2.5467 2.9729 -4.9816 2.9729 3.9750 -1.4925 3.9750 -4.0546 -4.8638 -4.0546 R8_MIN_TEST R8_MIN returns the minimum of two R8's. A B C=R8_MIN(A,B) -2.8158 4.5632 -2.8158 3.2951 0.6170 0.6170 -0.8469 -4.3388 -4.3388 -2.4242 -3.9004 -3.9004 -4.5617 1.3397 -4.5617 -4.3827 -0.5046 -4.3827 -0.9869 2.5467 -0.9869 2.9729 -4.9816 -4.9816 3.9750 -1.4925 -1.4925 -4.0546 -4.8638 -4.8638 R8_MOD_TEST R8_MOD returns the remainder after division. X Y MOD(X,Y) R8_MOD(X,Y) -5.6316 9.1264 -5.6316 -5.6316 6.5902 1.2339 0.4206 0.4206 -1.6939 -8.6776 -1.6939 -1.6939 -4.8484 -7.8009 -4.8484 -4.8484 -9.1234 2.6793 -1.0855 -1.0855 -8.7655 -1.0092 -0.6917 -0.6917 -1.9739 5.0935 -1.9739 -1.9739 5.9457 -9.9632 5.9457 5.9457 7.9501 -2.9850 1.9802 1.9802 -8.1091 -9.7277 -8.1091 -8.1091 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) -5.6316 9.1264 -5.6316 3.4947 6.5902 1.2339 0.4206 0.4206 -1.6939 -8.6776 -1.6939 6.9838 -4.8484 -7.8009 -4.8484 2.9524 -9.1234 2.6793 -1.0855 1.5938 -8.7655 -1.0092 -0.6917 0.3175 -1.9739 5.0935 -1.9739 3.1196 5.9457 -9.9632 5.9457 5.9457 7.9501 -2.9850 1.9802 1.9802 -8.1091 -9.7277 -8.1091 1.6186 R8_MOP_TEST R8_MOP evaluates (-1.0)^I4 as an R8. I4 R8_MOP(I4) -57 -1.0 92 1.0 66 1.0 12 1.0 -17 -1.0 -87 -1.0 -49 -1.0 -78 1.0 -92 1.0 27 -1.0 R8_NINT_TEST R8_NINT produces the nearest integer to an R8. X R8_NINT(X) -5.6316 -6 9.1264 9 6.5902 7 1.2339 1 -1.6939 -2 -8.6776 -9 -4.8484 -5 -7.8009 -8 -9.1234 -9 2.6793 3 R8_NORMAL_01_TEST R8_NORMAL_01 generates normally distributed random values. Using initial random number seed = 123456789 1.67904 -0.566060 1.21293 1.26938 -1.66609 -2.24246 0.396749E-01 0.673068 -0.275127 2.16400 0.297785 2.04454 1.39882 -1.24299 -0.670837E-01 -0.794396 -0.523768 -0.350567 0.131700 0.537380 R8_NORMAL_AB_TEST R8_NORMAL_AB generates normally distributed values with given mean and standard deviation. Using initial random number seed = 123456789 Mean = 100.000 Standard deviation = 10.0000 116.790 94.3394 112.129 112.694 83.3391 77.5754 100.397 106.731 97.2487 121.640 102.978 120.445 113.988 87.5701 99.3292 92.0560 94.7623 96.4943 101.317 105.374 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_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.2184182969823758 0.000000000000000 2 0.2184182969823758 0.2100000000000000 4 0.2184182969823758 0.2184000000000000 6 0.2184182969823758 0.2184180000000000 8 0.2184182969823758 0.2184182900000000 10 0.2184182969823758 0.2184182969000000 0 0.9563175765089297 0.000000000000000 2 0.9563175765089297 0.9500000000000001 4 0.9563175765089297 0.9563000000000000 6 0.9563175765089297 0.9563170000000000 8 0.9563175765089297 0.9563175700000001 10 0.9563175765089297 0.9563175765000000 0 0.8295092339327006 0.000000000000000 2 0.8295092339327006 0.8200000000000001 4 0.8295092339327006 0.8295000000000000 6 0.8295092339327006 0.8295089999999999 8 0.8295092339327006 0.8295092300000000 10 0.8295092339327006 0.8295092339000000 0 0.5616954427668942 0.000000000000000 2 0.5616954427668942 0.5600000000000001 4 0.5616954427668942 0.5616000000000000 6 0.5616954427668942 0.5616949999999999 8 0.5616954427668942 0.5616954400000000 10 0.5616954427668942 0.5616954427000000 0 0.4153070814759612 0.000000000000000 2 0.4153070814759612 0.4100000000000000 4 0.4153070814759612 0.4153000000000000 6 0.4153070814759612 0.4153070000000000 8 0.4153070814759612 0.4153070800000000 10 0.4153070814759612 0.4153070814000000 R8_SECD_TEST R8_SECD computes the secant of an angle given in degrees. ANGLE R8_SECD(ANGLE) 0.00 1.00000 10.00 1.01543 20.00 1.06418 30.00 1.15470 40.00 1.30541 50.00 1.55572 60.00 2.00000 70.00 2.92380 80.00 5.75877 90.00 Undefined 100.00 -5.75877 110.00 -2.92380 120.00 -2.00000 130.00 -1.55572 140.00 -1.30541 150.00 -1.15470 160.00 -1.06418 170.00 -1.01543 180.00 -1.00000 190.00 -1.01543 200.00 -1.06418 210.00 -1.15470 220.00 -1.30541 230.00 -1.55572 240.00 -2.00000 250.00 -2.92380 260.00 -5.75877 270.00 Undefined 280.00 5.75877 290.00 2.92380 300.00 2.00000 310.00 1.55572 320.00 1.30541 330.00 1.15470 340.00 1.06418 350.00 1.01543 360.00 1.00000 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_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_SIND_TEST R8_SIND computes the sine of an angle given in degrees. ANGLE R8_SIND(ANGLE) 0.00 0.00000 10.00 0.173648 20.00 0.342020 30.00 0.500000 40.00 0.642788 50.00 0.766044 60.00 0.866025 70.00 0.939693 80.00 0.984808 90.00 1.00000 100.00 0.984808 110.00 0.939693 120.00 0.866025 130.00 0.766044 140.00 0.642788 150.00 0.500000 160.00 0.342020 170.00 0.173648 180.00 0.122465E-15 190.00 -0.173648 200.00 -0.342020 210.00 -0.500000 220.00 -0.642788 230.00 -0.766044 240.00 -0.866025 250.00 -0.939693 260.00 -0.984808 270.00 -1.00000 280.00 -0.984808 290.00 -0.939693 300.00 -0.866025 310.00 -0.766044 320.00 -0.642788 330.00 -0.500000 340.00 -0.342020 350.00 -0.173648 360.00 -0.244929E-15 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 10.00 0.176327 20.00 0.363970 30.00 0.577350 40.00 0.839100 50.00 1.19175 60.00 1.73205 70.00 2.74748 80.00 5.67128 90.00 Undefined 100.00 -5.67128 110.00 -2.74748 120.00 -1.73205 130.00 -1.19175 140.00 -0.839100 150.00 -0.577350 160.00 -0.363970 170.00 -0.176327 180.00 -0.122465E-15 190.00 0.176327 200.00 0.363970 210.00 0.577350 220.00 0.839100 230.00 1.19175 240.00 1.73205 250.00 2.74748 260.00 5.67128 270.00 Undefined 280.00 -5.67128 290.00 -2.74748 300.00 -1.73205 310.00 -1.19175 320.00 -0.839100 330.00 -0.577350 340.00 -0.363970 350.00 -0.176327 360.00 -0.244929E-15 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 1.83944 1.94737 11.4321 10.0000 9.78362 10.0000 6.30204 6.21053 4.39899 4.31579 -0.140456 1.00000 2.34851 2.42105 0.429438 1.00000 -0.430223 1.00000 7.24155 7.15789 -0.197546 1.00000 4.84401 4.78947 4.21698 4.31579 8.81076 8.57895 9.36473 9.52632 R8_UNIFORM_01_TEST R8_UNIFORM_01 produces a sequence of random values. Using random seed 123456789 SEED R8_UNIFORM_01(SEED) 469049721 0.218418 2053676357 0.956318 1781357515 0.829509 1206231778 0.561695 891865166 0.415307 141988902 0.661187E-01 553144097 0.257578 236130416 0.109957 94122056 0.438290E-01 1361431000 0.633966 Verify that the sequence can be restarted. Set the seed back to its original value, and see that we generate the same sequence. SEED R8_UNIFORM_01(SEED) 469049721 0.218418 2053676357 0.956318 1781357515 0.829509 1206231778 0.561695 891865166 0.415307 141988902 0.661187E-01 553144097 0.257578 236130416 0.109957 94122056 0.438290E-01 1361431000 0.633966 R8_UNIFORM_AB_TEST R8_UNIFORM_AB returns random values in a given range: [ A, B ] For this problem: B = 10.0000 C = 20.0000 12.1842 19.5632 18.2951 15.6170 14.1531 10.6612 12.5758 11.0996 10.4383 16.3397 R8_WALSH_1D_TEST R8_WALSH_1D evaluates 1D Walsh functions: X W(+2) W(+1) W(0) W(-1) W(-2) W(-3) 0.000000 0.0 0.0 0.0 0.0 0.0 0.0 0.250000 0.0 0.0 0.0 0.0 1.0 0.0 0.500000 0.0 0.0 0.0 1.0 0.0 0.0 0.750000 0.0 0.0 0.0 1.0 1.0 0.0 1.000000 0.0 0.0 1.0 0.0 0.0 0.0 1.250000 0.0 0.0 1.0 0.0 1.0 0.0 1.500000 0.0 0.0 1.0 1.0 0.0 0.0 1.750000 0.0 0.0 1.0 1.0 1.0 0.0 2.000000 0.0 1.0 0.0 0.0 0.0 0.0 2.250000 0.0 1.0 0.0 0.0 1.0 0.0 2.500000 0.0 1.0 0.0 1.0 0.0 0.0 2.750000 0.0 1.0 0.0 1.0 1.0 0.0 3.000000 0.0 1.0 1.0 0.0 0.0 0.0 3.250000 0.0 1.0 1.0 0.0 1.0 0.0 3.500000 0.0 1.0 1.0 1.0 0.0 0.0 3.750000 0.0 1.0 1.0 1.0 1.0 0.0 4.000000 1.0 0.0 0.0 0.0 0.0 0.0 4.250000 1.0 0.0 0.0 0.0 1.0 0.0 4.500000 1.0 0.0 0.0 1.0 0.0 0.0 4.750000 1.0 0.0 0.0 1.0 1.0 0.0 5.000000 1.0 0.0 1.0 0.0 0.0 0.0 5.250000 1.0 0.0 1.0 0.0 1.0 0.0 5.500000 1.0 0.0 1.0 1.0 0.0 0.0 5.750000 1.0 0.0 1.0 1.0 1.0 0.0 6.000000 1.0 1.0 0.0 0.0 0.0 0.0 6.250000 1.0 1.0 0.0 0.0 1.0 0.0 6.500000 1.0 1.0 0.0 1.0 0.0 0.0 6.750000 1.0 1.0 0.0 1.0 1.0 0.0 7.000000 1.0 1.0 1.0 0.0 0.0 0.0 7.250000 1.0 1.0 1.0 0.0 1.0 0.0 7.500000 1.0 1.0 1.0 1.0 0.0 0.0 7.750000 1.0 1.0 1.0 1.0 1.0 0.0 8.000000 0.0 0.0 0.0 0.0 0.0 0.0 R8_WRAP_TEST R8_WRAP "wraps" an R8 to lie within an interval: Wrapping interval is 3.00000 , 6.50000 R R8_WRAP ( R ) 1.05786 4.55786 11.3884 4.38845 9.61313 6.11313 5.86374 5.86374 3.81430 3.81430 -1.07434 5.92566 1.60609 5.10609 -0.460605 3.03940 -1.38639 5.61361 6.87552 3.37552 -1.13582 5.86418 4.29355 4.29355 3.61829 3.61829 8.56543 5.06543 9.16202 5.66202 -1.97426 5.02574 10.5651 3.56506 2.91053 6.41053 -0.676373 6.32363 -1.80936 5.19064 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 R82POLY2_TYPE_TEST R82POLY2_TYPE determines the type of a second order equation in two variables. 9.0000 * x^2 + -4.0000 * y^2 + 0.0000 * xy + -36.0000 * x + -24.0000 * y + -36.0000 = 0 Type = 1 The set of solutions forms a hyperbola. 4.0000 * x^2 + 1.0000 * y^2 + -4.0000 * xy + 3.0000 * x + -4.0000 * y + 1.0000 = 0 Type = 2 The set of solutions forms a parabola. 9.0000 * x^2 + 16.0000 * y^2 + 0.0000 * xy + 36.0000 * x + -32.0000 * y + -92.0000 = 0 Type = 3 The set of solutions forms an ellipse. 1.0000 * x^2 + 1.0000 * y^2 + 0.0000 * xy + -6.0000 * x + -10.0000 * y + 115.0000 = 0 Type = 4 The set of solutions forms an imaginary ellipse. (There are no real solutions). 0.0000 * x^2 + 0.0000 * y^2 + 1.0000 * xy + 3.0000 * x + -1.0000 * y + -3.0000 = 0 Type = 5 The set of solutions forms a pair of intersecting lines. 1.0000 * x^2 + 2.0000 * y^2 + 0.0000 * xy + -2.0000 * x + 16.0000 * y + 33.0000 = 0 Type = 6 The set of solutions is a single point. 0.0000 * x^2 + 1.0000 * y^2 + 0.0000 * xy + 0.0000 * x + -6.0000 * y + 8.0000 = 0 Type = 7 The set of solutions form a pair of distinct parallel lines. 0.0000 * x^2 + 1.0000 * y^2 + 0.0000 * xy + 0.0000 * x + -6.0000 * y + 10.0000 = 0 Type = 8 The set of solutions forms a pair of imaginary parallel lines. (There are no real solutions). 0.0000 * x^2 + 1.0000 * y^2 + 0.0000 * xy + 0.0000 * x + -2.0000 * y + 1.0000 = 0 Type = 9 The set of solutions forms a pair of coincident lines. 0.0000 * x^2 + 0.0000 * y^2 + 0.0000 * xy + 2.0000 * x + -1.0000 * y + 1.0000 = 0 Type = 10 The set of solutions forms a single line. 0.0000 * x^2 + 0.0000 * y^2 + 0.0000 * xy + 0.0000 * x + 0.0000 * y + 0.0000 = 0 Type = 11 The set of solutions is all space. 0.0000 * x^2 + 0.0000 * y^2 + 0.0000 * xy + 0.0000 * x + 0.0000 * y + 1.0000 = 0 Type = 12 The set of solutions is empty. R82ROW_ORDER_TYPE_TEST R82ROW_ORDER_TYPE classifies a R8VEC as -1: no order 0: all equal; 1: ascending; 2: strictly ascending; 3: descending; 4: strictly descending. Order type = -1 1 1.00000 3.00000 2 2.00000 2.00000 3 1.00000 0.00000 4 1.00000 0.00000 Order type = -1 1 0.00000 2.00000 2 0.00000 1.00000 3 1.00000 2.00000 4 2.00000 0.00000 Order type = -1 1 3.00000 1.00000 2 0.00000 0.00000 3 3.00000 3.00000 4 0.00000 0.00000 Order type = -1 1 1.00000 3.00000 2 0.00000 1.00000 3 2.00000 1.00000 4 2.00000 2.00000 Order type = -1 1 3.00000 1.00000 2 3.00000 2.00000 3 1.00000 2.00000 4 1.00000 1.00000 Order type = 3 1 2.00000 1.00000 2 2.00000 1.00000 3 1.00000 2.00000 4 0.00000 1.00000 Order type = -1 1 2.00000 2.00000 2 0.00000 2.00000 3 0.00000 2.00000 4 2.00000 1.00000 Order type = -1 1 3.00000 2.00000 2 2.00000 1.00000 3 3.00000 2.00000 4 0.00000 2.00000 Order type = -1 1 0.00000 1.00000 2 1.00000 3.00000 3 0.00000 0.00000 4 0.00000 0.00000 Order type = -1 1 1.00000 0.00000 2 1.00000 1.00000 3 2.00000 2.00000 4 2.00000 1.00000 R82ROW_PART_QUICK_A_TEST R82ROW_PART_QUICK_A reorders an R82ROW as part of a quick sort. Using initial random number seed = 123456789 Before rearrangement: 1 2.18418 9.56318 2 8.29509 5.61695 3 4.15307 0.661187 4 2.57578 1.09957 5 0.438290 6.33966 6 0.617272 4.49539 7 4.01306 7.54673 8 7.97287 0.183837E-01 9 8.97504 3.50752 10 0.945448 0.136169 11 8.59097 8.40847 12 1.23104 0.751236E-01 Rearranged array Left index = 4 Key index = 5 Right index = 6 Left half: 1 1.23104 0.751236E-01 2 0.945448 0.136169 3 0.617272 4.49539 4 0.438290 6.33966 Key: 1 2.18418 9.56318 Right half: 1 4.01306 7.54673 2 7.97287 0.183837E-01 3 8.97504 3.50752 4 2.57578 1.09957 5 8.59097 8.40847 6 4.15307 0.661187 7 8.29509 5.61695 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. Using initial random number seed = 123456789 Before rearrangement: 1 2.18418 9.56318 2 8.29509 3.50752 3 0.438290 0.661187 4 1.23104 1.09957 5 0.438290 6.33966 6 0.617272 9.56318 7 8.59097 8.40847 8 7.97287 0.183837E-01 9 8.97504 3.50752 10 0.945448 0.136169 11 8.59097 8.40847 12 1.23104 0.751236E-01 I Index A(Index) 1 3 0.438290 0.661187 2 5 0.438290 6.33966 3 6 0.617272 9.56318 4 10 0.945448 0.136169 5 12 1.23104 0.751236E-01 6 4 1.23104 1.09957 7 1 2.18418 9.56318 8 8 7.97287 0.183837E-01 9 2 8.29509 3.50752 10 7 8.59097 8.40847 11 11 8.59097 8.40847 12 9 8.97504 3.50752 After rearrangement by R82ROW_PERMUTE: 1 0.438290 0.661187 2 0.438290 6.33966 3 0.617272 9.56318 4 0.945448 0.136169 5 1.23104 0.751236E-01 6 1.23104 1.09957 7 2.18418 9.56318 8 7.97287 0.183837E-01 9 8.29509 3.50752 10 8.59097 8.40847 11 8.59097 8.40847 12 8.97504 3.50752 R82ROW_SORT_QUICK_A_TEST R82ROW_SORT_QUICK_A sorts an R82ROW using quick sort. Using initial random number seed = 123456789 Before rearrangement: 1 2.18418 9.56318 2 8.29509 3.50752 3 0.438290 0.661187 4 1.23104 1.09957 5 0.438290 6.33966 6 0.617272 9.56318 7 8.59097 8.40847 8 7.97287 0.183837E-01 9 8.97504 3.50752 10 0.945448 0.136169 11 8.59097 8.40847 12 1.23104 0.751236E-01 Sorted array: 1 0.438290 0.661187 2 0.438290 6.33966 3 0.617272 9.56318 4 0.945448 0.136169 5 1.23104 0.751236E-01 6 1.23104 1.09957 7 2.18418 9.56318 8 7.97287 0.183837E-01 9 8.29509 3.50752 10 8.59097 8.40847 11 8.59097 8.40847 12 8.97504 3.50752 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 R8COL_FIND_TEST For an R8COL; R8COL_FIND seeks a column matching given data. R8COL_FIND returns ICOL = 3 R8COL_INSERT_TEST For an R8COL; R8COL_SORT_HEAP_A does an ascending heap sort R8COL_INSERT inserts new columns. The unsorted matrix: Col 1 2 3 4 Row 1: 2.00000 4.00000 1.00000 3.00000 2: 6.00000 8.00000 5.00000 7.00000 3: 10.0000 12.0000 9.00000 11.0000 The sorted matrix: 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 New column: 1: 3.0000000 2: 7.0000000 3: 11.000000 The data was already in column 3 New column: 1: 3.0000000 2: 4.0000000 3: 18.000000 The updated matrix: Col 1 2 3 4 5 Row 1: 1.00000 2.00000 3.00000 3.00000 4.00000 2: 5.00000 6.00000 4.00000 7.00000 8.00000 3: 9.00000 10.0000 18.0000 11.0000 12.0000 R8COL_PART_QUICK_A_TEST For an R8COL; R8COL_PART_QUICK_A partitions the matrix. The matrix: Col 1 2 3 4 5 Row 1: 2.00000 8.00000 6.00000 0.00000 10.0000 2: 4.00000 8.00000 2.00000 2.00000 6.00000 Col 6 7 8 Row 1: 10.0000 0.00000 5.00000 2: 0.00000 6.00000 8.00000 L = 2 R = 4 The partitioned matrix: Col 1 2 3 4 5 Row 1: 0.00000 0.00000 2.00000 10.0000 10.0000 2: 6.00000 2.00000 4.00000 6.00000 0.00000 Col 6 7 8 Row 1: 6.00000 5.00000 8.00000 2: 2.00000 8.00000 8.00000 R8COL_SORT_HEAP_A_TEST For an R8COL; R8COL_SORT_HEAP_A does an ascending heap sort R8COL_INSERT inserts new columns. The unsorted matrix: Col 1 2 3 4 Row 1: 2.00000 4.00000 1.00000 3.00000 2: 6.00000 8.00000 5.00000 7.00000 3: 10.0000 12.0000 9.00000 11.0000 The sorted matrix: 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 R8COL_SORT_HEAP_INDEX_A_TEST R8COL_SORT_HEAP_INDEX_A computes an index vector which ascending sorts an R8COL. The unsorted R8COL (transposed): Row 1 2 3 Col 1: 2.00000 6.00000 10.0000 2: 4.00000 8.00000 12.0000 3: 1.00000 5.00000 9.00000 4: 3.00000 7.00000 11.0000 5: 2.00000 6.00000 0.00000 6: 3.00000 4.00000 18.0000 7: 0.00000 0.00000 0.00000 8: 0.00000 6.00000 10.0000 9: 2.00000 6.00000 10.0000 10: 3.00000 7.00000 11.0000 11: 2.00000 0.00000 10.0000 12: 2.00000 6.00000 10.0000 13: 1.00000 5.00000 9.00000 14: 1.00000 5.00000 9.10000 15: 1.00000 5.10000 9.00000 The implicitly sorted R8COL (transposed) 7: 0.0 0.0 0.0 8: 0.0 6.0 10.0 13: 1.0 5.0 9.0 3: 1.0 5.0 9.0 14: 1.0 5.0 9.1 15: 1.0 5.1 9.0 11: 2.0 0.0 10.0 5: 2.0 6.0 0.0 12: 2.0 6.0 10.0 9: 2.0 6.0 10.0 1: 2.0 6.0 10.0 6: 3.0 4.0 18.0 10: 3.0 7.0 11.0 4: 3.0 7.0 11.0 2: 4.0 8.0 12.0 R8COL_SORT_QUICK_A_TEST For an R8COL; R8COL_SORT_QUICK_A does a quicksort. The unsorted matrix: Col 1 2 3 4 5 Row 1: 2.18418 5.61695 2.57578 6.33966 4.01306 2: 9.56318 4.15307 1.09957 0.617272 7.54673 3: 8.29509 0.661187 0.438290 4.49539 7.97287 Col 6 7 8 9 10 Row 1: 0.183837E-01 0.945448 8.40847 2.60303 3.51629 2: 8.97504 0.136169 1.23104 9.12484 8.22887 3: 3.50752 8.59097 0.751236E-01 1.13664 2.67132 The sorted matrix: Col 1 2 3 4 5 Row 1: 0.183837E-01 0.945448 2.18418 2.57578 2.60303 2: 8.97504 0.136169 9.56318 1.09957 9.12484 3: 3.50752 8.59097 8.29509 0.438290 1.13664 Col 6 7 8 9 10 Row 1: 3.51629 4.01306 5.61695 6.33966 8.40847 2: 8.22887 7.54673 4.15307 0.617272 1.23104 3: 2.67132 7.97287 0.661187 4.49539 0.751236E-01 R8COL_SORTED_TOL_UNDEX_TEST R8COL_SORTED_TOL_UNDEX produces index vectors which create a sorted list of the tolerably unique columns of a sorted R8COL, and a map from the original R8COL to the (implicit) R8COL of sorted tolerably unique elements. The unsorted R8COL (transposed): Row 1 2 3 Col 1: 1.90000 0.00000 10.0000 2: 2.00000 6.00000 10.0000 3: 4.00000 8.00000 12.0000 4: 1.00000 5.00000 9.00000 5: 3.00000 7.00000 11.0000 6: 2.00000 6.00000 0.00000 7: 2.00000 0.00000 10.1000 8: 2.00000 0.100000 10.0000 9: 3.00000 4.00000 18.0000 10: 1.90000 8.00000 10.0000 11: 0.00000 0.00000 0.00000 12: 0.00000 6.00000 10.0000 13: 2.10000 0.00000 10.0000 14: 2.00000 6.00000 10.0000 15: 3.00000 7.00000 11.0000 16: 2.00000 0.00000 10.0000 17: 2.00000 0.00000 10.0000 18: 2.00000 6.00000 10.0000 19: 1.00000 5.00000 9.00000 20: 2.00000 0.00000 10.1000 21: 1.00000 5.00000 9.10000 22: 1.00000 5.10000 9.00000 The sorted R8COL (transposed): Row 1 2 3 Col 1: 0.00000 0.00000 0.00000 2: 0.00000 6.00000 10.0000 3: 1.00000 5.00000 9.00000 4: 1.00000 5.00000 9.00000 5: 1.00000 5.00000 9.10000 6: 1.00000 5.10000 9.00000 7: 1.90000 0.00000 10.0000 8: 1.90000 8.00000 10.0000 9: 2.00000 0.00000 10.0000 10: 2.00000 0.00000 10.0000 11: 2.00000 0.00000 10.1000 12: 2.00000 0.00000 10.1000 13: 2.00000 0.100000 10.0000 14: 2.00000 6.00000 0.00000 15: 2.00000 6.00000 10.0000 16: 2.00000 6.00000 10.0000 17: 2.00000 6.00000 10.0000 18: 2.10000 0.00000 10.0000 19: 3.00000 4.00000 18.0000 20: 3.00000 7.00000 11.0000 21: 3.00000 7.00000 11.0000 22: 4.00000 8.00000 12.0000 Tolerance for equality = 0.250000 Number of tolerably unique columns is 10 XDNU points to the representative for each item. UNDX selects the representatives. I XDNU UNDX 1 1 1 2 2 2 3 3 3 4 3 7 5 3 8 6 3 14 7 4 15 8 5 19 9 4 20 10 4 22 11 4 12 4 13 4 14 6 15 7 16 7 17 7 18 4 19 8 20 9 21 9 22 10 The tolerably unique R8COL (transposed): Row 1 2 3 Col 1: 0.00000 0.00000 0.00000 2: 0.00000 6.00000 10.0000 3: 1.00000 5.00000 9.00000 4: 1.90000 0.00000 10.0000 5: 1.90000 8.00000 10.0000 6: 2.00000 6.00000 0.00000 7: 2.00000 6.00000 10.0000 8: 3.00000 4.00000 18.0000 9: 3.00000 7.00000 11.0000 10: 4.00000 8.00000 12.0000 R8COL_SORTED_TOL_UNIQUE_TEST R8COL_SORTED_TOL_UNIQUE finds tolerably unique columns in a sorted R8COL. The unsorted R8COL (transposed): Row 1 2 3 Col 1: 1.90000 0.00000 10.0000 2: 2.00000 6.00000 10.0000 3: 4.00000 8.00000 12.0000 4: 1.00000 5.00000 9.00000 5: 3.00000 7.00000 11.0000 6: 2.00000 6.00000 0.00000 7: 2.00000 0.00000 10.1000 8: 2.00000 0.100000 10.0000 9: 3.00000 4.00000 18.0000 10: 1.90000 8.00000 10.0000 11: 0.00000 0.00000 0.00000 12: 0.00000 6.00000 10.0000 13: 2.10000 0.00000 10.0000 14: 2.00000 6.00000 10.0000 15: 3.00000 7.00000 11.0000 16: 2.00000 0.00000 10.0000 17: 2.00000 0.00000 10.0000 18: 2.00000 6.00000 10.0000 19: 1.00000 5.00000 9.00000 20: 2.00000 0.00000 10.1000 21: 1.00000 5.00000 9.10000 22: 1.00000 5.10000 9.00000 The sorted R8COL (transposed): Row 1 2 3 Col 1: 0.00000 0.00000 0.00000 2: 0.00000 6.00000 10.0000 3: 1.00000 5.00000 9.00000 4: 1.00000 5.00000 9.00000 5: 1.00000 5.00000 9.10000 6: 1.00000 5.10000 9.00000 7: 1.90000 0.00000 10.0000 8: 1.90000 8.00000 10.0000 9: 2.00000 0.00000 10.0000 10: 2.00000 0.00000 10.0000 11: 2.00000 0.00000 10.1000 12: 2.00000 0.00000 10.1000 13: 2.00000 0.100000 10.0000 14: 2.00000 6.00000 0.00000 15: 2.00000 6.00000 10.0000 16: 2.00000 6.00000 10.0000 17: 2.00000 6.00000 10.0000 18: 2.10000 0.00000 10.0000 19: 3.00000 4.00000 18.0000 20: 3.00000 7.00000 11.0000 21: 3.00000 7.00000 11.0000 22: 4.00000 8.00000 12.0000 Using tolerance = 0.250000 Number of tolerably unique columns is 10 The sorted tolerably unique R8COL (transposed): Row 1 2 3 Col 1: 0.00000 0.00000 0.00000 2: 0.00000 6.00000 10.0000 3: 1.00000 5.00000 9.00000 4: 1.90000 0.00000 10.0000 5: 1.90000 8.00000 10.0000 6: 2.00000 6.00000 0.00000 7: 2.00000 6.00000 10.0000 8: 3.00000 4.00000 18.0000 9: 3.00000 7.00000 11.0000 10: 4.00000 8.00000 12.0000 R8COL_SORTED_TOL_UNIQUE_COUNT_TEST R8COL_SORTED_TOL_UNIQUE_COUNT counts tolerably unique columns in a sorted R8COL. The unsorted R8COL (transposed): Row 1 2 3 Col 1: 1.90000 0.00000 10.0000 2: 2.00000 6.00000 10.0000 3: 4.00000 8.00000 12.0000 4: 1.00000 5.00000 9.00000 5: 3.00000 7.00000 11.0000 6: 2.00000 6.00000 0.00000 7: 2.00000 0.00000 10.1000 8: 2.00000 0.100000 10.0000 9: 3.00000 4.00000 18.0000 10: 1.90000 8.00000 10.0000 11: 0.00000 0.00000 0.00000 12: 0.00000 6.00000 10.0000 13: 2.10000 0.00000 10.0000 14: 2.00000 6.00000 10.0000 15: 3.00000 7.00000 11.0000 16: 2.00000 0.00000 10.0000 17: 2.00000 0.00000 10.0000 18: 2.00000 6.00000 10.0000 19: 1.00000 5.00000 9.00000 20: 2.00000 0.00000 10.1000 21: 1.00000 5.00000 9.10000 22: 1.00000 5.10000 9.00000 The sorted R8COL (transposed): Row 1 2 3 Col 1: 0.00000 0.00000 0.00000 2: 0.00000 6.00000 10.0000 3: 1.00000 5.00000 9.00000 4: 1.00000 5.00000 9.00000 5: 1.00000 5.00000 9.10000 6: 1.00000 5.10000 9.00000 7: 1.90000 0.00000 10.0000 8: 1.90000 8.00000 10.0000 9: 2.00000 0.00000 10.0000 10: 2.00000 0.00000 10.0000 11: 2.00000 0.00000 10.1000 12: 2.00000 0.00000 10.1000 13: 2.00000 0.100000 10.0000 14: 2.00000 6.00000 0.00000 15: 2.00000 6.00000 10.0000 16: 2.00000 6.00000 10.0000 17: 2.00000 6.00000 10.0000 18: 2.10000 0.00000 10.0000 19: 3.00000 4.00000 18.0000 20: 3.00000 7.00000 11.0000 21: 3.00000 7.00000 11.0000 22: 4.00000 8.00000 12.0000 Using tolerance = 0.250000 Number of tolerably unique columns is 10 R8COL_MAX_TEST For an R8COL; R8COL_MAX computes maximums; The array: 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 R8COL_MEAN_TEST For an R8COL; R8COL_MEAN computes means; The array: 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 Column means: 1: 5.0000000 2: 6.0000000 3: 7.0000000 4: 8.0000000 R8COL_MIN_TEST For an R8COL; R8COL_MIN computes minimums; The array: 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 Column minimums: 1: 1.0000000 2: 2.0000000 3: 3.0000000 4: 4.0000000 R8COL_SUM_TEST For an R8COL; R8COL_SUM computes sums; The array: 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 Column sums: 1: 15.000000 2: 18.000000 3: 21.000000 4: 24.000000 R8COL_PERMUTE_TEST R8COL_PERMUTE permutes an R8COL in place. A (unpermuted) 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 The (column) permutation vector: 1: 2 2: 4 3: 5 4: 1 5: 3 A (permuted) Col 1 2 3 4 5 Row 1: 12.0000 14.0000 15.0000 11.0000 13.0000 2: 22.0000 24.0000 25.0000 21.0000 23.0000 3: 32.0000 34.0000 35.0000 31.0000 33.0000 R8COL_SORTR_A_TEST R8COL_SORTR_A is given an array, and reorders it so that a particular column is sorted. Here, the special column is 2 Unsorted array: Col 1 2 3 Row 1: 2.18418 0.617272 8.59097 2: 9.56318 4.49539 8.40847 3: 8.29509 4.01306 1.23104 4: 5.61695 7.54673 0.751236E-01 5: 4.15307 7.97287 2.60303 6: 0.661187 0.183837E-01 9.12484 7: 2.57578 8.97504 1.13664 8: 1.09957 3.50752 3.51629 9: 0.438290 0.945448 8.22887 10: 6.33966 0.136169 2.67132 Sorted array: Col 1 2 3 Row 1: 0.661187 0.183837E-01 9.12484 2: 6.33966 0.136169 2.67132 3: 2.18418 0.617272 8.59097 4: 0.438290 0.945448 8.22887 5: 1.09957 3.50752 3.51629 6: 8.29509 4.01306 1.23104 7: 9.56318 4.49539 8.40847 8: 5.61695 7.54673 0.751236E-01 9: 4.15307 7.97287 2.60303 10: 2.57578 8.97504 1.13664 R8COL_SWAP_TEST R8COL_SWAP swaps two columns of an R8COL; The 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 Swap columns 1 and 3 The updated matrix: Col 1 2 3 4 Row 1: 13.0000 12.0000 11.0000 14.0000 2: 23.0000 22.0000 21.0000 24.0000 3: 33.0000 32.0000 31.0000 34.0000 R8COL_TO_R8VEC_TEST R8COL_TO_R8VEC converts an array of columns to a vector. The array of columns: Col 1 2 3 4 Row 1: 11.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 The resulting vector of columns: 1: 11.000000 2: 21.000000 3: 31.000000 4: 12.000000 5: 22.000000 6: 32.000000 7: 13.000000 8: 23.000000 9: 33.000000 10: 14.000000 11: 24.000000 12: 34.000000 R8COL_TOL_UNDEX_TEST R8COL_TOL_UNDEX produces index vectors which create a sorted list of the tolerably unique columns of an R8COL, and a map from the original R8COL to the (implicit) R8COL of sorted tolerably unique elements. The unsorted R8COL (transposed): Row 1 2 3 Col 1: 1.90000 0.00000 10.0000 2: 2.00000 6.00000 10.0000 3: 4.00000 8.00000 12.0000 4: 1.00000 5.00000 9.00000 5: 3.00000 7.00000 11.0000 6: 2.00000 6.00000 0.00000 7: 2.00000 0.00000 10.1000 8: 2.00000 0.100000 10.0000 9: 3.00000 4.00000 18.0000 10: 1.90000 8.00000 10.0000 11: 0.00000 0.00000 0.00000 12: 0.00000 6.00000 10.0000 13: 2.10000 0.00000 10.0000 14: 2.00000 6.00000 10.0000 15: 3.00000 7.00000 11.0000 16: 2.00000 0.00000 10.0000 17: 2.00000 0.00000 10.0000 18: 2.00000 6.00000 10.0000 19: 1.00000 5.00000 9.00000 20: 2.00000 0.00000 10.1000 21: 1.00000 5.00000 9.10000 22: 1.00000 5.10000 9.00000 Tolerance for equality = 0.250000 Number of tolerably unique columns is 10 XDNU points to the representative for each item. UNDX selects the representatives. I XDNU UNDX 1 4 11 2 7 12 3 10 19 4 3 1 5 9 10 6 6 6 7 4 14 8 4 9 9 8 15 10 5 3 11 1 12 2 13 4 14 7 15 9 16 4 17 4 18 7 19 3 20 4 21 3 22 3 The tolerably unique R8COL (transposed): Row 1 2 3 Col 1: 0.00000 0.00000 0.00000 2: 0.00000 6.00000 10.0000 3: 1.00000 5.00000 9.00000 4: 1.90000 0.00000 10.0000 5: 1.90000 8.00000 10.0000 6: 2.00000 6.00000 0.00000 7: 2.00000 6.00000 10.0000 8: 3.00000 4.00000 18.0000 9: 3.00000 7.00000 11.0000 10: 4.00000 8.00000 12.0000 R8COL_UNDEX_TEST R8COL_UNDEX produces index vectors which create a sorted list of the unique columns of an (unsorted) R8COL, and a map from the original R8COL to the (implicit) R8COL of sorted unique elements. The R8COL (transposed): Row 1 2 3 Col 1: 2.00000 6.00000 10.0000 2: 4.00000 8.00000 12.0000 3: 1.00000 5.00000 9.00000 4: 3.00000 7.00000 11.0000 5: 2.00000 6.00000 0.00000 6: 3.00000 4.00000 18.0000 7: 0.00000 0.00000 0.00000 8: 0.00000 6.00000 10.0000 9: 2.00000 6.00000 10.0000 10: 3.00000 7.00000 11.0000 11: 2.00000 0.00000 10.0000 12: 2.00000 6.00000 10.0000 13: 1.00000 5.00000 9.00000 14: 1.00000 5.00000 9.10000 15: 1.00000 5.10000 9.00000 Number of unique columns is 11 XDNU points to the representative for each item. UNDX selects the representatives. I XDNU UNDX 1 8 7 2 11 8 3 3 13 4 10 14 5 7 15 6 9 11 7 1 5 8 2 12 9 8 6 10 10 10 11 6 2 12 8 13 3 14 4 15 5 The Unique R8COL (transposed): Row 1 2 3 Col 1: 0.00000 0.00000 0.00000 2: 0.00000 6.00000 10.0000 3: 1.00000 5.00000 9.00000 4: 1.00000 5.00000 9.10000 5: 1.00000 5.10000 9.00000 6: 2.00000 0.00000 10.0000 7: 2.00000 6.00000 0.00000 8: 2.00000 6.00000 10.0000 9: 3.00000 4.00000 18.0000 10: 3.00000 7.00000 11.0000 11: 4.00000 8.00000 12.0000 R8COL_UNIQUE_COUNT_TEST R8COL_UNIQUE_COUNT counts unique columns in an unsorted R8COL. The R8COL (transposed): Row 1 2 3 Col 1: 2.00000 6.00000 10.0000 2: 4.00000 8.00000 12.0000 3: 1.00000 5.00000 9.00000 4: 3.00000 7.00000 11.0000 5: 2.00000 6.00000 0.00000 6: 3.00000 4.00000 18.0000 7: 0.00000 0.00000 0.00000 8: 0.00000 6.00000 10.0000 9: 2.00000 6.00000 10.0000 10: 3.00000 7.00000 11.0000 11: 2.00000 0.00000 10.0000 12: 2.00000 6.00000 10.0000 13: 1.00000 5.00000 9.00000 14: 1.00000 5.00000 9.10000 15: 1.00000 5.10000 9.00000 Number of unique columns is 11 R8COL_VARIANCE_TEST R8COL_VARIANCE computes variances of an R8COL; The array: Col 1 2 3 4 Row 1: 1.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 Column variance: 1 16.0000 2 16.0000 3 16.0000 4 16.0000 R8R8VEC_INDEX_INSERT_UNIQUE_TEST R8R8VEC_INDEX_INSERT_UNIQUE inserts unique values into an index sorted array. Generate 30 random values: Index XVAL YVAL 1 2.00 3.00 2 3.00 2.00 3 2.00 1.00 3 2.00 1.00 4 1.00 2.00 4 1.00 2.00 1 2.00 3.00 5 3.00 1.00 6 4.00 2.00 7 1.00 1.00 8 4.00 3.00 7 1.00 1.00 1 2.00 3.00 4 1.00 2.00 2 3.00 2.00 2 3.00 2.00 6 4.00 2.00 6 4.00 2.00 1 2.00 3.00 3 2.00 1.00 2 3.00 2.00 2 3.00 2.00 9 2.00 2.00 4 1.00 2.00 10 3.00 3.00 4 1.00 2.00 11 1.00 3.00 2 3.00 2.00 8 4.00 3.00 2 3.00 2.00 Vector of unique X Y values: I X(I) Y(I) 1 0.00 3.00 2 2.00 2.00 3 0.00 1.00 4 2.12 2.00 5 0.00 1.00 6 2.00 2.00 7 0.00 1.00 8 1.88 3.00 9 0.00 2.00 10 2.12 3.00 11 0.00 3.00 X, Y sorted by index I INDX(I) X(INDX(I)) Y(INDX(I)) 1 7 0.00 1.00 2 4 2.12 2.00 3 11 0.00 3.00 4 3 0.00 1.00 5 9 0.00 2.00 6 1 0.00 3.00 7 5 0.00 1.00 8 2 2.00 2.00 9 10 2.12 3.00 10 6 2.00 2.00 11 8 1.88 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 2.00 3.00 3.00 2 3.00 2.00 1.00 3 2.00 1.00 1.00 4 3.00 1.00 2.00 1 2.00 3.00 3.00 5 1.00 3.00 2.00 6 1.00 1.00 4.00 7 4.00 1.00 1.00 8 2.00 3.00 1.00 9 2.00 3.00 2.00 10 3.00 2.00 4.00 1 2.00 3.00 3.00 9 2.00 3.00 2.00 11 2.00 2.00 2.00 12 3.00 2.00 2.00 4 3.00 1.00 2.00 13 3.00 3.00 1.00 14 3.00 1.00 3.00 10 3.00 2.00 4.00 15 3.00 3.00 2.00 16 4.00 2.00 1.00 4 3.00 1.00 2.00 8 2.00 3.00 1.00 17 1.00 1.00 1.00 18 2.00 1.00 2.00 19 2.00 2.00 3.00 14 3.00 1.00 3.00 10 3.00 2.00 4.00 20 4.00 3.00 3.00 21 1.00 2.00 2.00 Vector of unique X Y Z values: I X(I) Y(I) Z(I) 1 2.00 3.00 3.00 2 3.00 2.00 1.00 3 2.00 1.00 1.00 4 3.00 1.00 2.00 5 1.00 3.00 2.00 6 1.00 1.00 4.00 7 4.00 1.00 1.00 8 2.00 3.00 1.00 9 2.00 3.00 2.00 10 3.00 2.00 4.00 11 2.00 2.00 2.00 12 3.00 2.00 2.00 13 3.00 3.00 1.00 14 3.00 1.00 3.00 15 3.00 3.00 2.00 16 4.00 2.00 1.00 17 1.00 1.00 1.00 18 2.00 1.00 2.00 19 2.00 2.00 3.00 20 4.00 3.00 3.00 21 1.00 2.00 2.00 X Y Z sorted by index: I INDX(I) X(I) X(INDX(I)) 1 17 1.00 1.00 1.00 2 6 1.00 1.00 4.00 3 21 1.00 2.00 2.00 4 5 1.00 3.00 2.00 5 3 2.00 1.00 1.00 6 18 2.00 1.00 2.00 7 11 2.00 2.00 2.00 8 19 2.00 2.00 3.00 9 8 2.00 3.00 1.00 10 9 2.00 3.00 2.00 11 1 2.00 3.00 3.00 12 4 3.00 1.00 2.00 13 14 3.00 1.00 3.00 14 2 3.00 2.00 1.00 15 12 3.00 2.00 2.00 16 10 3.00 2.00 4.00 17 13 3.00 3.00 1.00 18 15 3.00 3.00 2.00 19 7 4.00 1.00 1.00 20 16 4.00 2.00 1.00 21 20 4.00 3.00 3.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)) 113.394 2 110.000 209.321 12 210.000 192.836 10 190.000 158.020 7 160.000 138.990 5 140.000 93.5954 0 90.0000 118.485 3 120.000 99.2944 1 100.000 90.6978 0 90.0000 167.416 8 170.000 R8MAT_CHOLESKY_INVERSE For a positive definite symmetric matrix, R8MAT_CHOLESKY_INVERSE computes the inverse. Matrix to be inverted: Col 1 2 3 4 5 Row 1: 2.00000 -1.00000 0.00000 0.00000 0.00000 2: -1.00000 2.00000 -1.00000 0.00000 0.00000 3: 0.00000 -1.00000 2.00000 -1.00000 0.00000 4: 0.00000 0.00000 -1.00000 2.00000 -1.00000 5: 0.00000 0.00000 0.00000 -1.00000 2.00000 Inverse matrix: Col 1 2 3 4 5 Row 1: 0.833333 0.666667 0.500000 0.333333 0.166667 2: 0.666667 1.33333 1.00000 0.666667 0.333333 3: 0.500000 1.00000 1.50000 1.00000 0.500000 4: 0.333333 0.666667 1.00000 1.33333 0.666667 5: 0.166667 0.333333 0.500000 0.666667 0.833333 Product inv(A) * A: Col 1 2 3 4 5 Row 1: 1.00000 0.222045E-15 0.00000 -0.111022E-15 0.00000 2: -0.666134E-15 1.00000 0.222045E-15 -0.166533E-15 -0.111022E-15 3: -0.666134E-15 0.111022E-14 1.00000 -0.222045E-15 0.00000 4: -0.444089E-15 0.666134E-15 0.00000 1.00000 0.00000 5: -0.166533E-15 0.222045E-15 0.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 For a matrix in general storage, R8MAT_FSS factors and solves multiple linear system. Matrix order N = 10 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.444089E-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: -2.81582 -4.33881 -4.38273 -4.98162 3.59097 2: 4.56318 -2.42422 -0.504610 3.97504 3.40847 3: 3.29509 -3.90043 -0.986937 -1.49248 -3.76896 4: 0.616954 -4.56171 2.54673 -4.05455 -4.92488 5: -0.846929 1.33966 2.97287 -4.86383 -2.39697 Compact vector V so H*A packs column 3: 1: 0.0000000 2: 0.0000000 3: -0.78881850 4: 0.39986317 5: 0.46677063 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.244469 0.630839 0.736395 4: 0.00000 0.00000 0.630839 0.680219 -0.373289 5: 0.00000 0.00000 0.736395 -0.373289 0.564250 Indirect product A*H: Col 1 2 3 4 5 Row 1: -2.81582 -4.33881 0.573215 -7.49385 0.658370 2: 4.56318 -2.42422 5.14095 1.11322 0.678026E-01 3: 3.29509 -3.90043 -3.47568 -0.230898 -2.29629 4: 0.616954 -4.56171 -6.80702 0.686997 0.610057 5: -0.846929 1.33966 -5.56019 -0.538306 2.65233 Direct product A*H: Col 1 2 3 4 5 Row 1: -2.81582 -4.33881 0.573215 -7.49385 0.658370 2: 4.56318 -2.42422 5.14095 1.11322 0.678026E-01 3: 3.29509 -3.90043 -3.47568 -0.230898 -2.29629 4: 0.616954 -4.56171 -6.80702 0.686997 0.610057 5: -0.846929 1.33966 -5.56019 -0.538306 2.65233 Product H*A has packed column 3: Col 1 2 3 4 5 Row 1: -2.81582 -4.33881 -4.38273 -4.98162 3.59097 2: 4.56318 -2.42422 -0.504610 3.97504 3.40847 3: -1.04002 -0.937652 4.03706 -5.77460 -3.95052 4: 2.81449 -6.06358 -0.222045E-15 -1.88388 -4.83284 5: 1.71831 -0.413520 0.00000 -2.32995 -2.28953 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 R8MAT_HOUSE_POST computes a Householder postmultiplier; Matrix A: Col 1 2 3 4 5 Row 1: 1.09209 0.330594 0.308636 0.919186E-02 4.29548 2: 4.78159 1.28789 2.24769 4.48752 4.20424 3: 4.14755 0.549784 2.00653 1.75376 0.615520 4: 2.80848 0.219145 3.77337 0.472724 0.375618E-01 5: 2.07654 3.16983 3.98643 0.680845E-01 1.30151 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.343307 -0.685413 -0.642145 4: 0.00000 0.00000 -0.685413 0.650273 -0.327650 5: 0.00000 0.00000 -0.642145 -0.327650 0.693034 Product A*H: Col 1 2 3 4 5 Row 1: 1.09209 0.330594 -2.87058 -1.61298 2.77572 2: 4.78159 1.28789 -6.54718 0.222045E-15 0.00000 3: 4.14755 0.549784 -2.28616 -0.436552 -1.43653 4: 2.80848 0.219145 -1.64356 -2.29122 -2.55190 5: 2.07654 3.16983 -2.25100 -3.11452 -1.68018 R8MAT_HOUSE_PRE_TEST R8MAT_HOUSE_PRE computes a Householder premultiplier; Matrix A: Col 1 2 3 4 5 Row 1: 1.09209 0.330594 0.308636 0.919186E-02 4.29548 2: 4.78159 1.28789 2.24769 4.48752 4.20424 3: 4.14755 0.549784 2.00653 1.75376 0.615520 4: 2.80848 0.219145 3.77337 0.472724 0.375618E-01 5: 2.07654 3.16983 3.98643 0.680845E-01 1.30151 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.358962 -0.320448 -0.602615 -0.636643 3: 0.00000 -0.320448 0.924437 -0.142099 -0.150122 4: 0.00000 -0.602615 -0.142099 0.732777 -0.282312 5: 0.00000 -0.636643 -0.150122 -0.282312 0.701747 Product H*A: Col 1 2 3 4 5 Row 1: 1.09209 0.330594 0.308636 0.919186E-02 4.29548 2: -6.05992 -2.78859 -6.26165 -2.50105 -2.55764 3: 1.59108 -0.411463 0.333067E-15 0.105833 -0.978953 4: -1.99906 -1.58852 0.00000 -2.62628 -2.96091 5: -3.00247 1.26009 0.444089E-15 -3.20590 -1.86627 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_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. 1 2 3 4 5 1 11.0000 2 21.0000 22.0000 3 31.0000 32.0000 33.0000 4 41.0000 42.0000 43.0000 44.0000 5 51.0000 52.0000 53.0000 54.0000 55.0000 6 61.0000 62.0000 63.0000 64.0000 65.0000 7 71.0000 72.0000 73.0000 74.0000 75.0000 6 6 66.0000 7 76.0000 77.0000 A 7 by 3 matrix. 1 2 3 1 11.0000 2 21.0000 22.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 A 4 by 7 matrix. 1 2 3 1 11.0000 2 21.0000 22.0000 3 31.0000 32.0000 33.0000 4 41.0000 42.0000 43.0000 44.0000 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_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 a real matrix, R8MAT_MAX computes the maximum value; Random array: Col 1 2 3 Row 1: 2.18418 0.661187 0.617272 2: 9.56318 2.57578 4.49539 3: 8.29509 1.09957 4.01306 4: 5.61695 0.438290 7.54673 5: 4.15307 6.33966 7.97287 Maximum value = 9.56318 R8MAT_MAX_INDEX_TEST R8MAT_MAX_INDEX locates the maximum entry of an R8MAT; Random array: Col 1 2 3 Row 1: 2.18418 0.661187 0.617272 2: 9.56318 2.57578 4.49539 3: 8.29509 1.09957 4.01306 4: 5.61695 0.438290 7.54673 5: 4.15307 6.33966 7.97287 Maximum I,J indices 2 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: 2.18418 0.661187 0.617272 2: 9.56318 2.57578 4.49539 3: 8.29509 1.09957 4.01306 4: 5.61695 0.438290 7.54673 5: 4.15307 6.33966 7.97287 MAXCOL_MINROW = 4.15307 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: 2.18418 0.661187 0.617272 2: 9.56318 2.57578 4.49539 3: 8.29509 1.09957 4.01306 4: 5.61695 0.438290 7.54673 5: 4.15307 6.33966 7.97287 MAXROW_MINCOL = 2.18418 R8MAT_MIN_TEST For a real matrix, R8MAT_MIN computes the minimum value; Random array: Col 1 2 3 Row 1: 2.18418 0.661187 0.617272 2: 9.56318 2.57578 4.49539 3: 8.29509 1.09957 4.01306 4: 5.61695 0.438290 7.54673 5: 4.15307 6.33966 7.97287 Minimum value = 0.438290 R8MAT_MIN_INDEX_TEST R8MAT_MIN_INDEX locates the minimum entry of an R8MAT; Random array: Col 1 2 3 Row 1: 2.18418 0.661187 0.617272 2: 9.56318 2.57578 4.49539 3: 8.29509 1.09957 4.01306 4: 5.61695 0.438290 7.54673 5: 4.15307 6.33966 7.97287 Minimum I,J indices 4 2 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: 2.18418 0.661187 0.617272 2: 9.56318 2.57578 4.49539 3: 8.29509 1.09957 4.01306 4: 5.61695 0.438290 7.54673 5: 4.15307 6.33966 7.97287 MINCOL_MAXROW = 2.18418 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.18418 0.661187 0.617272 2: 9.56318 2.57578 4.49539 3: 8.29509 1.09957 4.01306 4: 5.61695 0.438290 7.54673 5: 4.15307 6.33966 7.97287 MINROW_MAXCOL = 6.33966 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.81582 -4.33881 -4.38273 -4.98162 2: 4.56318 -2.42422 -0.504610 3.97504 3: 3.29509 -3.90043 -0.986937 -1.49248 4: 0.616954 -4.56171 2.54673 -4.05455 5: -0.846929 1.33966 2.97287 -4.86383 Rounded matrix A: Col 1 2 3 4 Row 1: -3.00000 -4.00000 -4.00000 -5.00000 2: 5.00000 -2.00000 -1.00000 4.00000 3: 3.00000 -4.00000 -1.00000 -1.00000 4: 1.00000 -5.00000 3.00000 -4.00000 5: -1.00000 1.00000 3.00000 -5.00000 R8MAT_NONZEROS_TEST R8MAT_NONZEROS counts nonzeros in an R8MAT. Matrix A: Col 1 2 3 4 Row 1: 0.00000 0.00000 0.00000 0.00000 2: 0.00000 1.00000 0.00000 1.00000 3: 0.00000 0.00000 0.00000 0.00000 4: 0.00000 1.00000 0.00000 1.00000 5: 0.00000 0.00000 0.00000 0.00000 Expected nonzeros = 4 Computed nonzeros = 4 R8MAT_NORM_FRO_TEST R8MAT_NORM_FRO computes the 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_L1_TEST R8MAT_NORM_L1 computes the L1 norm of an R8MAT; A: Col 1 2 3 4 Row 1: -3.00000 -4.00000 -4.00000 -5.00000 2: 5.00000 -2.00000 -1.00000 4.00000 3: 3.00000 -4.00000 -1.00000 -1.00000 4: 1.00000 -5.00000 3.00000 -4.00000 5: -1.00000 1.00000 3.00000 -5.00000 Computed norm = 19.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 3 Nullspace vectors: Col 1 2 3 Row 1: 0.00000 -3.00000 -1.00000 2: 0.00000 0.500000 0.166667 3: 1.00000 0.00000 0.00000 4: 0.00000 -9.00000 -3.00000 5: 0.00000 -1.00000 -0.333333 6: 0.00000 1.00000 0.00000 7: 0.00000 0.00000 1.00000 Product A * Nullspace vectors: Col 1 2 3 Row 1: 0.00000 -22.5000 -7.50000 2: 0.00000 32.0000 10.6667 3: 0.00000 -4.50000 -1.50000 4: 0.00000 1.50000 0.500000 R8MAT_NULLSPACE_SIZE_TEST R8MAT_NULLSPACE_SIZE sizes 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 3 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.559743 -0.371903 -0.337166E-01 0.682240 0.285986 2: 0.188708 -0.906112 0.432361E-01 -0.368531 0.752686E-01 3: -0.404357 -0.795868E-01 -0.732356 -0.200174 -0.503733 4: -0.423174 0.184571 -0.114406 -0.542494 0.692437 5: 0.555425 0.157436E-01 -0.668999 0.253702 0.423476 A'*A should be identity: Col 1 2 3 4 5 Row 1: 1.00000 -0.294903E-16 0.555112E-16 0.555112E-16 0.832667E-16 2: -0.294903E-16 1.00000 -0.156125E-16 0.156992E-15 -0.477049E-16 3: 0.555112E-16 -0.156125E-16 1.00000 -0.555112E-16 -0.111022E-15 4: 0.555112E-16 0.156992E-15 -0.555112E-16 1.00000 -0.138778E-15 5: 0.832667E-16 -0.477049E-16 -0.111022E-15 -0.138778E-15 1.00000 R8MAT_PLOT_TEST R8MAT_PLOT prints a symbolic picture of a matrix. Typically, "-" for negative, " " for zero, and "+" for positive entries or "X" for nonzero and, " " for zero. A plot of the matrix: 1234567890123456789012345678901234567890123456789012345678901234567890 1 -+00000000000000000000000000000000000000000000000000000000000000000000 2 +-+0000000000000000000000000000000000000000000000000000000000000000000 3 0+-+000000000000000000000000000000000000000000000000000000000000000000 4 00+-+00000000000000000000000000000000000000000000000000000000000000000 5 000+-+0000000000000000000000000000000000000000000000000000000000000000 6 0000+-+000000000000000000000000000000000000000000000000000000000000000 7 00000+-+00000000000000000000000000000000000000000000000000000000000000 8 000000+-+0000000000000000000000000000000000000000000000000000000000000 9 0000000+-+000000000000000000000000000000000000000000000000000000000000 10 00000000+-+00000000000000000000000000000000000000000000000000000000000 123456789012345678901234567890 1 00000000000000000000000000000+ 2 000000000000000000000000000000 3 000000000000000000000000000000 4 000000000000000000000000000000 5 000000000000000000000000000000 6 000000000000000000000000000000 7 000000000000000000000000000000 8 000000000000000000000000000000 9 000000000000000000000000000000 10 000000000000000000000000000000 R8MAT_POWER_METHOD_TEST R8MAT_POWER_METHOD applies the power method to a matrix. Estimated eigenvalue = 3.73198 Estimated eigenvector V: 1: 0.29287667 2: -0.49998671 3: 0.57312572 4: -0.49998670 5: 0.29287668 Value of A*V: 1: 1.0857400 2: -1.8659758 3: 2.1462249 4: -1.8659758 5: 1.0857401 R8MAT_PRINT_TEST R8MAT_PRINT prints an R8MAT. The R8MAT: Col 1 2 3 4 Row 1: 11.0000 12.0000 13.0000 14.0000 2: 21.0000 22.0000 23.0000 24.0000 3: 31.0000 32.0000 33.0000 34.0000 4: 41.0000 42.0000 43.0000 44.0000 5: 51.0000 52.0000 53.0000 54.0000 6: 61.0000 62.0000 63.0000 64.0000 R8MAT_PRINT_SOME_TEST R8MAT_PRINT_SOME prints some of an R8MAT. The R8MAT, rows 2:4, cols 1:2 Col 1 2 Row 2: 21.0000 22.0000 3: 31.0000 32.0000 4: 41.0000 42.0000 R8MAT_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 REF form: Col 1 2 3 4 5 Row 1: 1.00000 3.00000 0.00000 2.00000 6.00000 2: -0.00000 1.00000 0.00000 -2.00000 -8.00000 3: 0.00000 0.00000 0.00000 1.00000 0.00000 4: 0.00000 0.00000 0.00000 0.00000 1.00000 Col 6 7 Row 1: 3.00000 1.00000 2: 3.00000 1.00000 3: 9.00000 3.00000 4: 6.00000 2.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 RREF form: 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.00000 1.00000 0.00000 4: 0.00000 0.00000 0.00000 0.00000 1.00000 Col 6 7 Row 1: 3.00000 1.00000 2: -0.500000 -0.166667 3: 9.00000 3.00000 4: 1.00000 0.333333 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.415307 0.415307 0.661187E-01 0.661187E-01 Solution / Computed: 0.617272E-01 0.617272E-01 0.449539 0.449539 Solution / Computed: 0.897504 0.897504 0.350752 0.350752 Solution / Computed: 0.123104 0.123104 0.751236E-02 0.751236E-02 Solution / Computed: 0.822887 0.822887 0.267132 0.267132 R8MAT_SOLVE_3D_TEST R8MAT_SOLVE_3D solves 3D linear systems. Solution / Computed: 0.633966 0.633966 0.617272E-01 0.617272E-01 0.449539 0.449539 Solution / Computed: 0.840847 0.840847 0.123104 0.123104 0.751236E-02 0.751236E-02 Solution / Computed: 0.453794 0.453794 0.911977 0.911977 0.597917 0.597917 Solution / Computed: 0.714471 0.714471 0.117707 0.117707 0.299329 0.299329 Solution / Computed: 0.763537 0.763537 0.761731 0.761731 0.406970 0.406970 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_SUB_TEST R8MAT_SUB computes C = A - B for R8MAT's. 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 B: Col 1 2 3 4 Row 1: 11.0000 21.0000 31.0000 41.0000 2: 12.0000 22.0000 32.0000 42.0000 3: 13.0000 23.0000 33.0000 43.0000 4: 14.0000 24.0000 34.0000 44.0000 C = A-B: Col 1 2 3 4 Row 1: 0.00000 -9.00000 -18.0000 -27.0000 2: 9.00000 0.00000 -9.00000 -18.0000 3: 18.0000 9.00000 0.00000 -9.00000 4: 27.0000 18.0000 9.00000 0.00000 R8MAT_SYMM_JACOBI_TEST For a symmetric R8MAT: R8MAT_SYMM_JACOBI diagonalizes; Matrix to diagonalize: Col 1 2 3 4 5 Row 1: 2.86409 -0.334105 -0.906958 -0.379152 1.04295 2: -0.334105 2.25488 0.784356E-01 0.631118 -0.225108 3: -0.906958 0.784356E-01 3.21422 -0.916550 -0.269890E-01 4: -0.379152 0.631118 -0.916550 3.86102 0.916005 5: 1.04295 -0.225108 -0.269890E-01 0.916005 2.80579 Computed Eigenvalues: 1.00000 2.00000 4.00000 5.00000 3.00000 R8MAT_TO_R8PLU_TEST R8MAT_TO_R8PLU determines the compressed PLU factors of a R8MAT. Using initial random number seed = 123456789 Matrix order N = 5 The matrix A: Col 1 2 3 4 5 Row 1: 0.218418 0.661187E-01 0.617272E-01 0.183837E-02 0.859097 2: 0.956318 0.257578 0.449539 0.897504 0.840847 3: 0.829509 0.109957 0.401306 0.350752 0.123104 4: 0.561695 0.438290E-01 0.754673 0.945448E-01 0.751236E-02 5: 0.415307 0.633966 0.797287 0.136169E-01 0.260303 The pivot vector P: 1: 2 2: 5 3: 4 4: 4 5: 5 The compressed LU factors: Col 1 2 3 4 5 Row 1: 0.956318 0.257578 0.449539 0.897504 0.840847 2: -0.228395 0.522106 0.602062 -0.376149 -0.104858 3: -0.867399 0.217324 0.614552 -0.510026 -0.507943 4: -0.587352 0.205820 -0.231419 -0.391459 -0.511487 5: -0.434277 -0.139612E-01 0.803036E-01 -0.610161 0.939815 The recovered matrix A2: Col 1 2 3 4 5 Row 1: 0.218418 0.661187E-01 0.617272E-01 0.183837E-02 0.859097 2: 0.956318 0.257578 0.449539 0.897504 0.840847 3: 0.829509 0.109957 0.401306 0.350752 0.123104 4: 0.561695 0.438290E-01 0.754673 0.945448E-01 0.751236E-02 5: 0.415307 0.633966 0.797287 0.136169E-01 0.260303 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_PRINT_TEST R8MAT_TRANSPOSE_PRINT prints a R8MAT, transposed. Matrix row order M = 7 Matrix column order N = 12 The transposed matrix A: Row 1 2 3 4 5 Col 1: 101.000 201.000 301.000 401.000 501.000 2: 102.000 202.000 302.000 402.000 502.000 3: 103.000 203.000 303.000 403.000 503.000 4: 104.000 204.000 304.000 404.000 504.000 5: 105.000 205.000 305.000 405.000 505.000 6: 106.000 206.000 306.000 406.000 506.000 7: 107.000 207.000 307.000 407.000 507.000 8: 108.000 208.000 308.000 408.000 508.000 9: 109.000 209.000 309.000 409.000 509.000 10: 110.000 210.000 310.000 410.000 510.000 11: 111.000 211.000 311.000 411.000 511.000 12: 112.000 212.000 312.000 412.000 512.000 Row 6 7 Col 1: 601.000 701.000 2: 602.000 702.000 3: 603.000 703.000 4: 604.000 704.000 5: 605.000 705.000 6: 606.000 706.000 7: 607.000 707.000 8: 608.000 708.000 9: 609.000 709.000 10: 610.000 710.000 11: 611.000 711.000 12: 612.000 712.000 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_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 a matrix to random values. Using initial random number seed = 123456789 The random matrix: Col 1 2 3 4 Row 1: 3.74735 2.52895 2.49382 2.01471 2: 9.65054 4.06062 5.59631 9.18003 3: 8.63607 2.87965 5.21045 4.80602 4: 6.49356 2.35063 8.03739 2.75636 5: 5.32246 7.07173 8.37830 2.10894 R8PLU_DET_TEST R8PLU_DET determines the determinant of a matrix from its compressed PLU factors. Using initial random number seed = 123456789 Matrix order N = 5 The matrix A: Col 1 2 3 4 5 Row 1: 0.218418 0.661187E-01 0.617272E-01 0.183837E-02 0.859097 2: 0.956318 0.257578 0.449539 0.897504 0.840847 3: 0.829509 0.109957 0.401306 0.350752 0.123104 4: 0.561695 0.438290E-01 0.754673 0.945448E-01 0.751236E-02 5: 0.415307 0.633966 0.797287 0.136169E-01 0.260303 The determinant = 0.112888 R8PLU_INVERSE_TEST R8PLU_INVERSE determines the inverse of a matrix from its compressed PLU factors. Using initial random number seed = 123456789 Matrix order N = 5 The matrix A: Col 1 2 3 4 5 Row 1: 0.218418 0.661187E-01 0.617272E-01 0.183837E-02 0.859097 2: 0.956318 0.257578 0.449539 0.897504 0.840847 3: 0.829509 0.109957 0.401306 0.350752 0.123104 4: 0.561695 0.438290E-01 0.754673 0.945448E-01 0.751236E-02 5: 0.415307 0.633966 0.797287 0.136169E-01 0.260303 The inverse matrix B: Col 1 2 3 4 5 Row 1: 0.625209 -1.02220 2.84978 -0.868794 -0.840984E-01 2: -0.471548 -0.149728 0.892032 -2.12070 1.67928 3: -0.274368 0.546937 -1.95265 2.05705 0.285593E-02 4: -1.39029 1.75848 -1.70625 0.283212 -0.293107 5: 1.06404 0.228349 -0.649235 0.235691 -0.107439 The product matrix C = A * B: Col 1 2 3 4 5 Row 1: 1.00000 0.111022E-15 -0.111022E-15 0.00000 -0.138778E-16 2: -0.222045E-15 1.00000 0.111022E-15 -0.138778E-15 -0.277556E-16 3: -0.249800E-15 0.353884E-15 1.00000 -0.176942E-15 0.00000 4: -0.301842E-15 0.360389E-15 -0.210769E-15 1.00000 -0.101915E-16 5: -0.111022E-15 0.624500E-16 -0.166533E-15 -0.194289E-15 1.00000 R8PLU_MUL_TEST R8PLU_MUL computes the product A*x=b using the compressed PLU factors of A. Using initial random number seed = 123456789 Matrix order N = 5 The matrix A: Col 1 2 3 4 5 Row 1: 0.218418 0.661187E-01 0.617272E-01 0.183837E-02 0.859097 2: 0.956318 0.257578 0.449539 0.897504 0.840847 3: 0.829509 0.109957 0.401306 0.350752 0.123104 4: 0.561695 0.438290E-01 0.754673 0.945448E-01 0.751236E-02 5: 0.415307 0.633966 0.797287 0.136169E-01 0.260303 The right hand side B (computed from A): 1: 4.8386752 2: 10.614344 3: 4.2718706 4: 3.3291147 5: 5.4310819 The right hand side B (computed from PLU): 1: 4.8386752 2: 10.614344 3: 4.2718706 4: 3.3291147 5: 5.4310819 R8PLU_SOL_TEST R8PLU_SOL solves a linear system A*x=b using the compressed PLU factors of A. Using initial random number seed = 123456789 Matrix order N = 5 The matrix A: Col 1 2 3 4 5 Row 1: 0.218418 0.661187E-01 0.617272E-01 0.183837E-02 0.859097 2: 0.956318 0.257578 0.449539 0.897504 0.840847 3: 0.829509 0.109957 0.401306 0.350752 0.123104 4: 0.561695 0.438290E-01 0.754673 0.945448E-01 0.751236E-02 5: 0.415307 0.633966 0.797287 0.136169E-01 0.260303 The right hand side B: 1: 4.8386752 2: 10.614344 3: 4.2718706 4: 3.3291147 5: 5.4310819 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. Using initial random number seed = 123456789 Matrix order N = 5 The matrix A: Col 1 2 3 4 5 Row 1: 0.218418 0.661187E-01 0.617272E-01 0.183837E-02 0.859097 2: 0.956318 0.257578 0.449539 0.897504 0.840847 3: 0.829509 0.109957 0.401306 0.350752 0.123104 4: 0.561695 0.438290E-01 0.754673 0.945448E-01 0.751236E-02 5: 0.415307 0.633966 0.797287 0.136169E-01 0.260303 The pivot vector P: 1: 2 2: 5 3: 4 4: 4 5: 5 The compressed LU factors: Col 1 2 3 4 5 Row 1: 0.956318 0.257578 0.449539 0.897504 0.840847 2: -0.228395 0.522106 0.602062 -0.376149 -0.104858 3: -0.867399 0.217324 0.614552 -0.510026 -0.507943 4: -0.587352 0.205820 -0.231419 -0.391459 -0.511487 5: -0.434277 -0.139612E-01 0.803036E-01 -0.610161 0.939815 The recovered matrix A2: Col 1 2 3 4 5 Row 1: 0.218418 0.661187E-01 0.617272E-01 0.183837E-02 0.859097 2: 0.956318 0.257578 0.449539 0.897504 0.840847 3: 0.829509 0.109957 0.401306 0.350752 0.123104 4: 0.561695 0.438290E-01 0.754673 0.945448E-01 0.751236E-02 5: 0.415307 0.633966 0.797287 0.136169E-01 0.260303 R8POLY_DEGREE_TEST R8POLY_DEGREE determines the degree of an R8POLY. The R8POLY: p(x) = 4.00000 * x ^ 3 + 3.00000 * x ^ 2 + 2.00000 * x + 1.00000 Dimensioned degree = 3 Actual degree = 3 The R8POLY: p(x) = 0.00000 * x ^ 3 + 3.00000 * x ^ 2 + 2.00000 * x + 1.00000 Dimensioned degree = 3 Actual degree = 2 The R8POLY: p(x) = 4.00000 * x ^ 3 + 2.00000 * x + 1.00000 Dimensioned degree = 3 Actual degree = 3 The R8POLY: p(x) = 0.00000 * x ^ 3 + 1.00000 Dimensioned degree = 3 Actual degree = 0 The R8POLY: p(x) = 0.00000 * x ^ 3 Dimensioned degree = 3 Actual degree = 0 R8POLY_DERIV_TEST R8POLY_DERIV computes the coefficients of the derivative of a polynomial. The initial polynomial p(x) = 1.00000 * x ^ 4 - 10.0000 * x ^ 3 + 35.0000 * x ^ 2 - 50.0000 * x + 24.0000 The derivative of order 0 p(x) = 1.00000 * x ^ 4 - 10.0000 * x ^ 3 + 35.0000 * x ^ 2 - 50.0000 * x + 24.0000 The derivative of order 1 p(x) = 4.00000 * x ^ 3 - 30.0000 * x ^ 2 + 70.0000 * x - 50.0000 The derivative of order 2 p(x) = 12.0000 * x ^ 2 - 60.0000 * x + 70.0000 The derivative of order 3 p(x) = 24.0000 * x - 60.0000 The derivative of order 4 p(x) = 0 R8POLY_LAGRANGE_COEF_TEST R8POLY_LAGRANGE_COEF returns the coefficients for a Lagrange basis polynomial. R8POLY_PRINT prints a polynomial. Abscissas: 1: 1.0000000 2: 2.0000000 3: 3.0000000 4: 4.0000000 5: 5.0000000 The Lagrange basis polynomial: p(x) = 0.416667E-01 * x ^ 4 - 0.583333 * x ^ 3 + 2.95833 * x ^ 2 - 6.41667 * x + 5.00000 The Lagrange basis polynomial: p(x) = - 0.166667 * x ^ 4 + 2.16667 * x ^ 3 - 9.83333 * x ^ 2 + 17.8333 * x - 10.0000 The Lagrange basis polynomial: p(x) = 0.250000 * x ^ 4 - 3.00000 * x ^ 3 + 12.2500 * x ^ 2 - 19.5000 * x + 10.0000 The Lagrange basis polynomial: p(x) = - 0.166667 * x ^ 4 + 1.83333 * x ^ 3 - 6.83333 * x ^ 2 + 10.1667 * x - 5.00000 The Lagrange basis polynomial: p(x) = 0.416667E-01 * x ^ 4 - 0.416667 * x ^ 3 + 1.45833 * x ^ 2 - 2.08333 * x + 1.00000 R8POLY_LAGRANGE_0_TEST R8POLY_LAGRANGE_0 evaluates the Lagrange factor W(X) at a point. The number of data points is 5 Abscissas: 1: 0.0000000 2: 1.0000000 3: 2.0000000 4: 3.0000000 5: 4.0000000 X W(X) 0.000 0.000 0.2222 3.224 0.4444 3.490 0.6667 2.305 0.8889 0.7208 1.111 -0.5988 1.333 -1.317 1.556 -1.356 1.778 -0.8346 2.000 0.000 2.222 0.8346 2.444 1.356 2.667 1.317 2.889 0.5988 3.111 -0.7208 3.333 -2.305 3.556 -3.490 3.778 -3.224 4.000 0.000 R8POLY_LAGRANGE_1_TEST R8POLY_LAGRANGE_1 evaluates the Lagrange factor W'(X) at a point. The number of data points is 5 Abscissas: 1: 0.0000000 2: 1.0000000 3: 2.0000000 4: 3.0000000 5: 4.0000000 X W'(X) 0.000 24.00 0.2222 6.536 0.4444 -3.020 0.6667 -6.864 0.8889 -6.898 1.111 -4.730 1.333 -1.679 1.556 1.232 1.778 3.271 2.000 4.000 2.222 3.271 2.444 1.232 2.667 -1.679 2.889 -4.730 3.111 -6.898 3.333 -6.864 3.556 -3.020 3.778 6.536 4.000 24.00 R8POLY_LAGRANGE_2_TEST R8POLY_LAGRANGE_2 evaluates the Lagrange factor W"(X) at a point. The number of data points is 5 Abscissas: 1: 0.0000000 2: 1.0000000 3: 2.0000000 4: 3.0000000 5: 4.0000000 X W"(X) 0.000 -100.0 0.2222 -59.04 0.4444 -28.61 0.6667 -7.407 0.8889 5.898 1.111 12.62 1.333 14.07 1.556 11.58 1.778 6.447 2.000 0.000 2.222 -6.447 2.444 -11.58 2.667 -14.07 2.889 -12.62 3.111 -5.898 3.333 7.407 3.556 28.61 3.778 59.04 4.000 100.0 R8POLY_LAGRANGE_FACTOR_TEST R8POLY_LAGRANGE_FACTOR evaluates the Lagrange factor W(X) at a point. For this test, we use 5 functions. Abscissas: 1: 0.0000000 2: 0.80000000 3: 1.6000000 4: 2.4000000 5: 3.2000000 X W(X) W'(X) 4.5000 131.8180 274.5429 4.0000 39.3216 112.2304 3.5000 5.9251 32.1429 3.0000 -1.1088 2.0304 2.5000 -0.2678 -2.8571 2.0000 0.4608 0.2304 1.5000 -0.1607 1.5429 1.0000 -0.3696 -1.1696 0.5000 0.8465 -2.6571 0.0000 0.0000 9.8304 R8POLY_LAGRANGE_VAL_TEST R8POLY_LAGRANGE_VAL evaluates a Lagrange interpolating polynomial at a point. Number of data points = 5 Abscissas: 1: 0.0000000 2: 1.0000000 3: 2.0000000 4: 3.0000000 5: 4.0000000 Here are the values of the functions at several points: X L1 L2 L3 L4 L5 0.000 1.000 0.000 -0.000 0.000 -0.000 0.5000 0.2734 1.094 -0.5469 0.2188 -0.3906E-01 1.000 -0.000 1.000 0.000 -0.000 0.000 1.500 -0.3906E-01 0.4688 0.7031 -0.1562 0.2344E-01 2.000 0.000 -0.000 1.000 0.000 -0.000 2.500 0.2344E-01 -0.1562 0.7031 0.4688 -0.3906E-01 3.000 -0.000 0.000 -0.000 1.000 0.000 3.500 -0.3906E-01 0.2188 -0.5469 1.094 0.2734 4.000 0.000 -0.000 0.000 -0.000 1.000 And the derivatives: X L'1 L'2 L'3 L'4 L'5 0.000 -2.083 4.000 -3.000 1.333 -0.2500 0.5000 -0.9167 0.7083 0.3750 -0.2083 0.4167E-01 1.000 -0.2500 -0.8333 1.500 -0.5000 0.8333E-01 1.500 0.4167E-01 -1.125 1.125 -0.4167E-01 0.000 2.000 0.8333E-01 -0.6667 0.000 0.6667 -0.8333E-01 2.500 0.000 0.4167E-01 -1.125 1.125 -0.4167E-01 3.000 -0.8333E-01 0.5000 -1.500 0.8333 0.2500 3.500 -0.4167E-01 0.2083 -0.3750 -0.7083 0.9167 4.000 0.2500 -1.333 3.000 -4.000 2.083 R8POLY_PRINT_TEST R8POLY_PRINT prints an R8POLY. The R8POLY: p(x) = 9.00000 * x ^ 5 + 0.780000 * x ^ 4 + 56.0000 * x ^ 2 - 3.40000 * x + 12.0000 R8POLY_VALUE_HORNER_TEST R8POLY_VALUE_HORNER evaluates a polynomial at one point, using Horner's method. The polynomial coefficients: p(x) = 1.00000 * x ^ 4 - 10.0000 * x ^ 3 + 35.0000 * x ^ 2 - 50.0000 * x + 24.0000 I X P(X) 1 0.0000 24.0000 2 0.3333 10.8642 3 0.6667 3.45679 4 1.0000 0.00000 5 1.3333 -0.987654 6 1.6667 -0.691358 7 2.0000 0.00000 8 2.3333 0.493827 9 2.6667 0.493827 10 3.0000 0.00000 11 3.3333 -0.691358 12 3.6667 -0.987654 13 4.0000 0.00000 14 4.3333 3.45679 15 4.6667 10.8642 16 5.0000 24.0000 R8POLY_VALUES_HORNER_TEST R8POLY_VALUES_HORNER evaluates a polynomial at a point, using Horner's method. The polynomial: p(x) = 1.00000 * x ^ 4 - 10.0000 * x ^ 3 + 35.0000 * x ^ 2 - 50.0000 * x + 24.0000 X, P(X) 1: 0.00000 24.0000 2: 0.333333 10.8642 3: 0.666667 3.45679 4: 1.00000 0.00000 5: 1.33333 -0.987654 6: 1.66667 -0.691358 7: 2.00000 0.00000 8: 2.33333 0.493827 9: 2.66667 0.493827 10: 3.00000 0.00000 11: 3.33333 -0.691358 12: 3.66667 -0.987654 13: 4.00000 0.00000 14: 4.33333 3.45679 15: 4.66667 10.8642 16: 5.00000 24.0000 R8POLY2_EX_TEST R8POLY2_EX finds the extreme value of a parabola determined by three points. Parabolic coefficients A, B, C = 2.00000 -4.00000 10.0000 Point 1 : ( 1.00000 , 8.00000 ) Point 2 : ( 2.00000 , 10.0000 ) Point 3 : ( 3.00000 , 16.0000 ) R8POLY2_EX returns XMIN, YMIN = 1.00000 8.00000 R8POLY2_EX2_TEST R8POLY2_EX2 finds the extreme value of a parabola determined by three points. Parabolic coefficients A, B, C = 2.00000 -4.00000 10.0000 Point 1 : ( 1.00000 , 8.00000 ) Point 2 : ( 2.00000 , 10.0000 ) Point 3 : ( 3.00000 , 16.0000 ) R8POLY2_EX2 returns XMIN, YMIN = 1.00000 8.00000 and A, B, C = 2.00000 -4.00000 10.0000 R8POLY2_ROOT_TEST R8POLY2_ROOT finds quadratic equation roots. A B C R1 R2 2.0 -2.0 -24.0 4.00000 -0.00000 -3.00000 0.00000 1.0 -20.0 100.0 10.0000 -0.00000 10.0000 0.00000 1.0 -2.0 10.0 1.00000 3.00000 1.00000 -3.00000 R8POLY2_VAL_TEST R8POLY2_VAL evaluates a parabola given 3 data points. Our parabola will be 2*x*x + 3 * x + 1. Case 1: 3 distinct data points: -1.00000 0.00000 1.00000 6.00000 3.00000 28.0000 Sampled data: X, Y, Y', Y" 0.00000 1.00000 3.00000 4.00000 1.00000 6.00000 7.00000 4.00000 2.00000 15.0000 11.0000 4.00000 3.00000 28.0000 15.0000 4.00000 Case 2: X1=X2, X3 distinct: -1.00000 0.00000 -1.00000 -1.00000 3.00000 28.0000 Sampled data: X, Y, Y', Y" 0.00000 1.00000 3.00000 4.00000 1.00000 6.00000 7.00000 4.00000 2.00000 15.0000 11.0000 4.00000 3.00000 28.0000 15.0000 4.00000 Case 3: X1=X2=X3: -1.00000 0.00000 -1.00000 -1.00000 -1.00000 4.00000 Sampled data: X, Y, Y', Y" 0.00000 1.00000 3.00000 4.00000 1.00000 6.00000 7.00000 4.00000 2.00000 15.0000 11.0000 4.00000 3.00000 28.0000 15.0000 4.00000 R8POLY2_VAL2_TEST R8POLY2_VAL2 evaluates parabolas through 3 points in a table Our data tables will actually be parabolas: A: 2*x^2 + 3 * x + 1. B: 4*x^2 - 2 * x + 5. 1 2.00000 15.0000 17.0000 2 4.00000 45.0000 61.0000 3 6.00000 91.0000 137.000 4 8.00000 153.000 245.000 5 10.0000 231.000 385.000 Interpolated data: LEFT, X, Y1, Y2 1 1.00000 6.00000 7.00000 2 3.00000 28.0000 35.0000 3 5.00000 66.0000 95.0000 3 7.00000 120.000 187.000 3 9.00000 190.000 311.000 R8POLY3_ROOT_TEST R8POLY3_ROOT finds roots of cubic equations. Polynomial coefficients A, B, C, D: 1.00000 -6.00000 11.0000 -6.00000 Roots: 1.00000 0.00000 3.00000 0.00000 2.00000 0.00000 Polynomial coefficients A, B, C, D: 9.00000 -36.0000 54.0000 -27.0000 Roots: 1.00000 0.00000 1.50000 -0.866025 1.50000 0.866025 Polynomial coefficients A, B, C, D: 1.00000 -5.00000 8.00000 -4.00000 Roots: 1.00000 0.00000 2.00000 0.00000 2.00000 0.00000 Polynomial coefficients A, B, C, D: 1.00000 -8.00000 25.0000 -26.0000 Roots: 2.00000 0.00000 3.00000 -2.00000 3.00000 2.00000 R8POLY4_ROOT_TEST R8POLY4_ROOT finds roots of quartic equations. A = 1.00000 B = -10.0000 C = 35.0000 D = -50.0000 E = 24.0000 Roots: 4.00000 0.00000 1.00000 0.00000 3.00000 0.00000 2.00000 0.00000 A = 1.00000 B = -5.00000 C = 1.00000 D = 21.0000 E = -18.0000 Roots: 3.00000 0.00000 3.00000 0.00000 1.00000 0.00000 -2.00000 0.00000 A = 1.00000 B = -22.0000 C = 141.000 D = -220.000 E = 100.000 Roots: 10.0000 0.00000 10.0000 0.00000 1.00000 0.00000 1.00000 0.00000 A = 1.00000 B = -16.0000 C = 72.0000 D = -128.000 E = 80.0000 Roots: 10.0000 0.00000 2.00000 0.00000 2.00000 0.00000 2.00000 0.00000 A = 1.00000 B = -20.0000 C = 150.000 D = -500.000 E = 625.000 Roots: 5.00000 0.00000 5.00000 0.00000 5.00000 0.00000 5.00000 0.00000 A = 1.00000 B = 2.00000 C = 1.00000 D = 8.00000 E = -12.0000 Roots: -0.166533E-15 2.00000 -0.166533E-15 -2.00000 1.00000 0.00000 -3.00000 0.00000 A = 1.00000 B = 0.00000 C = 13.0000 D = 0.00000 E = 36.0000 Roots: 0.00000 3.00000 0.00000 2.00000 0.00000 -2.00000 -0.00000 -3.00000 R8ROW_MAX_TEST For a R8ROW (a matrix regarded as rows): R8ROW_MAX computes maximums; The original matrix: 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 Row maximums: 1: 4.0000000 2: 8.0000000 3: 12.000000 R8ROW_MEAN_TEST For a R8ROW (a matrix regarded as rows): R8ROW_MEAN computes means; The original matrix: 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 Row means: 1: 2.5000000 2: 6.5000000 3: 10.500000 R8ROW_MIN_TEST For a R8ROW (a matrix regarded as rows): R8ROW_MIN computes minimums; The original matrix: 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 Row minimums: 1: 1.0000000 2: 5.0000000 3: 9.0000000 R8ROW_PART_QUICK_A_TEST For an R8ROW; R8ROW_PART_QUICK_A partitions the matrix. The matrix: Col 1 2 Row 1: 2.00000 4.00000 2: 8.00000 8.00000 3: 6.00000 2.00000 4: 0.00000 2.00000 5: 10.0000 6.00000 6: 10.0000 0.00000 7: 0.00000 6.00000 8: 5.00000 8.00000 L = 2 R = 4 The partitioned matrix: Col 1 2 Row 1: 0.00000 6.00000 2: 0.00000 2.00000 3: 2.00000 4.00000 4: 10.0000 6.00000 5: 10.0000 0.00000 6: 6.00000 2.00000 7: 5.00000 8.00000 8: 8.00000 8.00000 R8ROW_SORT_HEAP_A_TEST For an R8ROW; R8ROW_SORT_HEAP_A does an ascending heap sort The unsorted matrix: Col 1 2 3 Row 1: 2.00000 6.00000 10.0000 2: 4.00000 8.00000 12.0000 3: 1.00000 5.00000 9.00000 4: 3.00000 7.00000 11.0000 The sorted matrix: Col 1 2 3 Row 1: 1.00000 5.00000 9.00000 2: 2.00000 6.00000 10.0000 3: 3.00000 7.00000 11.0000 4: 4.00000 8.00000 12.0000 R8ROW_SORT_HEAP_INDEX_A_TEST R8ROW_SORT_HEAP_INDEX_A computes an index vector which ascending sorts an R8ROW. The unsorted R8ROW: Row 1 2 3 4 5 Col 1: 2.00000 4.00000 1.00000 3.00000 2.00000 2: 6.00000 8.00000 5.00000 7.00000 6.00000 3: 10.0000 12.0000 9.00000 11.0000 0.00000 Row 6 7 8 9 10 Col 1: 3.00000 0.00000 0.00000 2.00000 3.00000 2: 4.00000 0.00000 6.00000 6.00000 7.00000 3: 18.0000 0.00000 10.0000 10.0000 11.0000 Row 11 12 13 14 15 Col 1: 2.00000 2.00000 1.00000 1.00000 1.00000 2: 0.00000 6.00000 5.00000 5.00000 5.10000 3: 10.0000 10.0000 9.00000 9.10000 9.00000 The implicitly sorted R8ROW 7: 0.0 0.0 0.0 8: 0.0 6.0 10.0 13: 1.0 5.0 9.0 3: 1.0 5.0 9.0 14: 1.0 5.0 9.1 15: 1.0 5.1 9.0 11: 2.0 0.0 10.0 5: 2.0 6.0 0.0 12: 2.0 6.0 10.0 9: 2.0 6.0 10.0 1: 2.0 6.0 10.0 6: 3.0 4.0 18.0 10: 3.0 7.0 11.0 4: 3.0 7.0 11.0 2: 4.0 8.0 12.0 R8ROW_SORT_QUICK_A_TEST For an R8ROW; R8ROW_SORT_QUICK_A does a quicksort. The unsorted matrix: Col 1 2 3 Row 1: 2.18418 0.617272 8.59097 2: 9.56318 4.49539 8.40847 3: 8.29509 4.01306 1.23104 4: 5.61695 7.54673 0.751236E-01 5: 4.15307 7.97287 2.60303 6: 0.661187 0.183837E-01 9.12484 7: 2.57578 8.97504 1.13664 8: 1.09957 3.50752 3.51629 9: 0.438290 0.945448 8.22887 10: 6.33966 0.136169 2.67132 The sorted matrix: Col 1 2 3 Row 1: 0.438290 0.945448 8.22887 2: 0.661187 0.183837E-01 9.12484 3: 1.09957 3.50752 3.51629 4: 2.18418 0.617272 8.59097 5: 2.57578 8.97504 1.13664 6: 4.15307 7.97287 2.60303 7: 5.61695 7.54673 0.751236E-01 8: 6.33966 0.136169 2.67132 9: 8.29509 4.01306 1.23104 10: 9.56318 4.49539 8.40847 R8ROW_SUM_TEST For a R8ROW (a matrix regarded as rows): R8ROW_SUM computes sums; The original matrix: 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 The row sums: 1: 10.000000 2: 26.000000 3: 42.000000 R8ROW_SWAP_TEST For a R8ROW (a matrix regarded as rows): R8ROW_SWAP swaps two rows; The original matrix: 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 Swap rows 1 and 3 The modified matrix: Col 1 2 3 4 Row 1: 9.00000 10.0000 11.0000 12.0000 2: 5.00000 6.00000 7.00000 8.00000 3: 1.00000 2.00000 3.00000 4.00000 R8ROW_TO_R8VEC_TEST R8ROW_TO_R8VEC converts an array of rows into a vector. The array of rows: 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 The resulting vector of rows: 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 R8ROW_VARIANCE_TEST For a R8ROW (a matrix regarded as rows): R8ROW_VARIANCE computes variances; The original matrix: 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 Row variances: 1 1.6667 2 1.6667 3 1.6667 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 Row 2 21.0000 3 31.0000 32.0000 4 41.0000 42.0000 43.0000 5 51.0000 52.0000 53.0000 54.0000 6 61.0000 62.0000 63.0000 64.0000 65.0000 7 71.0000 72.0000 73.0000 74.0000 75.0000 Col 6 Row 7 76.0000 R8SLMAT Col 1 2 3 Row 2 21.0000 3 31.0000 32.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 R8SLMAT Col 1 2 3 Row 2 21.0000 3 31.0000 32.0000 4 41.0000 42.0000 43.0000 R8VEC_AMAX_TEST For a R8VEC: R8VEC_AMAX: maximum magnitude entry; what the hell? Input vector: 1: -2.8158170 2: 4.5631758 3: 3.2950923 4: 0.61695443 5: -0.84692919 6: -4.3388127 7: -2.4242221 8: -3.9004321 9: -4.5617100 10: 1.3396571 Maximum absolute: 4.56318 R8VEC_AMIN_TEST For a R8VEC: R8VEC_AMIN: minimum magnitude entry. Input vector: 1: -2.8158170 2: 4.5631758 3: 3.2950923 4: 0.61695443 5: -0.84692919 6: -4.3388127 7: -2.4242221 8: -3.9004321 9: -4.5617100 10: 1.3396571 Minimum absolute: 0.616954 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_CHEBYSPACE_TEST R8VEC_CHEBYSPACE computes N Chebyshev 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_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_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 vectors. 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_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_EVEN_TEST R8VEC_EVEN computes 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.21841830 2: 0.95631758 3: 0.82950923 4: 0.56169544 5: 0.41530708 6: 0.66118735E-01 7: 0.25757779 8: 0.10995679 9: 0.43828998E-01 10: 0.63396571 Fractile Value 1 0.438290E-01 6 0.415307 R8VEC_HEAP_D_EXTRACT_TEST For a heap descending sorted R8VEC, R8VEC_HEAP_D_EXTRACT extracts the maximum value; Inserting value 2.1842 Current maximum value is 2.1842 Inserting value 9.5632 Current maximum value is 9.5632 Inserting value 8.2951 Current maximum value is 9.5632 Inserting value 5.6170 Current maximum value is 9.5632 Inserting value 4.1531 Current maximum value is 9.5632 Inserting value 0.6612 Current maximum value is 9.5632 Inserting value 2.5758 Current maximum value is 9.5632 Inserting value 1.0996 Current maximum value is 9.5632 Inserting value 0.4383 Current maximum value is 9.5632 Inserting value 6.3397 Current maximum value is 9.5632 Current heap as a vector: 1: 9.5631758 2: 6.3396571 3: 8.2950923 4: 2.1841830 5: 5.6169544 6: 0.66118735 7: 2.5757779 8: 1.0995679 9: 0.43828998 10: 4.1530708 Now extract the maximum several times. Extracting maximum element = 9.5632 Extracting maximum element = 8.2951 Extracting maximum element = 6.3397 Extracting maximum element = 5.6170 Extracting maximum element = 4.1531 Current heap as a vector: 1: 2.5757779 2: 2.1841830 3: 1.0995679 4: 0.66118735 5: 0.43828998 R8VEC_HEAP_D_INSERT_TEST For a heap descending sorted R8VEC, R8VEC_HEAP_D_INSERT inserts a value into the heap. Inserting value 2.1842 Current maximum value is 2.1842 Inserting value 9.5632 Current maximum value is 9.5632 Inserting value 8.2951 Current maximum value is 9.5632 Inserting value 5.6170 Current maximum value is 9.5632 Inserting value 4.1531 Current maximum value is 9.5632 Inserting value 0.6612 Current maximum value is 9.5632 Inserting value 2.5758 Current maximum value is 9.5632 Inserting value 1.0996 Current maximum value is 9.5632 Inserting value 0.4383 Current maximum value is 9.5632 Inserting value 6.3397 Current maximum value is 9.5632 Current heap as a vector: 1: 9.5631758 2: 6.3396571 3: 8.2950923 4: 2.1841830 5: 5.6169544 6: 0.66118735 7: 2.5757779 8: 1.0995679 9: 0.43828998 10: 4.1530708 R8VEC_HEAP_D_MAX_TEST For a heap descending sorted R8VEC, R8VEC_HEAP_D_MAX reports the maximum value. Inserting value 2.1842 Current maximum value is 2.1842 Inserting value 9.5632 Current maximum value is 9.5632 Inserting value 8.2951 Current maximum value is 9.5632 Inserting value 5.6170 Current maximum value is 9.5632 Inserting value 4.1531 Current maximum value is 9.5632 Inserting value 0.6612 Current maximum value is 9.5632 Inserting value 2.5758 Current maximum value is 9.5632 Inserting value 1.0996 Current maximum value is 9.5632 Inserting value 0.4383 Current maximum value is 9.5632 Inserting value 6.3397 Current maximum value is 9.5632 Current heap as a vector: 1: 9.5631758 2: 6.3396571 3: 8.2950923 4: 2.1841830 5: 5.6169544 6: 0.66118735 7: 2.5757779 8: 1.0995679 9: 0.43828998 10: 4.1530708 R8VEC_HISTOGRAM_TEST R8VEC_HISTOGRAM histograms a real vector. Uniform data: Histogram of data: 0.0000 0 0.0000 0.0500 63 0.0500 0.1000 37 0.1000 0.1500 49 0.1500 0.2000 37 0.2000 0.2500 46 0.2500 0.3000 57 0.3000 0.3500 49 0.3500 0.4000 52 0.4000 0.4500 51 0.4500 0.5000 49 0.5000 0.5500 50 0.5500 0.6000 56 0.6000 0.6500 60 0.6500 0.7000 52 0.7000 0.7500 44 0.7500 0.8000 47 0.8000 0.8500 54 0.8500 0.9000 48 0.9000 0.9500 52 0.9500 1.0000 47 1.0000 0 Normal data: Histogram of data: -3.0000 0 -3.0000 -2.7000 2 -2.7000 -2.4000 2 -2.4000 -2.1000 11 -2.1000 -1.8000 12 -1.8000 -1.5000 32 -1.5000 -1.2000 55 -1.2000 -0.9000 66 -0.9000 -0.6000 75 -0.6000 -0.3000 115 -0.3000 0.0000 111 0.0000 0.3000 115 0.3000 0.6000 117 0.6000 0.9000 103 0.9000 1.2000 65 1.2000 1.5000 46 1.5000 1.8000 29 1.8000 2.1000 17 2.1000 2.4000 15 2.4000 2.7000 7 2.7000 3.0000 4 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: -2.81582 -0.846929 -4.56171 -0.986937 2: 4.56318 -4.33881 1.33966 2.54673 3: 3.29509 -2.42422 -4.38273 2.97287 4: 0.616954 -3.90043 -0.504610 -4.98162 Working on column K = 1 Householder matrix H: Col 1 2 3 4 Row 1: -0.445277 0.721595 0.521067 0.975617E-01 2: 0.721595 0.639724 -0.260157 -0.487104E-01 3: 0.521067 -0.260157 0.812139 -0.351740E-01 4: 0.975617E-01 -0.487104E-01 -0.351740E-01 0.993414 Product H*A: Col 1 2 3 4 Row 1: 6.32374 -4.39746 0.664989 3.34022 2: -0.239392E-15 -2.56611 -1.26992 0.386281 3: -0.183881E-15 -1.14415 -6.26711 1.41280 4: 0.00000 -3.66076 -0.857432 -5.27372 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.556077 -0.247937 -0.793288 3: 0.00000 -0.247937 0.960495 -0.126398 4: 0.00000 -0.793288 -0.126398 0.595582 Product H*A: Col 1 2 3 4 Row 1: 6.32374 -4.39746 0.664989 3.34022 2: 0.178711E-15 4.61467 2.94021 3.61849 3: -0.117262E-15 -0.222045E-15 -5.59630 1.92780 4: 0.213149E-15 -0.444089E-15 1.28889 -3.62594 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.974489 0.224436 4: 0.00000 0.00000 0.224436 0.974489 Product H*A: Col 1 2 3 4 Row 1: 6.32374 -4.39746 0.664989 3.34022 2: 0.178711E-15 4.61467 2.94021 3.61849 3: 0.162109E-15 0.116711E-15 5.74280 -2.69241 4: 0.181393E-15 -0.482595E-15 0.222045E-15 -3.10077 R8VEC_INDEX_DELETE_ALL_TEST R8VEC_INDEX_DELETE_ALL deletes all copies of a particular value. 4.00 19.00 17.00 11.00 8.00 1.00 5.00 2.00 1.00 13.00 1.00 9.00 8.00 15.00 16.00 0.00 18.00 7.00 2.00 0.00 Indexed list of entries: I INDX(I) X(I) X(INDX(I)) 1 18 8.00 0.00 2 22 7.00 0.00 3 8 4.00 1.00 4 13 19.00 1.00 5 11 17.00 1.00 6 10 11.00 2.00 7 21 8.00 2.00 8 3 1.00 4.00 9 9 5.00 5.00 10 2 2.00 7.00 11 20 1.00 7.00 12 23 13.00 7.00 13 1 1.00 8.00 14 15 9.00 8.00 15 24 8.00 8.00 16 7 15.00 8.00 17 14 16.00 9.00 18 6 0.00 11.00 19 12 18.00 13.00 20 16 7.00 15.00 21 17 2.00 16.00 22 5 0.00 17.00 23 19 7.00 18.00 24 4 8.00 19.00 Call R8VEC_INDEX_DELETE_ALL to delete all values of 7: Indexed list of entries: I INDX(I) X(I) X(INDX(I)) 1 17 8.00 0.00 2 20 4.00 0.00 3 7 19.00 1.00 4 12 17.00 1.00 5 10 11.00 1.00 6 9 8.00 2.00 7 19 1.00 2.00 8 2 5.00 4.00 9 8 2.00 5.00 10 1 1.00 8.00 11 14 13.00 8.00 12 21 1.00 8.00 13 6 9.00 8.00 14 13 8.00 9.00 15 5 15.00 11.00 16 11 16.00 13.00 17 15 0.00 15.00 18 16 18.00 16.00 19 4 2.00 17.00 20 18 0.00 18.00 21 3 8.00 19.00 R8VEC_INDEX_DELETE_DUPES_TEST R8VEC_INDEX_DELETE_DUPES deletes duplicates. 4.00 19.00 17.00 11.00 8.00 1.00 5.00 2.00 1.00 13.00 1.00 9.00 8.00 15.00 16.00 0.00 18.00 7.00 2.00 0.00 Indexed list of entries: I INDX(I) X(I) X(INDX(I)) 1 18 8.00 0.00 2 22 7.00 0.00 3 8 4.00 1.00 4 13 19.00 1.00 5 11 17.00 1.00 6 10 11.00 2.00 7 21 8.00 2.00 8 3 1.00 4.00 9 9 5.00 5.00 10 2 2.00 7.00 11 20 1.00 7.00 12 23 13.00 7.00 13 1 1.00 8.00 14 15 9.00 8.00 15 24 8.00 8.00 16 7 15.00 8.00 17 14 16.00 9.00 18 6 0.00 11.00 19 12 18.00 13.00 20 16 7.00 15.00 21 17 2.00 16.00 22 5 0.00 17.00 23 19 7.00 18.00 24 4 8.00 19.00 Call R8VEC_INDEX_DELETE_DUPES to delete duplicates: Indexed list of unique entries: I INDX(I) X(I) 1 1 0.00 2 2 1.00 3 3 2.00 4 4 4.00 5 5 5.00 6 6 7.00 7 7 8.00 8 8 9.00 9 9 11.00 10 10 13.00 11 11 15.00 12 12 16.00 13 13 17.00 14 14 18.00 15 15 19.00 R8VEC_INDEX_DELETE_ONE_TEST R8VEC_INDEX_DELETE_ONE deletes one copies of a particular value. 4.00 19.00 17.00 11.00 8.00 1.00 5.00 2.00 1.00 13.00 1.00 9.00 8.00 15.00 16.00 0.00 18.00 7.00 2.00 0.00 Indexed list of entries: I INDX(I) X(I) X(INDX(I)) 1 18 8.00 0.00 2 22 7.00 0.00 3 8 4.00 1.00 4 13 19.00 1.00 5 11 17.00 1.00 6 10 11.00 2.00 7 21 8.00 2.00 8 3 1.00 4.00 9 9 5.00 5.00 10 2 2.00 7.00 11 20 1.00 7.00 12 23 13.00 7.00 13 1 1.00 8.00 14 15 9.00 8.00 15 24 8.00 8.00 16 7 15.00 8.00 17 14 16.00 9.00 18 6 0.00 11.00 19 12 18.00 13.00 20 16 7.00 15.00 21 17 2.00 16.00 22 5 0.00 17.00 23 19 7.00 18.00 24 4 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 18 8.00 0.00 2 22 7.00 0.00 3 8 4.00 1.00 4 13 19.00 1.00 5 11 17.00 1.00 6 10 11.00 2.00 7 21 8.00 2.00 8 3 1.00 4.00 9 9 5.00 5.00 10 2 2.00 7.00 11 20 1.00 7.00 12 23 13.00 7.00 13 1 1.00 8.00 14 15 9.00 8.00 15 7 8.00 8.00 16 14 15.00 9.00 17 6 16.00 11.00 18 12 0.00 13.00 19 16 18.00 15.00 20 17 7.00 16.00 21 5 2.00 17.00 22 19 0.00 18.00 23 4 7.00 19.00 R8VEC_INDEX_INSERT_TEST R8VEC_INDEX_INSERT inserts values into an index sorted array. 4.00 19.00 17.00 11.00 8.00 1.00 5.00 2.00 1.00 13.00 1.00 9.00 8.00 15.00 16.00 0.00 18.00 7.00 2.00 0.00 Indexed list of entries: I INDX(I) X(I) X(INDX(I)) 1 18 8.00 0.00 2 22 7.00 0.00 3 8 4.00 1.00 4 13 19.00 1.00 5 11 17.00 1.00 6 10 11.00 2.00 7 21 8.00 2.00 8 3 1.00 4.00 9 9 5.00 5.00 10 2 2.00 7.00 11 20 1.00 7.00 12 23 13.00 7.00 13 1 1.00 8.00 14 15 9.00 8.00 15 24 8.00 8.00 16 7 15.00 8.00 17 14 16.00 9.00 18 6 0.00 11.00 19 12 18.00 13.00 20 16 7.00 15.00 21 17 2.00 16.00 22 5 0.00 17.00 23 19 7.00 18.00 24 4 8.00 19.00 R8VEC_INDEX_ORDER_TEST R8VEC_INDEX_ORDER sorts an index sorted array. Generate some random values: 4.00 19.00 17.00 11.00 8.00 1.00 5.00 2.00 1.00 13.00 1.00 9.00 8.00 15.00 16.00 0.00 18.00 7.00 2.00 0.00 Indexed list of unique entries: I INDX(I) X(I) X(INDX(I)) 1 13 4.00 0.00 2 6 19.00 1.00 3 8 17.00 2.00 4 1 11.00 4.00 5 7 8.00 5.00 6 15 1.00 7.00 7 5 5.00 8.00 8 10 2.00 9.00 9 4 13.00 11.00 10 9 9.00 13.00 11 11 15.00 15.00 12 12 16.00 16.00 13 3 0.00 17.00 14 14 18.00 18.00 15 2 7.00 19.00 Now call R8VEC_INDEX_ORDER to carry out the sorting: X: 1: 0.0000000 2: 1.0000000 3: 2.0000000 4: 4.0000000 5: 5.0000000 6: 7.0000000 7: 8.0000000 8: 9.0000000 9: 11.000000 10: 13.000000 11: 15.000000 12: 16.000000 13: 17.000000 14: 18.000000 15: 19.000000 R8VEC_INDEX_INSERT_UNIQUE_TEST R8VEC_INDEX_INSERT_UNIQUE inserts unique values into an index sorted array. Generate some random values: 4.00 19.00 17.00 11.00 8.00 1.00 5.00 2.00 1.00 13.00 1.00 9.00 8.00 15.00 16.00 0.00 18.00 7.00 2.00 0.00 Indexed list of entries: I INDX(I) X(I) X(INDX(I)) 1 13 4.00 0.00 2 6 19.00 1.00 3 8 17.00 2.00 4 1 11.00 4.00 5 7 8.00 5.00 6 15 1.00 7.00 7 5 5.00 8.00 8 10 2.00 9.00 9 4 13.00 11.00 10 9 9.00 13.00 11 11 15.00 15.00 12 12 16.00 16.00 13 3 0.00 17.00 14 14 18.00 18.00 15 2 7.00 19.00 R8VEC_INDEX_SEARCH_TEST R8VEC_INDEX_SEARCH searches for an entry with a given value. Generate some random values: 4.00 19.00 17.00 11.00 8.00 1.00 5.00 2.00 1.00 13.00 1.00 9.00 8.00 15.00 16.00 0.00 18.00 7.00 2.00 0.00 Indexed list of entries: I INDX(I) X(I) X(INDX(I)) 1 13 4.00 0.00 2 6 19.00 1.00 3 8 17.00 2.00 4 1 11.00 4.00 5 7 8.00 5.00 6 15 1.00 7.00 7 5 5.00 8.00 8 10 2.00 9.00 9 4 13.00 11.00 10 9 9.00 13.00 11 11 15.00 15.00 12 12 16.00 16.00 13 3 0.00 17.00 14 14 18.00 18.00 15 2 7.00 19.00 Results of search for given XVAL: XVAL Less Equal More 0.00 0 1 2 1.00 1 2 3 2.00 2 3 4 3.00 3 0 4 4.00 3 4 5 5.00 4 5 6 6.00 5 0 6 7.00 5 6 7 8.00 6 7 8 9.00 7 8 9 10.00 8 0 9 11.00 8 9 10 12.00 9 0 10 13.00 9 10 11 14.00 10 0 11 15.00 10 11 12 16.00 11 12 13 17.00 12 13 14 18.00 13 14 15 19.00 14 15 16 20.00 15 0 16 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.21841830 2: 0.95631758 3: 0.82950923 4: 0.56169544 5: 0.41530708 6: 0.66118735E-01 7: 0.25757779 8: 0.10995679 9: 0.43828998E-01 10: 0.63396571 11: 0.61727229E-01 12: 0.44953896 13: 0.40130628 14: 0.75467349 15: 0.79728695 16: 0.18383712E-02 17: 0.89750406 18: 0.35075234 19: 0.94544750E-01 20: 0.13616892E-01 I INDX R(INDX(I)) 1 16 0.183837E-02 2 20 0.136169E-01 3 9 0.438290E-01 4 11 0.617272E-01 5 6 0.661187E-01 6 19 0.945448E-01 7 8 0.109957 8 1 0.218418 9 7 0.257578 10 18 0.350752 11 13 0.401306 12 5 0.415307 13 12 0.449539 14 4 0.561695 15 10 0.633966 16 14 0.754673 17 15 0.797287 18 3 0.829509 19 17 0.897504 20 2 0.956318 R_LO 0.840847 R_HI 0.859097 Empty range in R. Array 1: 0.12310392 2: 0.75123641E-02 3: 0.26030300 4: 0.91248371 5: 0.11366405 6: 0.35162866 7: 0.82288732 8: 0.26713227 9: 0.69206650 10: 0.56166247 11: 0.86121579 12: 0.45379378 13: 0.91197703 14: 0.59791688 15: 0.18895469 16: 0.76149206 17: 0.39698848 18: 0.18531412 19: 0.57436586 20: 0.36702667 I INDX R(INDX(I)) 1 2 0.751236E-02 2 5 0.113664 3 1 0.123104 4 18 0.185314 5 15 0.188955 6 3 0.260303 7 8 0.267132 8 6 0.351629 9 20 0.367027 10 17 0.396988 11 12 0.453794 12 10 0.561662 13 19 0.574366 14 14 0.597917 15 9 0.692066 16 16 0.761492 17 7 0.822887 18 11 0.861216 19 13 0.911977 20 4 0.912484 R_LO 0.361529 9 20 0.367027 10 17 0.396988 11 12 0.453794 12 10 0.561662 13 19 0.574366 14 14 0.597917 R_HI 0.617205 Array 1: 0.21293000 2: 0.71447121 3: 0.11770687 4: 0.29932915 5: 0.82500295 6: 0.82466007 7: 0.61861771E-01 8: 0.71078052 9: 0.88283334E-01 10: 0.77799401 11: 0.74530307 12: 0.30867492 13: 0.89937309 14: 0.76353672 15: 0.76173065 16: 0.40696964 17: 0.93874945 18: 0.56208829 19: 0.17820022E-01 20: 0.50110323 I INDX R(INDX(I)) 1 19 0.178200E-01 2 7 0.618618E-01 3 9 0.882833E-01 4 3 0.117707 5 1 0.212930 6 4 0.299329 7 12 0.308675 8 16 0.406970 9 20 0.501103 10 18 0.562088 11 8 0.710781 12 2 0.714471 13 11 0.745303 14 15 0.761731 15 14 0.763537 16 10 0.777994 17 6 0.824660 18 5 0.825003 19 13 0.899373 20 17 0.938749 R_LO 0.419093E-01 2 7 0.618618E-01 3 9 0.882833E-01 4 3 0.117707 5 1 0.212930 6 4 0.299329 7 12 0.308675 R_HI 0.368851 Array 1: 0.27172360 2: 0.85857256 3: 0.29036559E-01 4: 0.17442279E-01 5: 0.15238379 6: 0.11431867 7: 0.35390726 8: 0.11930783 9: 0.20665276 10: 0.21292396 11: 0.61294755 12: 0.80951907 13: 0.58708963 14: 0.21549164 15: 0.76805636 16: 0.72329672 17: 0.44801899 18: 0.85517612 19: 0.94501750 20: 0.90905692 I INDX R(INDX(I)) 1 4 0.174423E-01 2 3 0.290366E-01 3 6 0.114319 4 8 0.119308 5 5 0.152384 6 9 0.206653 7 10 0.212924 8 14 0.215492 9 1 0.271724 10 7 0.353907 11 17 0.448019 12 13 0.587090 13 11 0.612948 14 16 0.723297 15 15 0.768056 16 12 0.809519 17 18 0.855176 18 2 0.858573 19 20 0.909057 20 19 0.945017 R_LO 0.301946E-01 3 6 0.114319 4 8 0.119308 5 5 0.152384 6 9 0.206653 7 10 0.212924 8 14 0.215492 9 1 0.271724 10 7 0.353907 11 17 0.448019 R_HI 0.519726 Array 1: 0.48106695 2: 0.29231288 3: 0.90263984 4: 0.66784151 5: 0.41227804 6: 0.15694849 7: 0.83328163 8: 0.96440416 9: 0.74078991 10: 0.45609886 11: 0.65356142 12: 0.40682695 13: 0.54053860 14: 0.83228094 15: 0.14575576 16: 0.71712832 17: 0.77565076 18: 0.36226162 19: 0.53111085 20: 0.37997675 I INDX R(INDX(I)) 1 15 0.145756 2 6 0.156948 3 2 0.292313 4 18 0.362262 5 20 0.379977 6 12 0.406827 7 5 0.412278 8 10 0.456099 9 1 0.481067 10 19 0.531111 11 13 0.540539 12 11 0.653561 13 4 0.667842 14 16 0.717128 15 9 0.740790 16 17 0.775651 17 14 0.832281 18 7 0.833282 19 3 0.902640 20 8 0.964404 R_LO 0.269285 3 2 0.292313 4 18 0.362262 5 20 0.379977 6 12 0.406827 7 5 0.412278 8 10 0.456099 9 1 0.481067 10 19 0.531111 11 13 0.540539 12 11 0.653561 13 4 0.667842 14 16 0.717128 15 9 0.740790 16 17 0.775651 17 14 0.832281 18 7 0.833282 R_HI 0.877418 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_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_MAX_TEST For a R8VEC: R8VEC_MAX: maximum entry; Input vector: 1: -5.6316341 2: 9.1263515 3: 6.5901847 4: 1.2339089 5: -1.6938584 6: -8.6776253 7: -4.8484442 8: -7.8008641 9: -9.1234200 10: 2.6793142 Maximum: 9.12635 R8VEC_MAX_INDEX_TEST For a R8VEC: R8VEC_MAX_INDEX: index of maximum entry; Input vector: 1: -5.6316341 2: 9.1263515 3: 6.5901847 4: 1.2339089 5: -1.6938584 6: -8.6776253 7: -4.8484442 8: -7.8008641 9: -9.1234200 10: 2.6793142 Maximum index: 2 R8VEC_MEAN_TEST For a R8VEC: R8VEC_MEAN: mean value; Input vector: 1: -5.6316341 2: 9.1263515 3: 6.5901847 4: 1.2339089 5: -1.6938584 6: -8.6776253 7: -4.8484442 8: -7.8008641 9: -9.1234200 10: 2.6793142 Mean: -1.81461 R8VEC_MEDIAN_TEST R8VEC_MEDIAN: median value of R8VEC; Input vector: 1: -5.6316341 2: 9.1263515 3: 6.5901847 4: 1.2339089 5: -1.6938584 6: -8.6776253 7: -4.8484442 8: -7.8008641 9: -9.1234200 10: 2.6793142 Median: -4.84844 R8VEC_MIDSPACE_TEST For a R8VEC: 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.6316341 2: 9.1263515 3: 6.5901847 4: 1.2339089 5: -1.6938584 6: -8.6776253 7: -4.8484442 8: -7.8008641 9: -9.1234200 10: 2.6793142 Minimum: -9.12342 R8VEC_MIN_INDEX_TEST For a R8VEC: R8VEC_MIN_INDEX: index of minimum entry; Input vector: 1: -5.6316341 2: 9.1263515 3: 6.5901847 4: 1.2339089 5: -1.6938584 6: -8.6776253 7: -4.8484442 8: -7.8008641 9: -9.1234200 10: 2.6793142 Minimum index: 9 R8VEC_NINT_TEST R8VEC_NINT rounds an R8VEC. Vector A: 1: -2.8158170 2: 4.5631758 3: 3.2950923 4: 0.61695443 5: -0.84692919 Rounded vector A: 1: -3.0000000 2: 5.0000000 3: 3.0000000 4: 1.0000000 5: -1.0000000 R8VEC_NORM_L0_TEST R8VEC_NORM_L0 computes the L0 norm of an R8VEC. Input vector: 1: -1.0000000 2: 2.0000000 3: 1.0000000 4: 0.0000000 5: 0.0000000 6: -2.0000000 7: -1.0000000 8: -2.0000000 9: -2.0000000 10: 1.0000000 L0 norm: 8.00000 R8VEC_NORM_L1_TEST R8VEC_NORM_L1 computes the L1 norm of an R8VEC Input vector: 1: -5.6316341 2: 9.1263515 3: 6.5901847 4: 1.2339089 5: -1.6938584 6: -8.6776253 7: -4.8484442 8: -7.8008641 9: -9.1234200 10: 2.6793142 L1 norm: 57.4056 R8VEC_NORM_L2_TEST R8VEC_NORM_L2 computes the L2 norm of an R8VEC Input vector: 1: -5.6316341 2: 9.1263515 3: 6.5901847 4: 1.2339089 5: -1.6938584 6: -8.6776253 7: -4.8484442 8: -7.8008641 9: -9.1234200 10: 2.6793142 L2 norm: 20.3201 R8VEC_NORM_LI_TEST R8VEC_NORM_LI computes the Loo norm of an R8VEC Input vector: 1: -5.6316341 2: 9.1263515 3: 6.5901847 4: 1.2339089 5: -1.6938584 6: -8.6776253 7: -4.8484442 8: -7.8008641 9: -9.1234200 10: 2.6793142 L-Infinity norm: 9.12635 R8VEC_NORMAL_01_TEST R8VEC_NORMAL_01 computes a vector of normally distributed random numbers. Using initial random number seed = 123456789 Test #1: Call 5 times, 1 value each time. 1 1.67904 2 -0.566060 3 1.21293 4 1.26938 5 -1.66609 Test #2: Restore the random number seed. Call 5 times, 1 value each time. The results should be identical. 1 1.67904 2 -0.566060 3 1.21293 4 1.26938 5 -1.66609 Test #3: Restore the random number seed. Call 1 time for 5 values. The results should be identical. 1 1.67904 2 -0.472769 3 -0.566060 4 -0.231124 5 1.21293 Test #4: Restore the random number seed. Call for 2, 1, and 2 values. The results should be identical. 1 1.67904 2 -0.472769 1 -0.566060 1 1.21293 2 0.535037 Test #5: Number of samples was 1000 Minimum value was -3.02975 Maximum value was 3.32858 Average value was -0.169841E-01 Variance was 1.00100 Expected average 0.00000 Expected variance 1.00000 R8VEC_NORMALIZE_L1_TEST For a R8VEC: R8VEC_NORMALIZE_L1: make unit sum; Input vector: 1: -5.6316341 2: 9.1263515 3: 6.5901847 4: 1.2339089 5: -1.6938584 6: -8.6776253 7: -4.8484442 8: -7.8008641 9: -9.1234200 10: 2.6793142 After calling R8VEC_NORMALIZE_L1: 1: 0.31034978 2: -0.50293772 3: -0.36317388 4: -0.67998620E-01 5: 0.93345656E-01 6: 0.47820918 7: 0.26718952 8: 0.42989236 9: 0.50277617 10: -0.14765245 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_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 vector: 1: 123.45600 2: 0.50000000E-05 3: -1000000.0 4: 3.1415927 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 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_SEARCH_BINARY_A_TEST For ascending order: R8VEC_SEARCH_BINARY_A searches a sorted array; Using initial random number seed = 123456789 Sorted vector A: 1: 0.43828998E-01 2: 0.66118735E-01 3: 0.10995679 4: 0.21841830 5: 0.25757779 6: 0.41530708 7: 0.56169544 8: 0.63396571 9: 0.82950923 10: 0.95631758 Search the array for the value 0.218418 SEARCH RESULT: The value occurs in index 4 R8VEC_SORT_BUBBLE_A_TEST R8VEC_SORT_BUBBLE_A ascending sorts a R8VEC. Original array: 1: 13.105098 2: 57.379055 3: 49.770554 4: 33.701727 5: 24.918425 6: 3.9671241 7: 15.454668 8: 6.5974076 9: 2.6297399 10: 38.037943 Ascending sorted array: 1: 0.11030227 2: 0.81701350 3: 2.6297399 4: 3.7036337 5: 3.9671241 6: 5.6726850 7: 6.5974076 8: 13.105098 9: 15.454668 10: 21.045140 R8VEC_SORT_HEAP_A_TEST R8VEC_SORT_HEAP_A ascending sorts a R8VEC. Original array: 1: 13.105098 2: 57.379055 3: 49.770554 4: 33.701727 5: 24.918425 6: 3.9671241 7: 15.454668 8: 6.5974076 9: 2.6297399 10: 38.037943 Ascending sorted array: 1: 0.11030227 2: 0.81701350 3: 2.6297399 4: 3.7036337 5: 3.9671241 6: 5.6726850 7: 6.5974076 8: 13.105098 9: 15.454668 10: 21.045140 R8VEC_SORT_HEAP_D_TEST R8VEC_SORT_HEAP_D descending sorts a R8VEC. Original array: 1: 13.105098 2: 57.379055 3: 49.770554 4: 33.701727 5: 24.918425 6: 3.9671241 7: 15.454668 8: 6.5974076 9: 2.6297399 10: 38.037943 Descending sorted array: 1: 57.379055 2: 53.850244 3: 49.770554 4: 47.837217 5: 45.280409 6: 38.037943 7: 33.701727 8: 26.972338 9: 24.918425 10: 24.078377 R8VEC_SORT_HEAP_INDEX_A_TEST R8VEC_SORT_HEAP_INDEX_A creates an ascending sort index for a R8VEC. Unsorted array: 1: 13.105098 2: 57.379055 3: 49.770554 4: 33.701727 5: 24.918425 6: 3.9671241 7: 15.454668 8: 6.5974076 9: 2.6297399 10: 38.037943 After indexed ascending sort: I, INDX(I), A(I) 1 16 13.1051 2 20 57.3791 3 9 49.7706 4 11 33.7017 5 6 24.9184 6 19 3.96712 7 8 15.4547 8 1 6.59741 9 7 2.62974 10 18 38.0379 11 13 3.70363 12 5 26.9723 13 12 24.0784 14 4 45.2804 15 10 47.8372 16 14 0.110302 17 15 53.8502 18 3 21.0451 19 17 5.67269 20 2 0.817013 Now use the index array to carry out the permutation implicitly. INDX(I), A(INDX(I)) 16 0.110302 20 0.817013 9 2.62974 11 3.70363 6 3.96712 19 5.67269 8 6.59741 1 13.1051 7 15.4547 18 21.0451 13 24.0784 5 24.9184 12 26.9723 4 33.7017 10 38.0379 14 45.2804 15 47.8372 3 49.7706 17 53.8502 2 57.3791 Call R8VEC_PERMUTE to carry out the permutation explicitly. I, A(I) 1: 0.11030227 2: 0.81701350 3: 2.6297399 4: 3.7036337 5: 3.9671241 6: 5.6726850 7: 6.5974076 8: 13.105098 9: 15.454668 10: 21.045140 11: 24.078377 12: 24.918425 13: 26.972338 14: 33.701727 15: 38.037943 16: 45.280409 17: 47.837217 18: 49.770554 19: 53.850244 20: 57.379055 R8VEC_SORT_HEAP_INDEX_D_TEST R8VEC_SORT_HEAP_INDEX_D creates a descending sort index for a R8VEC. Unsorted array: 1: 13.105098 2: 57.379055 3: 49.770554 4: 33.701727 5: 24.918425 6: 3.9671241 7: 15.454668 8: 6.5974076 9: 2.6297399 10: 38.037943 After indexed descending sort: I, INDX(I), A(I) 1 2 13.1051 2 17 57.3791 3 3 49.7706 4 15 33.7017 5 14 24.9184 6 10 3.96712 7 4 15.4547 8 12 6.59741 9 5 2.62974 10 13 38.0379 11 18 3.70363 12 7 26.9723 13 1 24.0784 14 8 45.2804 15 19 47.8372 16 6 0.110302 17 11 53.8502 18 9 21.0451 19 20 5.67269 20 16 0.817013 Now use the index array to carry out the permutation implicitly. INDX(I), ARRAY(INDX(I)) 2 57.3791 17 53.8502 3 49.7706 15 47.8372 14 45.2804 10 38.0379 4 33.7017 12 26.9723 5 24.9184 13 24.0784 18 21.0451 7 15.4547 1 13.1051 8 6.59741 19 5.67269 6 3.96712 11 3.70363 9 2.62974 20 0.817013 16 0.110302 R8VEC_SORT_HEAP_MASK_A_TEST R8VEC_SORT_HEAP_MASK_A creates an ascending sort index for a masked R8VEC. Unsorted array: 1: 13.105098 2: 57.379055 3: 49.770554 4: 33.701727 5: 24.918425 6: 3.9671241 7: 15.454668 8: 6.5974076 9: 2.6297399 10: 38.037943 11: 3.7036337 12: 26.972338 13: 24.078377 14: 45.280409 15: 47.837217 16: 0.11030227 17: 53.850244 18: 21.045140 19: 5.6726850 20: 0.81701350 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 57.3791 2: 4 33.7017 3: 7 15.4547 4: 8 6.59741 5: 9 2.62974 6: 12 26.9723 7: 13 24.0784 8: 16 0.110302 9: 18 21.0451 10: 19 5.67269 After masked indexed ascending sort: I, INDX(I), MASK(INDX(I)), A(MASK(INDX(I))) 1 8 16 0.110302 2 5 9 2.62974 3 10 19 5.67269 4 4 8 6.59741 5 3 7 15.4547 6 9 18 21.0451 7 7 13 24.0784 8 6 12 26.9723 9 2 4 33.7017 10 1 2 57.3791 Call I4VEC_PERMUTE to carry out the index permutation explicitly on the MASK vector. The reordered mask array: 1: 16 2: 9 3: 19 4: 8 5: 7 6: 18 7: 13 8: 12 9: 4 10: 2 Masked vector printout: The reordered masked sorted array: 1: 16 0.110302 2: 9 2.62974 3: 19 5.67269 4: 8 6.59741 5: 7 15.4547 6: 18 21.0451 7: 13 24.0784 8: 12 26.9723 9: 4 33.7017 10: 2 57.3791 R8VEC_SORT_INSERT_A_TEST R8VEC_SORT_INSERT_A ascending sorts a R8VEC. Unsorted array: 1: 13.105098 2: 57.379055 3: 49.770554 4: 33.701727 5: 24.918425 6: 3.9671241 7: 15.454668 8: 6.5974076 9: 2.6297399 10: 38.037943 Sorted array: 1: 0.11030227 2: 0.81701350 3: 2.6297399 4: 3.7036337 5: 3.9671241 6: 5.6726850 7: 6.5974076 8: 13.105098 9: 15.454668 10: 21.045140 R8VEC_SORT_INSERT_INDEX_A_TEST R8VEC_SORT_INSERT_INDEX_A creates an ascending sort index for a R8VEC. Unsorted array: 1: 13.105098 2: 57.379055 3: 49.770554 4: 33.701727 5: 24.918425 6: 3.9671241 7: 15.454668 8: 6.5974076 9: 2.6297399 10: 38.037943 After indexed ascending sort: I, INDX(I), A(I) 1 16 13.1051 2 20 57.3791 3 9 49.7706 4 11 33.7017 5 6 24.9184 6 19 3.96712 7 8 15.4547 8 1 6.59741 9 7 2.62974 10 18 38.0379 11 13 3.70363 12 5 26.9723 13 12 24.0784 14 4 45.2804 15 10 47.8372 16 14 0.110302 17 15 53.8502 18 3 21.0451 19 17 5.67269 20 2 0.817013 Now use the index array to carry out the permutation implicitly. I, INDX(I), A(INDX(I)) 1 16 0.110302 2 20 0.817013 3 9 2.62974 4 11 3.70363 5 6 3.96712 6 19 5.67269 7 8 6.59741 8 1 13.1051 9 7 15.4547 10 18 21.0451 11 13 24.0784 12 5 24.9184 13 12 26.9723 14 4 33.7017 15 10 38.0379 16 14 45.2804 17 15 47.8372 18 3 49.7706 19 17 53.8502 20 2 57.3791 Call R8VEC_PERMUTE to carry out the permutation explicitly. Permuted data 1: 0.11030227 2: 0.81701350 3: 2.6297399 4: 3.7036337 5: 3.9671241 6: 5.6726850 7: 6.5974076 8: 13.105098 9: 15.454668 10: 21.045140 R8VEC_SORT_QUICK_A_TEST R8VEC_SORT_QUICK_A sorts a R8VEC using quick sort. Unsorted array: 1: 2.1841830 2: 9.5631758 3: 8.2950923 4: 5.6169544 5: 4.1530708 6: 0.66118735 7: 2.5757779 8: 1.0995679 9: 0.43828998 10: 6.3396571 11: 0.61727229 12: 4.4953896 13: 4.0130628 14: 7.5467349 15: 7.9728695 16: 0.18383712E-01 17: 8.9750406 18: 3.5075234 19: 0.94544750 20: 0.13616892 Sorted array: 1: 0.18383712E-01 2: 0.13616892 3: 0.43828998 4: 0.61727229 5: 0.66118735 6: 0.94544750 7: 1.0995679 8: 2.1841830 9: 2.5757779 10: 3.5075234 11: 4.0130628 12: 4.1530708 13: 4.4953896 14: 5.6169544 15: 6.3396571 16: 7.5467349 17: 7.9728695 18: 8.2950923 19: 8.9750406 20: 9.5631758 R8VEC_SORTED_MERGE_A_TEST For ascending order: R8VEC_SORTED_MERGE_A merges two sorted R8VEC's; Using initial random number seed = 123456789 Sorted vector A: 1: 0.43828998E-01 2: 0.66118735E-01 3: 0.10995679 4: 0.21841830 5: 0.25757779 6: 0.41530708 7: 0.56169544 8: 0.63396571 9: 0.82950923 10: 0.95631758 Sorted vector B: 1: 0.18383712E-02 2: 0.13616892E-01 3: 0.61727229E-01 4: 0.94544750E-01 5: 0.35075234 6: 0.40130628 7: 0.44953896 8: 0.75467349 9: 0.79728695 10: 0.89750406 Merged vector C: 1: 0.18383712E-02 2: 0.13616892E-01 3: 0.43828998E-01 4: 0.61727229E-01 5: 0.66118735E-01 6: 0.94544750E-01 7: 0.10995679 8: 0.21841830 9: 0.25757779 10: 0.35075234 11: 0.40130628 12: 0.41530708 13: 0.44953896 14: 0.56169544 15: 0.63396571 16: 0.75467349 17: 0.79728695 18: 0.82950923 19: 0.89750406 20: 0.95631758 R8VEC_SORTED_NEAREST_TEST R8VEC_SORTED_NEAREST finds the nearest entry in a sorted R8VEC. Sorted array: 1: 0.43828998 2: 0.66118735 3: 1.0995679 4: 2.1841830 5: 2.5757779 6: 4.1530708 7: 5.6169544 8: 6.3396571 9: 8.2950923 10: 9.5631758 Test Nearest Value Index Value 0.6173 2 0.6612 4.4954 6 4.1531 4.0131 6 4.1531 7.5467 9 8.2951 7.9729 9 8.2951 0.0184 1 0.4383 8.9750 10 9.5632 3.5075 6 4.1531 0.9454 3 1.0996 0.1362 1 0.4383 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.43828998E-01 2: 0.66118735E-01 3: 0.10995679 4: 0.21841830 5: 0.25757779 6: 0.41530708 7: 0.56169544 8: 0.63396571 9: 0.82950923 10: 0.95631758 R_LO 0.617272E-01 2 0.661187E-01 3 0.109957 4 0.218418 5 0.257578 6 0.415307 R_HI 0.449539 Sorted array R: 1: 0.18383712E-02 2: 0.13616892E-01 3: 0.94544750E-01 4: 0.35075234 5: 0.40130628 6: 0.75467349 7: 0.79728695 8: 0.84084745 9: 0.85909686 10: 0.89750406 R_LO 0.751236E-02 2 0.136169E-01 3 0.945448E-01 R_HI 0.123104 Sorted array R: 1: 0.11366405 2: 0.26030300 3: 0.26713227 4: 0.35162866 5: 0.45379378 6: 0.56166247 7: 0.69206650 8: 0.82288732 9: 0.86121579 10: 0.91248371 R_LO 0.597917 7 0.692066 8 0.822887 9 0.861216 R_HI 0.911977 Sorted array R: 1: 0.18531412 2: 0.18895469 3: 0.21293000 4: 0.36152870 5: 0.36702667 6: 0.39698848 7: 0.57436586 8: 0.61720483 9: 0.71447121 10: 0.76149206 R_LO 0.117707 1 0.185314 2 0.188955 3 0.212930 R_HI 0.299329 Sorted array R: 1: 0.61861771E-01 2: 0.88283334E-01 3: 0.30867492 4: 0.71078052 5: 0.74530307 6: 0.76353672 7: 0.77799401 8: 0.82466007 9: 0.82500295 10: 0.89937309 R_LO 0.406970 4 0.710781 5 0.745303 R_HI 0.761731 R8VEC_SORTED_SPLIT_TEST R8VEC_SORTED_SPLIT splits a sorted vector into entries less than and greater than a splitting value. The sorted array: 1: 0.0000000 2: 0.0000000 3: 0.0000000 4: 0.0000000 5: 0.50000000 6: 0.50000000 7: 0.50000000 8: 0.50000000 9: 0.50000000 10: 1.0000000 11: 1.5000000 12: 1.5000000 13: 2.0000000 14: 2.0000000 15: 2.0000000 16: 2.0000000 17: 3.0000000 18: 3.0000000 19: 4.0000000 20: 4.0000000 21: 4.0000000 22: 4.0000000 23: 4.5000000 24: 4.5000000 25: 5.0000000 Splitting value is 2.50000 Lower index I_LT = 16 Upper index I_GT = 17 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: 6.0000000 2: 28.000000 3: 24.000000 4: 16.000000 5: 12.000000 6: 1.0000000 7: 7.0000000 8: 3.0000000 9: 1.0000000 10: 19.000000 Unique entries 1: 0.0000000 2: 1.0000000 3: 2.0000000 4: 3.0000000 5: 6.0000000 6: 7.0000000 7: 8.0000000 8: 10.000000 9: 12.000000 10: 13.000000 11: 16.000000 12: 19.000000 13: 22.000000 14: 23.000000 15: 24.000000 16: 25.000000 17: 26.000000 18: 27.000000 19: 28.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 R8VEC_SORTED_UNIQUE_HIST makes a historgram of the unique entries in a real vector. Using random number seed 123456789 Unsorted array: 1: 6.5000000 2: 28.500000 3: 24.500000 4: 16.500000 5: 12.500000 6: 1.5000000 7: 7.5000000 8: 3.5000000 9: 1.5000000 10: 19.500000 11: 1.5000000 12: 13.500000 13: 12.500000 14: 22.500000 15: 23.500000 16: 0.50000000 17: 26.500000 18: 10.500000 19: 2.5000000 20: 0.50000000 21: 25.500000 22: 25.500000 23: 3.5000000 24: 0.50000000 25: 7.5000000 26: 27.500000 27: 3.5000000 28: 10.500000 29: 24.500000 30: 8.5000000 Ascending sorted array: 1: 0.50000000 2: 0.50000000 3: 0.50000000 4: 1.5000000 5: 1.5000000 6: 1.5000000 7: 2.5000000 8: 3.5000000 9: 3.5000000 10: 3.5000000 11: 6.5000000 12: 7.5000000 13: 7.5000000 14: 8.5000000 15: 10.500000 16: 10.500000 17: 12.500000 18: 12.500000 19: 13.500000 20: 16.500000 21: 19.500000 22: 22.500000 23: 23.500000 24: 24.500000 25: 24.500000 26: 25.500000 27: 25.500000 28: 26.500000 29: 27.500000 30: 28.500000 R8VEC_SORTED_UNIQUE_HIST counts 19 unique entries. Value Multiplicity 1 0.500000 3 2 1.50000 3 3 2.50000 1 4 3.50000 3 5 6.50000 1 6 7.50000 2 7 8.50000 1 8 10.5000 2 9 12.5000 2 10 13.5000 1 11 16.5000 1 12 19.5000 1 13 22.5000 1 14 23.5000 1 15 24.5000 2 16 25.5000 2 17 26.5000 1 18 27.5000 1 19 28.5000 1 R8VEC_SPLIT_TEST R8VEC_SPLIT splits a sorted vector into entries less than and greater than a splitting value. The array: 1: 1.0000000 2: 5.0000000 3: 4.0000000 4: 3.0000000 5: 2.0000000 6: 0.50000000 7: 1.5000000 8: 0.50000000 9: 0.0000000 10: 3.0000000 11: 0.50000000 12: 2.0000000 13: 2.0000000 14: 4.0000000 15: 4.0000000 16: 0.0000000 17: 4.5000000 18: 2.0000000 19: 0.50000000 20: 0.0000000 21: 4.5000000 22: 4.0000000 23: 0.50000000 24: 0.0000000 25: 1.5000000 Splitting value is 1.25000 The split array: 1: 1.0000000 2: 0.0000000 3: 0.50000000 4: 0.0000000 5: 0.50000000 6: 0.50000000 7: 0.0000000 8: 0.50000000 9: 0.0000000 10: 0.50000000 11: 2.0000000 12: 2.0000000 13: 4.0000000 14: 4.0000000 15: 3.0000000 16: 4.5000000 17: 2.0000000 18: 1.5000000 19: 2.0000000 20: 4.5000000 21: 4.0000000 22: 3.0000000 23: 4.0000000 24: 1.5000000 25: 5.0000000 Array entries <= SPLIT up to index 10 R8VEC_TRANSPOSE_PRINT_TEST R8VEC_TRANSPOSE_PRINT prints an R8VEC "tranposed", that is, placing multiple entries on a line. The vector X: 0.218418 0.956318 0.829509 0.561695 0.415307 0.661187E-01 0.257578 0.109957 0.438290E-01 0.633966 0.617272E-01 0.449539 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]. Input SEED = 123456789 Random vector: 1: 0.21841830 2: 0.95631758 3: 0.82950923 4: 0.56169544 5: 0.41530708 6: 0.66118735E-01 7: 0.25757779 8: 0.10995679 9: 0.43828998E-01 10: 0.63396571 Input SEED = 29242052 Random vector: 1: 0.85909686 2: 0.84084745 3: 0.12310392 4: 0.75123641E-02 5: 0.26030300 6: 0.91248371 7: 0.11366405 8: 0.35162866 9: 0.82288732 10: 0.26713227 Input SEED = 397959036 Random vector: 1: 0.57436586 2: 0.36702667 3: 0.61720483 4: 0.36152870 5: 0.21293000 6: 0.71447121 7: 0.11770687 8: 0.29932915 9: 0.82500295 10: 0.82466007 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 Input SEED = 123456789 Random vector: 1: 12.184183 2: 19.563176 3: 18.295092 4: 15.616954 5: 14.153071 6: 10.661187 7: 12.575778 8: 11.099568 9: 10.438290 10: 16.339657 Input SEED = 1361431000 Random vector: 1: 10.617272 2: 14.495390 3: 14.013063 4: 17.546735 5: 17.972870 6: 10.018384 7: 18.975041 8: 13.507523 9: 10.945448 10: 10.136169 Input SEED = 29242052 Random vector: 1: 18.590969 2: 18.408475 3: 11.231039 4: 10.075124 5: 12.603030 6: 19.124837 7: 11.136640 8: 13.516287 9: 18.228873 10: 12.671323 R8VEC_VARIANCE_TEST R8VEC_VARIANCE computes the variance of an R8VEC. Vector: 1: -2.8158170 2: 4.5631758 3: 3.2950923 4: 0.61695443 5: -0.84692919 6: -4.3388127 7: -2.4242221 8: -3.9004321 9: -4.5617100 10: 1.3396571 Variance: 10.5549 R8VEC2_SORT_A_TEST For a pair of R8VEC's: R8VEC2_SORT_A ascending sorts; The pair of arrays: 1: 1.43684 5.30864 2: 2.91264 7.24769 3: 1.43684 5.30864 4: 2.12339 8.77337 5: 1.83061 8.98643 6: 2.91264 7.24769 7: 1.51516 9.48752 8: 1.21991 6.75376 9: 1.43684 5.30864 10: 2.26793 5.06808 Arrays after ascending sort: 1: 1.21991 6.75376 2: 1.43684 5.30864 3: 1.43684 5.30864 4: 1.43684 5.30864 5: 1.51516 9.48752 6: 1.83061 8.98643 7: 2.12339 8.77337 8: 2.26793 5.06808 9: 2.91264 7.24769 10: 2.91264 7.24769 R8VEC2_SORT_D_TEST For a pair of R8VEC's: R8VEC2_SORT_D descending sorts; The pair of arrays: 1: 1.43684 5.30864 2: 2.91264 7.24769 3: 1.43684 5.30864 4: 2.12339 8.77337 5: 1.83061 8.98643 6: 2.91264 7.24769 7: 1.51516 9.48752 8: 1.21991 6.75376 9: 1.43684 5.30864 10: 2.26793 5.06808 Arrays after descending sort: 1: 2.91264 7.24769 2: 2.91264 7.24769 3: 2.26793 5.06808 4: 2.12339 8.77337 5: 1.83061 8.98643 6: 1.51516 9.48752 7: 1.43684 5.30864 8: 1.43684 5.30864 9: 1.43684 5.30864 10: 1.21991 6.75376 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.200000 1.00000 2 0.850000 0.550000 3 0.400000 0.500000E-01 4 0.250000 0.100000 5 0.00000 0.650000 6 0.500000E-01 0.450000 7 0.400000 0.750000 8 0.800000 0.00000 9 0.900000 0.350000 10 0.500000E-01 0.00000 11 0.900000 0.850000 12 0.100000 0.00000 13 0.250000 0.950000 14 0.100000 0.350000 15 0.850000 0.250000 16 0.700000 0.550000 17 0.900000 0.450000 18 0.950000 0.600000 19 0.150000 0.750000 20 0.400000 0.150000 After sorting: I, INDX(I), X(I), Y(I) 1 5 0.200000 1.00000 2 10 0.850000 0.550000 3 6 0.400000 0.500000E-01 4 12 0.250000 0.100000 5 14 0.00000 0.650000 6 19 0.500000E-01 0.450000 7 1 0.400000 0.750000 8 4 0.800000 0.00000 9 13 0.900000 0.350000 10 3 0.500000E-01 0.00000 11 20 0.900000 0.850000 12 7 0.100000 0.00000 13 16 0.250000 0.950000 14 8 0.100000 0.350000 15 15 0.850000 0.250000 16 2 0.700000 0.550000 17 9 0.900000 0.450000 18 17 0.950000 0.600000 19 11 0.150000 0.750000 20 18 0.400000 0.150000 Now use the index array to carry out the permutation implicitly. I, INDX(I), X(INDX(I)), Y(INDX(I)) 1 5 0.00000 0.650000 2 10 0.500000E-01 0.00000 3 6 0.500000E-01 0.450000 4 12 0.100000 0.00000 5 14 0.100000 0.350000 6 19 0.150000 0.750000 7 1 0.200000 1.00000 8 4 0.250000 0.100000 9 13 0.250000 0.950000 10 3 0.400000 0.500000E-01 11 20 0.400000 0.150000 12 7 0.400000 0.750000 13 16 0.700000 0.550000 14 8 0.800000 0.00000 15 15 0.850000 0.250000 16 2 0.850000 0.550000 17 9 0.900000 0.350000 18 17 0.900000 0.450000 19 11 0.900000 0.850000 20 18 0.950000 0.600000 R8VEC_PERMUTE carries out the permutation. I, X(I), Y(I) 1 0.00000 0.650000 2 0.500000E-01 0.00000 3 0.500000E-01 0.450000 4 0.100000 0.00000 5 0.100000 0.350000 6 0.150000 0.750000 7 0.200000 1.00000 8 0.250000 0.100000 9 0.250000 0.950000 10 0.400000 0.500000E-01 11 0.400000 0.150000 12 0.400000 0.750000 13 0.700000 0.550000 14 0.800000 0.00000 15 0.850000 0.250000 16 0.850000 0.550000 17 0.900000 0.350000 18 0.900000 0.450000 19 0.900000 0.850000 20 0.950000 0.600000 R8VEC2_SORTED_UNIQUE_TEST For a pair of R8VEC's: R8VEC2_SORTED_UNIQUE counts unique entries. The pair of arrays: 1: 1.43684 5.30864 2: 2.91264 7.24769 3: 1.43684 5.30864 4: 2.12339 8.77337 5: 1.83061 8.98643 6: 2.91264 7.24769 7: 1.51516 9.48752 8: 1.21991 6.75376 9: 1.43684 5.30864 10: 2.26793 5.06808 Arrays after ascending sort: 1: 1.21991 6.75376 2: 1.43684 5.30864 3: 1.43684 5.30864 4: 1.43684 5.30864 5: 1.51516 9.48752 6: 1.83061 8.98643 7: 2.12339 8.77337 8: 2.26793 5.06808 9: 2.91264 7.24769 10: 2.91264 7.24769 UNIQed array: 1: 1.21991 6.75376 2: 1.43684 5.30864 3: 1.51516 9.48752 4: 1.83061 8.98643 5: 2.12339 8.77337 6: 2.26793 5.06808 7: 2.91264 7.24769 R8VEC2_SORTED_UNIQUE_INDEX_TEST For a pair of R8VEC's: R8VEC2_SORTED_UNIQUE_INDEX indexes unique entries. Sorted arrays: 1: 1.21991 6.75376 2: 1.43684 5.30864 3: 1.43684 5.30864 4: 1.43684 5.30864 5: 1.51516 9.48752 6: 1.83061 8.98643 7: 2.12339 8.77337 8: 2.26793 5.06808 9: 2.91264 7.24769 10: 2.91264 7.24769 The number of unique elements is 7 Index of Unique Elements: 1: 1 2: 2 3: 5 4: 6 5: 7 6: 8 7: 9 After Indexed Nonunique Deletion. 1: 1.21991 6.75376 2: 1.43684 5.30864 3: 1.51516 9.48752 4: 1.83061 8.98643 5: 2.12339 8.77337 6: 2.26793 5.06808 7: 2.91264 7.24769 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: 2.18418 0.308636 2: 9.56318 2.24769 3: 8.29509 2.00653 4: 5.61695 3.77337 5: 4.15307 3.98643 6: 0.661187 0.919186E-02 7: 2.57578 4.48752 8: 1.09957 1.75376 9: 0.438290 0.472724 10: 6.33966 0.680845E-01 Index of maximum in A+B: 2 ROOTS_TO_R8POLY: Given N real roots, construct the coefficient vector of the corresponding polynomial. N real roots: 1: 1.0000000 2: -4.0000000 3: 3.0000000 4: 0.0000000 5: 3.0000000 Corresponding polynomial: p(x) = 1.00000 * x ^ 5 - 3.00000 * x ^ 4 - 13.0000 * x ^ 3 + 51.0000 * x ^ 2 - 36.0000 * x R8LIB_PRB Normal end of execution. 25 March 2017 10:08:10.244 AM