26 March 2014 10:57:56.775 AM BLAS1_S_PRB: FORTRAN90 version Test the BLAS1_S library. TEST01 ISAMAX returns the index of the entry of maximum magnitude in a single precision real vector. The vector X: 1 2.0000 2 -2.0000 3 5.0000 4 1.0000 5 -3.0000 6 4.0000 7 0.0000 8 -4.0000 9 3.0000 10 -1.0000 11 -5.0000 The index of maximum magnitude = 3 TEST02 Use ISAMAX, SAXPY and SSCAL in a Gauss elimination routine. First five entries of solution: 1.00000 2.00000 3.00000 4.00000 5.00000 TEST03 SASUM adds the absolute values of elements of a single precision real vector. X = 1 -2.00000 2 4.00000 3 -6.00000 4 8.00000 5 -10.0000 6 12.0000 7 -14.0000 8 16.0000 9 -18.0000 10 20.0000 SASUM ( NX, X, 1 ) = 110.000 SASUM ( NX/2, X, 2 ) = 50.0000 SASUM ( 2, X, NX/2 ) = 14.0000 Demonstrate with a matrix A: 11.0000 -12.0000 13.0000 -14.0000 -21.0000 22.0000 -23.0000 24.0000 31.0000 -32.0000 33.0000 -34.0000 -41.0000 42.0000 -43.0000 44.0000 51.0000 -52.0000 53.0000 -54.0000 SASUM(MA,A(1,2),1) = 160.000 SASUM(NA,A(2,1),LDA) = 90.0000 TEST04 SAXPY adds a multiple of one single precision real vector to another. X = 1 1.00000 2 2.00000 3 3.00000 4 4.00000 5 5.00000 6 6.00000 Y = 1 100.000 2 200.000 3 300.000 4 400.000 5 500.000 6 600.000 SAXPY ( N, 1.0000, X, 1, Y, 1 ) 1 101.000 2 202.000 3 303.000 4 404.000 5 505.000 6 606.000 SAXPY ( N, -2.0000, X, 1, Y, 1 ) 1 98.0000 2 196.000 3 294.000 4 392.000 5 490.000 6 588.000 SAXPY ( 3, 3.0000, X, 2, Y, 1 ) 1 103.000 2 209.000 3 315.000 4 400.000 5 500.000 6 600.000 SAXPY ( 3, -4.0000, X, 1, Y, 2 ) 1 96.0000 2 200.000 3 292.000 4 400.000 5 488.000 6 600.000 TEST05 SCOPY copies a single precision real vector. X = 1 1.00000 2 2.00000 3 3.00000 4 4.00000 5 5.00000 6 6.00000 7 7.00000 8 8.00000 9 9.00000 10 10.0000 Y = 1 10.0000 2 20.0000 3 30.0000 4 40.0000 5 50.0000 6 60.0000 7 70.0000 8 80.0000 9 90.0000 10 100.000 A = 11.00 12.00 13.00 14.00 15.00 21.00 22.00 23.00 24.00 25.00 31.00 32.00 33.00 34.00 35.00 41.00 42.00 43.00 44.00 45.00 51.00 52.00 53.00 54.00 55.00 SCOPY ( 5, X, 1, Y, 1 ) 1 1.00000 2 2.00000 3 3.00000 4 4.00000 5 5.00000 6 60.0000 7 70.0000 8 80.0000 9 90.0000 10 100.000 SCOPY ( 3, X, 2, Y, 3 ) 1 1.00000 2 20.0000 3 30.0000 4 3.00000 5 50.0000 6 60.0000 7 5.00000 8 80.0000 9 90.0000 10 100.000 SCOPY ( 5, X, 1, A, 1 ) A = 1.00 12.00 13.00 14.00 15.00 2.00 22.00 23.00 24.00 25.00 3.00 32.00 33.00 34.00 35.00 4.00 42.00 43.00 44.00 45.00 5.00 52.00 53.00 54.00 55.00 SCOPY ( 5, X, 2, A, 5 ) A = 1.00 3.00 5.00 7.00 9.00 21.00 22.00 23.00 24.00 25.00 31.00 32.00 33.00 34.00 35.00 41.00 42.00 43.00 44.00 45.00 51.00 52.00 53.00 54.00 55.00 TEST06 SDOT computes the dot product of single precision real vectors. Dot product of X and Y is -55.0000 Product of row 2 of A and X is 85.0000 Product of column 2 of A and X is 85.0000 Matrix product computed with SDOT: 50.0000 30.0000 10.0000 -10.0000 -30.0000 60.0000 35.0000 10.0000 -15.0000 -40.0000 70.0000 40.0000 10.0000 -20.0000 -50.0000 80.0000 45.0000 10.0000 -25.0000 -60.0000 90.0000 50.0000 10.0000 -30.0000 -70.0000 TEST07 SMACH computes several machine-dependent single precision real arithmetic parameters. SMACH(1) = machine epsilon = 1.19209290E-07 SMACH(2) = a tiny value = 2.35098870E-36 SMACH(3) = a huge value = 4.25352949E+35 FORTRAN90 parameters: EPSILON() = machine epsilon = 1.19209290E-07 TINY() = a tiny value = 1.17549435E-38 HUGE() = a huge value = 3.40282347E+38 TEST08 SNRM2 computes the Euclidean norm of a single precision real vector. The vector X: 1 1.0000 2 2.0000 3 3.0000 4 4.0000 5 5.0000 The 2-norm of X is 7.41620 The 2-norm of row 2 of A is 11.6189 The 2-norm of column 2 of A is 11.6189 TEST09 SROT carries out a single precision real Givens rotation. X and Y 1 1.00000 -11.0000 2 2.00000 -8.00000 3 3.00000 -3.00000 4 4.00000 4.00000 5 5.00000 13.0000 6 6.00000 24.0000 SROT ( N, X, 1, Y, 1, 0.5000, 0.8660 ) 1 -9.02628 -6.36603 2 -5.92820 -5.73205 3 -1.09808 -4.09808 4 5.46410 -1.46410 5 13.7583 2.16987 6 23.7846 6.80385 SROT ( N, X, 1, Y, 1, 0.0905, -0.9959 ) 1 11.0454 -0.596046E-07 2 8.14822 1.26750 3 3.25929 2.71607 4 -3.62143 4.34572 5 -12.4939 6.15643 6 -23.3582 8.14822 TEST10 SROTG generates a single precision real Givens rotation ( C S ) * ( A ) = ( R ) ( -S C ) ( B ) ( 0 ) A = 0.218418 B = 0.956318 C = 0.222661 S = 0.974896 R = 0.980943 Z = 4.49112 C*A+S*B = 0.980943 -S*A+C*B = 0.00000 A = 0.829509 B = 0.561695 C = 0.828025 S = 0.560691 R = 1.00179 Z = 0.560691 C*A+S*B = 1.00179 -S*A+C*B = 0.298023E-07 A = 0.415307 B = 0.661187E-01 C = 0.987563 S = 0.157224 R = 0.420537 Z = 0.157224 C*A+S*B = 0.420537 -S*A+C*B = 0.00000 A = 0.257578 B = 0.109957 C = 0.919705 S = 0.392611 R = 0.280066 Z = 0.392611 C*A+S*B = 0.280066 -S*A+C*B = 0.00000 A = 0.438290E-01 B = 0.633966 C = 0.689700E-01 S = 0.997619 R = 0.635479 Z = 14.4991 C*A+S*B = 0.635479 -S*A+C*B = -0.372529E-08 TEST11 SSCAL multiplies a single precision real scalar times a single precision real vector. X = 1 1.00000 2 2.00000 3 3.00000 4 4.00000 5 5.00000 6 6.00000 SSCAL ( N, 5.0000, X, 1 ) 1 5.00000 2 10.0000 3 15.0000 4 20.0000 5 25.0000 6 30.0000 SSCAL ( 3, -2.0000, X, 2 ) 1 -2.00000 2 2.00000 3 -6.00000 4 4.00000 5 -10.0000 6 6.00000 TEST12 SSWAP swaps two single precision real vectors. X and Y 1 1.00000 100.000 2 2.00000 200.000 3 3.00000 300.000 4 4.00000 400.000 5 5.00000 500.000 6 6.00000 600.000 SSWAP ( N, X, 1, Y, 1 ) X and Y 1 100.000 1.00000 2 200.000 2.00000 3 300.000 3.00000 4 400.000 4.00000 5 500.000 5.00000 6 600.000 6.00000 SSWAP ( 3, X, 2, Y, 1 ) X and Y 1 100.000 1.00000 2 2.00000 3.00000 3 200.000 5.00000 4 4.00000 400.000 5 300.000 500.000 6 6.00000 600.000 BLAS1_S_PRB: Normal end of execution. 26 March 2014 10:57:56.777 AM