15 June 2018 08:03:50 AM BLAS1_S_TEST: C version Test the BLAS1_S library. TEST01 ISAMAX returns the index of maximum magnitude; The vector X: 1 2.000000 2 -2.000000 3 5.000000 4 1.000000 5 -3.000000 6 4.000000 7 0.000000 8 -4.000000 9 3.000000 10 -1.000000 11 -5.000000 The index of maximum magnitude = 3 TEST02 Use ISAMAX, SAXPY and SSCAL in a Gauss elimination routine. First five entries of solution: 1.000000 2.000000 3.000000 3.999999 4.999999 TEST03 SASUM adds the absolute values of elements of a vector. X = 1 -2.000000 2 4.000000 3 -6.000000 4 8.000000 5 -10.000000 6 12.000000 7 -14.000000 8 16.000000 9 -18.000000 10 20.000000 SASUM ( NX, X, 1 ) = 110.000000 SASUM ( NX/2, X, 2 ) = 50.000000 SASUM ( 2, X, NX/2 ) = 14.000000 Demonstrate with a matrix A: 11.000000 -12.000000 13.000000 -14.000000 -21.000000 22.000000 -23.000000 24.000000 31.000000 -32.000000 33.000000 -34.000000 -41.000000 42.000000 -43.000000 44.000000 51.000000 -52.000000 53.000000 -54.000000 SASUM(MA,A(1,2),1) = 160.000000 SASUM(NA,A(2,1),LDA) = 90.000000 TEST04 SAXPY adds a multiple of vector X to vector Y. X = 1 1.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 6 6.000000 Y = 1 100.000000 2 200.000000 3 300.000000 4 400.000000 5 500.000000 6 600.000000 SAXPY ( N, 1.000000, X, 1, Y, 1 ) Y = 1 101.000000 2 202.000000 3 303.000000 4 404.000000 5 505.000000 6 606.000000 SAXPY ( N, -2.000000, X, 1, Y, 1 ) Y = 1 98.000000 2 196.000000 3 294.000000 4 392.000000 5 490.000000 6 588.000000 SAXPY ( 3, 3.000000, X, 2, Y, 1 ) Y = 1 103.000000 2 209.000000 3 315.000000 4 400.000000 5 500.000000 6 600.000000 SAXPY ( 3, -4.000000, X, 1, Y, 2 ) Y = 1 96.000000 2 200.000000 3 292.000000 4 400.000000 5 488.000000 6 600.000000 TEST05 SCOPY copies one vector into another. X = 1 1.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 6 6.000000 7 7.000000 8 8.000000 9 9.000000 10 10.000000 Y = 1 10.000000 2 20.000000 3 30.000000 4 40.000000 5 50.000000 6 60.000000 7 70.000000 8 80.000000 9 90.000000 10 100.000000 A = 11.000000 12.000000 13.000000 14.000000 15.000000 21.000000 22.000000 23.000000 24.000000 25.000000 31.000000 32.000000 33.000000 34.000000 35.000000 41.000000 42.000000 43.000000 44.000000 45.000000 51.000000 52.000000 53.000000 54.000000 55.000000 SCOPY ( 5, X, 1, Y, 1 ) 1 1.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 6 60.000000 7 70.000000 8 80.000000 9 90.000000 10 100.000000 SCOPY ( 3, X, 2, Y, 3 ) 1 1.000000 2 20.000000 3 30.000000 4 3.000000 5 50.000000 6 60.000000 7 5.000000 8 80.000000 9 90.000000 10 100.000000 SCOPY ( 5, X, 1, A, 1 ) A = 1.000000 12.000000 13.000000 14.000000 15.000000 2.000000 22.000000 23.000000 24.000000 25.000000 3.000000 32.000000 33.000000 34.000000 35.000000 4.000000 42.000000 43.000000 44.000000 45.000000 5.000000 52.000000 53.000000 54.000000 55.000000 SCOPY ( 5, X, 2, A, 5 ) A = 1.000000 3.000000 5.000000 7.000000 9.000000 21.000000 22.000000 23.000000 24.000000 25.000000 31.000000 32.000000 33.000000 34.000000 35.000000 41.000000 42.000000 43.000000 44.000000 45.000000 51.000000 52.000000 53.000000 54.000000 55.000000 TEST06 SDOT computes the dot product of vectors. Dot product of X and Y is -55.000000 Product of row 2 of A and X is 85.000000 Product of column 2 of A and X is 85.000000 Matrix product computed with SDOT: 50.000000 30.000000 10.000000 -10.000000 -30.000000 60.000000 35.000000 10.000000 -15.000000 -40.000000 70.000000 40.000000 10.000000 -20.000000 -50.000000 80.000000 45.000000 10.000000 -25.000000 -60.000000 90.000000 50.000000 10.000000 -30.000000 -70.000000 TEST07 SMACH returns some approximate machine numbers. SMACH(1) = EPS = 1.192093e-07 SMACH(2) = TINY = 2.350989e-36 SMACH(3) = HUGE = 4.253529e+35 TEST08 SNRM2 computes the Euclidean norm of a vector. X = 1 1 2 2 3 3 4 4 5 5 The 2-norm of X is 7.416199 The 2-norm of row 2 of A is 11.618950 The 2-norm of column 2 of A is 11.618950 TEST09 SROT carries out a Givens rotation. X and Y 1 1.000000 -11.000000 2 2.000000 -8.000000 3 3.000000 -3.000000 4 4.000000 4.000000 5 5.000000 13.000000 6 6.000000 24.000000 SROT ( N, X, 1, Y, 1, 0.500000, 0.866025 ) 1 -9.026279 -6.366025 2 -5.928203 -5.732051 3 -1.098076 -4.098076 4 5.464102 -1.464102 5 13.758330 2.169873 6 23.784609 6.803848 SROT ( N, X, 1, Y, 1, 0.090536, -0.995893 ) 1 11.045362 0.000000 2 8.148217 1.267500 3 3.259287 2.716072 4 -3.621430 4.345716 5 -12.493933 6.156431 6 -23.358221 8.148216 TEST10 SROTG generates a 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.491123 C*A+S*B = 0.980943 -S*A+C*B = 0.000000 A = 0.829509, B = 0.561695 C = 0.828025 S = 0.560691 R = 1.001792 Z = 0.560691 C*A+S*B = 1.001792 -S*A+C*B = 0.000000 A = 0.415307, B = 0.066119 C = 0.987563 S = 0.157224 R = 0.420537 Z = 0.157224 C*A+S*B = 0.420537 -S*A+C*B = 0.000000 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.000000 A = 0.043829, B = 0.633966 C = 0.068970 S = 0.997619 R = 0.635479 Z = 14.499054 C*A+S*B = 0.635479 -S*A+C*B = -0.000000 TEST11 SSCAL multiplies a vector by a scalar. X = 1 1.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 6 6.000000 SSCAL ( N, 5.000000, X, 1 ) 1 5.000000 2 10.000000 3 15.000000 4 20.000000 5 25.000000 6 30.000000 SSCAL ( 3, -2.000000, X, 2 ) 1 -2.000000 2 2.000000 3 -6.000000 4 4.000000 5 -10.000000 6 6.000000 TEST12 SSWAP swaps two vectors. X and Y: 1 1.000000 100.000000 2 2.000000 200.000000 3 3.000000 300.000000 4 4.000000 400.000000 5 5.000000 500.000000 6 6.000000 600.000000 SSWAP ( N, X, 1, Y, 1 ) X and Y: 1 100.000000 1.000000 2 200.000000 2.000000 3 300.000000 3.000000 4 400.000000 4.000000 5 500.000000 5.000000 6 600.000000 6.000000 SSWAP ( 3, X, 2, Y, 1 ) X and Y: 1 100.000000 1.000000 2 2.000000 3.000000 3 200.000000 5.000000 4 4.000000 400.000000 5 300.000000 500.000000 6 6.000000 600.000000 BLAS1_S_TEST: Normal end of execution. 15 June 2018 08:03:50 AM