26 March 2014 11:00:02.206 AM BLAS1_Z_PRB: FORTRAN90 version Test the BLAS1_Z library. TEST01 DZASUM adds the absolute values of elements of a double precision complex vector. X = 1 2.0 -1.0 2 -4.0 -2.0 3 3.0 1.0 4 2.0 2.0 5 -1.0 -1.0 6 -1.0 0.0 7 0.0 -3.0 8 4.0 0.0 DZASUM ( NX, X, 1 ) = 27.0000 DZASUM ( NX/2, X, 2 ) = 12.0000 DZASUM ( 2, X, NX/2 ) = 5.00000 Demonstrate with a matrix A: -3.0 4.0 -1.0 1.0 0.0 -2.0 -1.0 2.0 2.0 0.0 0.0 5.0 1.0 3.0 2.0 -4.0 3.0 -4.0 -4.0 -2.0 -3.0 3.0 0.0 -1.0 2.0 0.0 -4.0 1.0 -3.0 3.0 0.0 -1.0 2.0 -1.0 -4.0 -3.0 -1.0 -2.0 -2.0 4.0 DZASUM ( MA, A(1,2), 1 ) = 25.0000 DZASUM ( NA, A(2,1), MA ) = 17.0000 TEST02 DZNRM2 returns the Euclidean norm of a double precision complex vector. The vector X: 1 2.0 -1.0 2 -4.0 -2.0 3 3.0 1.0 4 2.0 2.0 5 -1.0 -1.0 The L2 norm of X is 6.70820 TEST03 IZAMAX returns the index of the entry of maximum magnitude in a double precision complex vector. The entries and ZABS1 magnitudes: 1 2.0000 -1.0000 3.0000 2 -4.0000 -2.0000 6.0000 3 3.0000 1.0000 4.0000 4 2.0000 2.0000 4.0000 5 -1.0000 -1.0000 2.0000 The index of maximum magnitude = 2 TEST04 ZABS1 returns the L1 norm of a double precision complex number. Real Imaginary Part Part ZABS1(Z) 2.2493 -0.6333 2.8826 -4.2160 -1.7214 5.9374 2.9481 1.3005 4.2486 1.9557 1.6170 3.5727 -0.6973 -0.7807 1.4780 -1.1803 0.3873 1.5676 0.0930 -3.1661 3.2591 4.4642 0.0516 4.5158 -2.8023 3.8190 6.6213 1.5318 0.1314 1.6632 TEST05 ZABS1 returns the L1 norm of a double precision complex number. Real Imaginary Part Part ZABS2(Z) 2.2493 -0.6333 2.3368 -4.2160 -1.7214 4.5539 2.9481 1.3005 3.2222 1.9557 1.6170 2.5376 -0.6973 -0.7807 1.0468 -1.1803 0.3873 1.2422 0.0930 -3.1661 3.1674 4.4642 0.0516 4.4645 -2.8023 3.8190 4.7368 1.5318 0.1314 1.5374 TEST06 ZAXPY adds a double precision complex multiple of one vector to another. X = 1 2.0 -1.0 2 -4.0 -2.0 3 3.0 1.0 4 2.0 2.0 5 -1.0 -1.0 Y = 1 -1.0 0.0 2 0.0 -3.0 3 4.0 0.0 4 -3.0 4.0 5 -2.0 0.0 The scalar multiplier is: 0.500000 -1.00000 A * X + Y = 1 -1.000000 -2.500000 2 -4.000000 0.000000 3 6.500000 -2.500000 4 0.000000 3.000000 5 -3.500000 0.500000 TEST07 ZCOPY copies a double precision complex vector. X = 1 10.0000 1.00000 2 20.0000 2.00000 3 30.0000 3.00000 4 40.0000 4.00000 5 50.0000 5.00000 6 60.0000 6.00000 7 70.0000 7.00000 8 80.0000 8.00000 9 90.0000 9.00000 10 100.000 10.0000 Y = 1 20.0000 2.00000 2 40.0000 4.00000 3 60.0000 6.00000 4 80.0000 8.00000 5 100.000 10.0000 6 120.000 12.0000 7 140.000 14.0000 8 160.000 16.0000 9 180.000 18.0000 10 200.000 20.0000 A = 10.0 1.0 10.0 2.0 10.0 3.0 10.0 4.0 10.0 5.0 20.0 1.0 20.0 2.0 20.0 3.0 20.0 4.0 20.0 5.0 30.0 1.0 30.0 2.0 30.0 3.0 30.0 4.0 30.0 5.0 40.0 1.0 40.0 2.0 40.0 3.0 40.0 4.0 40.0 5.0 50.0 1.0 50.0 2.0 50.0 3.0 50.0 4.0 50.0 5.0 ZCOPY ( 5, X, 1, Y, 1 ) 1 10.0000 1.00000 2 20.0000 2.00000 3 30.0000 3.00000 4 40.0000 4.00000 5 50.0000 5.00000 6 120.000 12.0000 7 140.000 14.0000 8 160.000 16.0000 9 180.000 18.0000 10 200.000 20.0000 ZCOPY ( 3, X, 2, Y, 3 ) 1 10.0000 1.00000 2 40.0000 4.00000 3 60.0000 6.00000 4 30.0000 3.00000 5 100.000 10.0000 6 120.000 12.0000 7 50.0000 5.00000 8 160.000 16.0000 9 180.000 18.0000 10 200.000 20.0000 ZCOPY ( 5, X, 1, A, 1 ) A = 10.0 1.0 10.0 2.0 10.0 3.0 10.0 4.0 10.0 5.0 20.0 2.0 20.0 2.0 20.0 3.0 20.0 4.0 20.0 5.0 30.0 3.0 30.0 2.0 30.0 3.0 30.0 4.0 30.0 5.0 40.0 4.0 40.0 2.0 40.0 3.0 40.0 4.0 40.0 5.0 50.0 5.0 50.0 2.0 50.0 3.0 50.0 4.0 50.0 5.0 ZCOPY ( 5, X, 2, A, 5 ) A = 10.0 1.0 30.0 3.0 50.0 5.0 70.0 7.0 90.0 9.0 20.0 1.0 20.0 2.0 20.0 3.0 20.0 4.0 20.0 5.0 30.0 1.0 30.0 2.0 30.0 3.0 30.0 4.0 30.0 5.0 40.0 1.0 40.0 2.0 40.0 3.0 40.0 4.0 40.0 5.0 50.0 1.0 50.0 2.0 50.0 3.0 50.0 4.0 50.0 5.0 TEST08 ZDOTC computes the conjugated dot product of two double precision complex vectors. X = 1 2.0 -1.0 2 -4.0 -2.0 3 3.0 1.0 4 2.0 2.0 5 -1.0 -1.0 The square of the norm of X, computed as ZDOTC(X,X) = 45.0000 0.0000 Y = 1 -1.0 0.0 2 0.0 -3.0 3 4.0 0.0 4 -3.0 4.0 5 -2.0 0.0 The dot product X.Y* is 20.0000 19.0000 TEST09 ZDOTU computes the unconjugated dot product of two double precision complex vectors. X = 1 2.000000 -1.000000 2 -4.000000 -2.000000 3 3.000000 1.000000 4 2.000000 2.000000 5 -1.000000 -1.000000 The unconjugated dot product ( X dot X ) (which is NOT the square of the norm of X!): ZDOTU(X,X) = 23.0000 28.0000 Y = 1 -1.000000 0.000000 2 0.000000 -3.000000 3 4.000000 0.000000 4 -3.000000 4.000000 5 -2.000000 0.000000 The dot product ( X dot Y ) is -8.0000 21.0000 TEST10 ZDROT carries out a Givens rotation on a double precision complex vector. X and Y 1 10.0 1.0 20.0 2.0 2 20.0 2.0 40.0 4.0 3 30.0 3.0 60.0 6.0 4 40.0 4.0 80.0 8.0 5 50.0 5.0 100.0 10.0 6 60.0 6.0 120.0 12.0 ZDROT ( N, X, 1, Y, 1, 0.5000, 0.8660 ) 1 22.3 2.2 1.3 0.1 2 44.6 4.5 2.7 0.3 3 67.0 6.7 4.0 0.4 4 89.3 8.9 5.4 0.5 5 111.6 11.2 6.7 0.7 6 133.9 13.4 8.0 0.8 TEST11 ZDSCAL multiplies a double precision real scalar times a double precision complex vector. X = 1 10.0 1.0 2 20.0 2.0 3 30.0 3.0 4 40.0 4.0 5 50.0 5.0 6 60.0 6.0 ZDSCAL ( N, 5.0000, X, 1 ) 1 50.0 5.0 2 100.0 10.0 3 150.0 15.0 4 200.0 20.0 5 250.0 25.0 6 300.0 30.0 ZDSCAL ( 3, -2.0000, X, 2 ) 1 -20.0 -2.0 2 20.0 2.0 3 -60.0 -6.0 4 40.0 4.0 5 -100.0 -10.0 6 60.0 6.0 TEST12 ZMACH computes several machine-dependent double precision complex arithmetic parameters. ZMACH(1) = machine epsilon = 2.22044604925031308E-016 ZMACH(2) = a tiny value = 8.90029543402880553E-308 ZMACH(3) = a huge value = 1.12355820928894744E+307 TEST13 ZROTG generates a double precision complex Givens rotation ( C S ) * ( A ) = ( R ) ( -S C ) ( B ) ( 0 ) A = 0.449860 -0.126667 B = -0.843197 -0.344280 C = 0.456540 S = -0.701707 0.546973 R = 0.985367 -0.277451 C *A+S*B = 0.985367 -0.277451 -conjg(S)*A+C*B = 0.00000 0.277556E-16 A = 0.589627 0.260090 B = 0.391140 0.323400 C = 0.785623 S = 0.595383 -0.168271 R = 0.750522 0.331062 C *A+S*B = 0.750522 0.331062 -conjg(S)*A+C*B = 0.555112E-16 0.00000 A = -0.139466 -0.156136 B = -0.236066 0.774593E-01 C = 0.644375 S = 0.306229 0.700717 R = -0.216436 -0.242305 C *A+S*B = -0.216436 -0.242305 -conjg(S)*A+C*B = 0.00000 0.00000 A = 0.185993E-01 -0.633214 B = 0.892850 0.103136E-01 C = 0.578631 S = 0.145278E-01 -0.815460 R = 0.321436E-01 -1.09433 C *A+S*B = 0.321436E-01 -1.09433 -conjg(S)*A+C*B = 0.111022E-15 0.173472E-17 A = -0.560465 0.763795 B = 0.306357 0.262752E-01 C = 0.951156 S = -0.160698 0.263588 R = -0.589246 0.803018 C *A+S*B = -0.589246 0.803018 -conjg(S)*A+C*B = -0.555112E-16 -0.173472E-16 TEST14 ZSCAL multiplies a double precision complex scalar times a double precision complex vector. X = 1 10.0 1.0 2 20.0 2.0 3 30.0 3.0 4 40.0 4.0 5 50.0 5.0 6 60.0 6.0 ZSCAL ( N, ( 5.0000 0.0000), X, 1 ) 1 50.0 5.0 2 100.0 10.0 3 150.0 15.0 4 200.0 20.0 5 250.0 25.0 6 300.0 30.0 ZSCAL ( 3, ( -2.0000 1.0000), X, 2 ) 1 -21.0 8.0 2 20.0 2.0 3 -63.0 24.0 4 40.0 4.0 5 -105.0 40.0 6 60.0 6.0 TEST15 ZSIGN1 ( C1, C2 ) transfers the sign of double precision complex C2 to the ZABS1 magnitude of C1. C1 C2 C3 -------------------- -------------------- -------------------- 2.2493 -0.6333 -4.2160 -1.7214 -2.0469 -0.8358 2.9481 1.3005 1.9557 1.6170 2.3257 1.9229 -0.6973 -0.7807 -1.1803 0.3873 -1.1129 0.3652 0.0930 -3.1661 4.4642 0.0516 3.2219 0.0372 -2.8023 3.8190 1.5318 0.1314 6.0983 0.5230 2.5040 -3.8997 1.7524 0.0828 6.1148 0.2888 2.1749 -1.3331 -1.0047 1.3536 -1.4946 2.0135 -0.4873 4.5094 -3.8512 -1.5715 -3.5486 -1.4481 -4.4459 1.3283 -3.8994 -2.7558 -3.3832 -2.3910 0.1568 -2.1678 1.2454 2.8937 0.6995 1.6251 TEST16 ZSIGN2 ( C1, C2 ) transfers the sign of double precision complex C2 to the ZABS2 magnitude of C1. C1 C2 C3 -------------------- -------------------- -------------------- 2.2493 -0.6333 -4.2160 -1.7214 -2.1634 -0.8833 2.9481 1.3005 1.9557 1.6170 2.4833 2.0532 -0.6973 -0.7807 -1.1803 0.3873 -0.9946 0.3264 0.0930 -3.1661 4.4642 0.0516 3.1672 0.0366 -2.8023 3.8190 1.5318 0.1314 4.7195 0.4048 2.5040 -3.8997 1.7524 0.0828 4.6292 0.2187 2.1749 -1.3331 -1.0047 1.3536 -1.5205 2.0483 -0.4873 4.5094 -3.8512 -1.5715 -4.1995 -1.7136 -4.4459 1.3283 -3.8994 -2.7558 -3.7893 -2.6780 0.1568 -2.1678 1.2454 2.8937 0.8592 1.9964 TEST17 ZSWAP swaps two double precision complex vectors. X and Y 1 10.0 1.0 20.0 2.0 2 20.0 2.0 40.0 4.0 3 30.0 3.0 60.0 6.0 4 40.0 4.0 80.0 8.0 5 50.0 5.0 100.0 10.0 ZSWAP ( N, X, 1, Y, 1 ) X and Y 1 20.0 2.0 10.0 1.0 2 40.0 4.0 20.0 2.0 3 60.0 6.0 30.0 3.0 4 80.0 8.0 40.0 4.0 5 100.0 10.0 50.0 5.0 ZSWAP ( 3, X, 2, Y, 1 ) X and Y 1 20.0 2.0 10.0 1.0 2 20.0 2.0 30.0 3.0 3 40.0 4.0 50.0 5.0 4 40.0 4.0 80.0 8.0 5 60.0 6.0 100.0 10.0 BLAS1_Z_PRB: Normal end of execution. 26 March 2014 11:00:02.209 AM