05 October 2018 09:23:31 PM CBLAS_TEST C++ version Test the CBLAS library. DASUM_TEST DASUM adds the absolute values of elements of a vector. X = 1 -2 2 4 3 -6 4 8 5 -10 6 12 7 -14 8 16 9 -18 10 20 DASUM ( NX, X, 1 ) = 110 DASUM ( NX/2, X, 2 ) = 50 DASUM ( 2, X, NX/2 ) = 14 Demonstrate with a matrix A: 11 -12 13 -14 -21 22 -23 24 31 -32 33 -34 -41 42 -43 44 51 -52 53 -54 DASUM(MA,A(1,2),1) = 160 DASUM(NA,A(2,1),LDA) = 90 DAXPY_TEST DAXPY adds a multiple of vector X to vector Y. X = 1 1 2 2 3 3 4 4 5 5 6 6 Y = 1 100 2 200 3 300 4 400 5 500 6 600 DAXPY ( N, 1, X, 1, Y, 1 ) Y = 1 101 2 202 3 303 4 404 5 505 6 606 DAXPY ( N, -2, X, 1, Y, 1 ) Y = 1 98 2 196 3 294 4 392 5 490 6 588 DAXPY ( 3, 3, X, 2, Y, 1 ) Y = 1 103 2 209 3 315 4 400 5 500 6 600 DAXPY ( 3, -4, X, 1, Y, 2 ) Y = 1 96 2 200 3 292 4 400 5 488 6 600 DCOPY_TEST DCOPY copies one vector into another. X = 11 22 33 44 55 66 77 88 99 1010 Y = 1 10 2 20 3 30 4 40 5 50 6 60 7 70 8 80 9 90 10 100 A = 11 12 13 14 15 21 22 23 24 25 31 32 33 34 35 41 42 43 44 45 51 52 53 54 55 DCOPY ( 5, X, 1, Y, 1 ) 1 1 2 2 3 3 4 4 5 5 6 60 7 70 8 80 9 90 10 100 DCOPY ( 3, X, 2, Y, 3 ) 1 1 2 20 3 30 4 3 5 50 6 60 7 5 8 80 9 90 10 100 DCOPY ( 5, X, 1, A, 1 ) A = 1 12 13 14 15 2 22 23 24 25 3 32 33 34 35 4 42 43 44 45 5 52 53 54 55 DCOPY ( 5, X, 2, A, 5 ) A = 1 3 5 7 9 21 22 23 24 25 31 32 33 34 35 41 42 43 44 45 51 52 53 54 55 DDOT_TEST DDOT computes the dot product of vectors. Dot product of X and Y is -385 Product of row 2 of A and X is 463 Product of column 2 of A and X is -162 Matrix product computed with DDOT: 356 -488 -9088 -18726 -744 254 152 50 -52 -154 23 1053 -9267 -20471 -4437 283 171 59 -53 -165 -630 2434 -8966 -22096 -9206 312 190 68 -54 -176 -1305 6279 -9261 -23075 -13617 309 185 61 -63 -187 -1602 -5326 -7410 722 236 146 56 -34 -124 -214 -1091 -8331 -12783 343 265 165 65 -35 -135 -235 -488 -9088 -18726 -744 254 152 50 -52 -154 -256 1053 -9267 -20471 -4437 283 171 59 -53 -165 -277 2434 -8966 -22096 -9206 312 190 68 -54 -176 -298 6279 -9261 -23075 -13617 309 185 61 -63 -187 -311 DNRM2_TEST For a double precision real vector (D) DNRM2 computes the Euclidean norm. The vector X: 0: 1 1: 2 2: 3 VALUE = 3.74166 DROT_TEST DROT carries out a Givens rotation. X and Y 1 1 -11 2 2 -8 3 3 -3 4 4 4 5 5 13 6 6 24 DROT ( N, X, 1, Y, 1, 0.5, 0.866025 ) 1 -9.02628 -6.36603 2 -5.9282 -5.73205 3 -1.09808 -4.09808 4 5.4641 -1.4641 5 13.7583 2.16987 6 23.7846 6.80385 DROT ( N, X, 1, Y, 1, 0.0905357, -0.995893 ) 1 11.0454 0 2 8.14822 1.2675 3 3.25929 2.71607 4 -3.62143 4.34572 5 -12.4939 6.15643 6 -23.3582 8.14822 DROTG_TEST DROTG 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.980944, Z = 4.49113 C*A+S*B = 0.980944 -S*A+C*B = 0 A = 0.829509, B = 0.561695 C = 0.828025, S = 0.56069 R = 1.00179, Z = 0.56069 C*A+S*B = 1.00179 -S*A+C*B = 0 A = 0.415307, B = 0.066119 C = 0.987563, S = 0.157225 R = 0.420537, Z = 0.157225 C*A+S*B = 0.420537 -S*A+C*B = -1.38778e-17 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 A = 0.043829, B = 0.633966 C = 0.06897, S = 0.997619 R = 0.635479, Z = 14.4991 C*A+S*B = 0.635479 -S*A+C*B = -6.93889e-18 DSCAL_TEST DSCAL multiplies a vector by a scalar. X = 11 22 33 44 55 66 DSCAL ( N, 5, X, 1 ) 15 210 315 420 525 630 DSCAL ( 3, -2, X, 2 ) 1-2 22 3-6 44 5-10 66 DSWAP_TEST DSWAP swaps two vectors. X and Y: 1 1 100 2 2 200 3 3 300 4 4 400 5 5 500 6 6 600 DSWAP ( N, X, 1, Y, 1 ) X and Y: 1 100 1 2 200 2 3 300 3 4 400 4 5 500 5 6 600 6 DSWAP ( 3, X, 2, Y, 1 ) X and Y: 1 100 1 2 2 3 3 200 5 4 4 400 5 300 500 6 6 600 IDAMAX_TEST IDAMAX returns the index of maximum magnitude; The vector X: 1 2 2 -2 3 5 4 1 5 -3 6 4 7 0 8 -4 9 3 10 -1 11 -5 The index of maximum magnitude = 3 CBLAS_TEST: Normal end of execution. 05 October 2018 09:23:31 PM