%!PS %%Version: 3.3.1 %%DocumentFonts: (atend) %%Pages: (atend) %%EndComments % % Version 3.3.1 prologue for troff files. % /#copies 1 store /aspectratio 1 def /formsperpage 1 def /landscape false def /linewidth .3 def /magnification 1 def /margin 0 def /orientation 0 def /resolution 720 def /rotation 1 def /xoffset 0 def /yoffset 0 def /roundpage true def /useclippath true def /pagebbox [0 0 612 792] def /R /Times-Roman def /I /Times-Italic def /B /Times-Bold def /BI /Times-BoldItalic def /H /Helvetica def /HI /Helvetica-Oblique def /HB /Helvetica-Bold def /HX /Helvetica-BoldOblique def /CW /Courier def /CO /Courier def /CI /Courier-Oblique def /CB /Courier-Bold def /CX /Courier-BoldOblique def /PA /Palatino-Roman def /PI /Palatino-Italic def /PB /Palatino-Bold def /PX /Palatino-BoldItalic def /Hr /Helvetica-Narrow def /Hi /Helvetica-Narrow-Oblique def /Hb /Helvetica-Narrow-Bold def /Hx /Helvetica-Narrow-BoldOblique def /KR /Bookman-Light def /KI /Bookman-LightItalic def /KB /Bookman-Demi def /KX /Bookman-DemiItalic def /AR /AvantGarde-Book def /AI /AvantGarde-BookOblique def /AB /AvantGarde-Demi def /AX /AvantGarde-DemiOblique def /NR /NewCenturySchlbk-Roman def /NI /NewCenturySchlbk-Italic def /NB /NewCenturySchlbk-Bold def /NX /NewCenturySchlbk-BoldItalic def /ZD /ZapfDingbats def /ZI /ZapfChancery-MediumItalic def /S /S def /S1 /S1 def /GR /Symbol def /inch {72 mul} bind def /min {2 copy gt {exch} if pop} bind def /setup { counttomark 2 idiv {def} repeat pop landscape {/orientation 90 orientation add def} if /scaling 72 resolution div def linewidth setlinewidth 1 setlinecap pagedimensions xcenter ycenter translate orientation rotation mul rotate width 2 div neg height 2 div translate xoffset inch yoffset inch neg translate margin 2 div dup neg translate magnification dup aspectratio mul scale scaling scaling scale addmetrics 0 0 moveto } def /pagedimensions { useclippath userdict /gotpagebbox known not and { /pagebbox [clippath pathbbox newpath] def roundpage currentdict /roundpagebbox known and {roundpagebbox} if } if pagebbox aload pop 4 -1 roll exch 4 1 roll 4 copy landscape {4 2 roll} if sub /width exch def sub /height exch def add 2 div /xcenter exch def add 2 div /ycenter exch def userdict /gotpagebbox true put } def /addmetrics { /Symbol /S null Sdefs cf /Times-Roman /S1 StandardEncoding dup length array copy S1defs cf } def /pagesetup { /page exch def currentdict /pagedict known currentdict page known and { page load pagedict exch get cvx exec } if } def /decodingdefs [ {counttomark 2 idiv {y moveto show} repeat} {neg /y exch def counttomark 2 idiv {y moveto show} repeat} {neg moveto {2 index stringwidth pop sub exch div 0 32 4 -1 roll widthshow} repeat} {neg moveto {spacewidth sub 0.0 32 4 -1 roll widthshow} repeat} {counttomark 2 idiv {y moveto show} repeat} {neg setfunnytext} ] def /setdecoding {/t decodingdefs 3 -1 roll get bind def} bind def /w {neg moveto show} bind def /m {neg dup /y exch def moveto} bind def /done {/lastpage where {pop lastpage} if} def /f { dup /font exch def findfont exch dup /ptsize exch def scaling div dup /size exch def scalefont setfont linewidth ptsize mul scaling 10 mul div setlinewidth /spacewidth ( ) stringwidth pop def } bind def /changefont { /fontheight exch def /fontslant exch def currentfont [ 1 0 fontheight ptsize div fontslant sin mul fontslant cos div fontheight ptsize div 0 0 ] makefont setfont } bind def /sf {f} bind def /cf { dup length 2 idiv /entries exch def /chtab exch def /newencoding exch def /newfont exch def findfont dup length 1 add dict /newdict exch def {1 index /FID ne {newdict 3 1 roll put}{pop pop} ifelse} forall newencoding type /arraytype eq {newdict /Encoding newencoding put} if newdict /Metrics entries dict put newdict /Metrics get begin chtab aload pop 1 1 entries {pop def} for newfont newdict definefont pop end } bind def % % A few arrays used to adjust reference points and character widths in some % of the printer resident fonts. If square roots are too high try changing % the lines describing /radical and /radicalex to, % % /radical [0 -75 550 0] % /radicalex [-50 -75 500 0] % % Move braceleftbt a bit - default PostScript character is off a bit. % /Sdefs [ /bracketlefttp [201 500] /bracketleftbt [201 500] /bracketrighttp [-81 380] /bracketrightbt [-83 380] /braceleftbt [203 490] /bracketrightex [220 -125 500 0] /radical [0 0 550 0] /radicalex [-50 0 500 0] /parenleftex [-20 -170 0 0] /integral [100 -50 500 0] /infinity [10 -75 730 0] ] def /S1defs [ /underscore [0 80 500 0] /endash [7 90 650 0] ] def % % Tries to round clipping path dimensions, as stored in array pagebbox, so they % match one of the known sizes in the papersizes array. Lower left coordinates % are always set to 0. % /roundpagebbox { 7 dict begin /papersizes [8.5 inch 11 inch 14 inch 17 inch] def /mappapersize { /val exch def /slop .5 inch def /diff slop def /j 0 def 0 1 papersizes length 1 sub { /i exch def papersizes i get val sub abs dup diff le {/diff exch def /j i def} {pop} ifelse } for diff slop lt {papersizes j get} {val} ifelse } def pagebbox 0 0 put pagebbox 1 0 put pagebbox dup 2 get mappapersize 2 exch put pagebbox dup 3 get mappapersize 3 exch put end } bind def %%EndProlog %%BeginSetup mark /resolution 720 def setup 2 setdecoding %%EndSetup %%Page: 1 1 /saveobj save def mark 1 pagesetup 10 R f (Appendix 5)1 469 1 2825 120 t (BASIC LINEAR ALGEBRA MODULES)3 1691 1 720 360 t ( if the largest element of a vector)7 1316(ISAMAX - index)2 949 2 720 720 t ( of a vector)3 451( 1-norm)1 444(SASUM -)1 577 3 720 840 t ( multiple of one vector to another)6 1337( add)1 294(SAXPY -)1 577 3 720 960 t ( product of two vectors)4 926( dot)1 278(SDOT -)1 577 3 720 1080 t ( a vector)2 343( scale)1 349(SSCAL -)1 577 3 720 1200 t ( two vectors)2 488( interchange)1 615(SSWAP -)1 577 3 720 1320 t cleartomark showpage saveobj restore %%EndPage: 1 1 %%Page: 2 2 /saveobj save def mark 2 pagesetup 10 R f (ISAMAX \320 index of the maximum magnitude element of a vector)10 2691 1 1534 120 t 9 B f (Purpose:)720 480 w 10 R f ( to \256nd the \(\256rst\) component with maximum magnitude.)8 2373(ISAMAX looks through a vector)4 1371 2 1296 480 t (The integer position of that component in the vector is returned.)10 2555 1 1296 600 t 9 B f (Type:)720 960 w 10 R f (Integer function)1 640 1 1296 960 t 9 B f (Usage:)720 1320 w 10 S f (<)1296 1320 w 10 R f (answer)1351 1320 w 10 S f (>)1633 1320 w 10 R f (= ISAMAX\(N, X, INCX\))3 1029 1 1713 1320 t (N)1440 1560 w 14 S f (\256)1980 1580 w 10 R f (the number of elements to be compared)6 1580 1 2196 1560 t (X)1440 1800 w 14 S f (\256)1980 1820 w 10 R f (the vector of elements)3 884 1 2196 1800 t (INCX)1440 2040 w 14 S f (\256)1980 2060 w 10 R f (the elements are spaced at intervals of INCX in X:)9 2015 1 2196 2040 t (X\(1\), X\(1+INCX\), ..., X\(1+\(N)3 1217 1 2196 2160 t 10 S f (-)3413 2160 w 10 R f (1\))3468 2160 w 10 S f (*)3551 2160 w 10 R f (INCX\))3601 2160 w 10 S f (<)1440 2400 w 10 R f (answer)1495 2400 w 10 S f (>)1777 2400 w 14 S f (\254)1980 2420 w 10 R f (M, the position of the \(\256rst\) component of maximum magnitude:)9 2594 1 2196 2400 t (If INCX = 1,)3 516 1 2484 2520 t 10 S f (\357)3050 2520 w 10 R f (X\(M\))3099 2520 w 10 S f (\357)3326 2520 w 10 R f (is largest.)1 383 1 3400 2520 t (In general,)1 426 1 2484 2640 t 10 S f (\357)2960 2640 w 10 R f (X\(1 + \(M)2 383 1 3009 2640 t 10 S f (-)3417 2640 w 10 R f (1\))3497 2640 w 10 S f (*)3605 2640 w 10 R f (INCX\))3680 2640 w 10 S f (\357)3957 2640 w 10 R f (is largest.)1 383 1 4031 2640 t 9 B f (Note 1:)1 278 1 720 3000 t 10 R f ( we can use ISAMAX to deal with the rows)9 1780(Since Fortran stores arrays in column-wise order)6 1964 2 1296 3000 t (of a 2-dimensional array as in the example below.)8 1993 1 1296 3120 t 9 B f (Note 2:)1 278 1 720 3480 t 10 R f (If N=0, ISAMAX=0 is returned.)4 1293 1 1296 3480 t 9 B f (Error situations:)1 648 1 720 3840 t 10 R f (\(All errors in this subprogram are fatal \320)7 1666 1 1512 3840 t (see)1512 3960 w 10 I f (Error Handling)1 631 1 1664 3960 t 10 R f (, Framework Chapter\))2 884 1 2295 3960 t (Number Error)1 1506 1 1800 4200 t (1 N)1 1108 1 1944 4440 t 10 S f (<)3077 4440 w 10 R f (0)3157 4440 w (2 INCX)1 1280 1 1944 4680 t 10 S f (\243)3249 4680 w 10 R f (0)3329 4680 w 9 B f (Double-precision version:)1 988 1 720 5040 t 10 R f (IDAMAX with X declared double precision)5 1760 1 1800 5040 t 9 B f (Complex version:)1 678 1 720 5400 t 10 R f (ICAMAX with X declared complex)4 1436 1 1473 5400 t 9 B f (See also:)1 333 1 720 5760 t 10 R f (SAMAX, ISMAX)1 733 1 1296 5760 t 9 B f (Author:)720 6120 w 10 R f (Linda Kaufman)1 629 1 1296 6120 t 9 B f (Reference:)720 6480 w 10 R f ( J., Kincaid, D. R., and Krogh, F. T., Basic linear algebra subpro-)12 2643(Lawson, C. L., Hanson, R.)4 1074 2 1323 6480 t (grams for Fortran usage,)3 981 1 1296 6600 t 10 I f (ACM Trans. Math. Software 5)4 1212 1 2302 6600 t 10 R f (, 3 \(1979\), 308-323.)3 799 1 3514 6600 t (Linear Algebra)1 606 1 360 7500 t (\320 2 \320)2 300 1 2730 7620 t (ISAMAX)360 7740 w cleartomark showpage saveobj restore %%EndPage: 2 2 %%Page: 3 3 /saveobj save def mark 3 pagesetup 10 R f (-- --)1 5544 1 0 120 t 8 R f (PORT)360 600 w 10 R f ( Algebra)1 346(library Linear)1 4463 2 591 600 t ( ISAMAX)1 4305(February 11, 1993)2 735 2 360 840 t 9 B f (Example:)720 1320 w 10 R f ( an $m times n$ matrix A, dimensioned \(IA,N\) are permuted)10 2484(In this example the columns of)5 1260 2 1296 1320 t ( the elements of the \256rst row in A.)8 1400(so that the \(1,1\) element of A is the largest in modulus of)12 2344 2 1296 1440 t (The subroutine SSWAP interchanges two vectors.)5 2003 1 1296 1560 t 8 CW f (J=ISAMAX\(N,A,IA\))2568 1900 w (CALL SSWAP\(M,A,1,A\(1,J\),1\))1 1248 1 2568 2000 t 10 R f (Linear Algebra)1 606 1 4794 7500 t (\320 3 \320)2 300 1 2730 7620 t (ISAMAX)5006 7740 w cleartomark showpage saveobj restore %%EndPage: 3 3 %%Page: 4 4 /saveobj save def mark 4 pagesetup 10 R f (-- --)1 5544 1 0 120 t (Linear Algebra)1 606 1 360 600 t 8 R f (PORT)4903 600 w 10 R f (library)5134 600 w ( 11, 1993)2 375(ISAMAX February)1 4665 2 360 840 t (SASUM \320 1-norm of a vector)5 1240 1 2548 1320 t 9 B f (Purpose:)720 1680 w 10 R f ( sum of the absolute values of a vector: $sum from i=1 to n)13 2401(SASUM computes the)2 904 2 1296 1680 t 10 S f (\357)4629 1680 w 10 R f (x sub i \303)3 334 1 4706 1680 t 10 S f (\357)1296 1800 w 10 R f ($)1345 1800 w 9 B f (Type:)720 2160 w 10 R f (Real function)1 541 1 1296 2160 t 9 B f (Usage:)720 2520 w 10 S f (<)1296 2520 w 10 R f (answer)1351 2520 w 10 S f (>)1633 2520 w 10 R f (= SASUM\(N, X, INCX\))3 980 1 1713 2520 t (N)1440 2760 w 14 S f (\256)1980 2780 w 10 R f (the number of elements to be summed)6 1526 1 2196 2760 t (X)1440 3000 w 14 S f (\256)1980 3020 w 10 R f (the vector of elements)3 884 1 2196 3000 t (INCX)1440 3240 w 14 S f (\256)1980 3260 w 10 R f (the elements are spaced at intervals of INCX in X:)9 2015 1 2196 3240 t (X\(1\), X\(1+INCX\), ..., X\(1+\(N)3 1217 1 2196 3360 t 10 S f (-)3413 3360 w 10 R f (1\)INCX\))3468 3360 w 10 S f (<)1440 3600 w 10 R f (answer)1495 3600 w 10 S f (>)1777 3600 w 14 S f (\254)1980 3620 w 10 S f (\357)2196 3600 w 10 R f (X\(1\))2270 3600 w 10 S f (\357)2483 3600 w 10 R f (+)2557 3600 w 10 S f (\357)2638 3600 w 10 R f (X\(1+INCX\))2712 3600 w 10 S f (\357)3225 3600 w 10 R f (+ ... +)2 237 1 3299 3600 t 10 S f (\357)3561 3600 w 10 R f (X\(1+\(N)3635 3600 w 10 S f (-)3951 3600 w 10 R f (1\)INCX\))4006 3600 w 10 S f (\357)4391 3600 w 9 B f (Note 1:)1 278 1 720 3960 t 10 R f ( arrays in column-wise order we can use SASUM to deal with the rows)13 2933(Since Fortran stores)2 811 2 1296 3960 t (of a 2-dimensional array as in the example below.)8 1993 1 1296 4080 t 9 B f (Note 2:)1 278 1 720 4440 t 10 R f (If N=0, SASUM=0.0 is returned.)4 1319 1 1296 4440 t 9 B f (Note 3:)1 278 1 720 4800 t 10 R f ( i=1 to n \()4 427(For complex vectors, SCASUM computes $sum from)6 2194 2 1296 4800 t 10 S f (\357)3917 4800 w 10 R f (Re\(x sub i \))3 493 1 3966 4800 t 10 S f (\357)4459 4800 w 10 R f (+)4508 4800 w 10 S f (\357)4564 4800 w 10 R f (Im\(x sub i)2 427 1 4613 4800 t (\))1296 4920 w 10 S f (\357)1329 4920 w 10 R f (\)$.)1378 4920 w 9 B f (Note 4:)1 278 1 720 5280 t 10 R f (No attempt is made to prevent or give warning of under\257ow or over\257ow.)12 2915 1 1296 5280 t 9 B f (Error situations:)1 648 1 720 5640 t 10 R f (\(All errors in this subprogram are fatal \320)7 1666 1 1512 5640 t (see)1512 5760 w 10 I f (Error Handling)1 631 1 1664 5760 t 10 R f (, Framework Chapter\))2 884 1 2295 5760 t (Number Error)1 1506 1 1800 6000 t (1 N)1 1108 1 1944 6240 t 10 S f (<)3052 6240 w 10 R f (0)3107 6240 w (2 INCX)1 1280 1 1944 6480 t 10 S f (\243)3224 6480 w 10 R f (0)3279 6480 w 9 B f (Double-precision version:)1 988 1 720 6840 t 10 R f (DASUM with X declared double precision)5 1711 1 1800 6840 t (Linear Algebra)1 606 1 360 7500 t (\320 4 \320)2 300 1 2730 7620 t (SASUM)360 7740 w cleartomark showpage saveobj restore %%EndPage: 4 4 %%Page: 5 5 /saveobj save def mark 5 pagesetup 10 R f (-- --)1 5544 1 0 120 t 8 R f (PORT)360 600 w 10 R f ( Algebra)1 346(library Linear)1 4463 2 591 600 t ( SASUM)1 4305(February 11, 1993)2 735 2 360 840 t 9 B f (Complex version:)1 678 1 720 1320 t 10 R f (SCASUM with X declared complex \(see Note 3\).)7 1980 1 1473 1320 t 9 B f (Author:)720 1680 w 10 R f (Linda Kaufman)1 629 1 1296 1680 t 9 B f (Reference:)720 2040 w 10 R f ( J., Kincaid, D. R., and Krogh, F. T., Basic linear algebra subpro-)12 2643(Lawson, C. L., Hanson, R.)4 1074 2 1323 2040 t ( Fortran Usage, Report SAND77-0898, Sandia Laboratories, Albuquerque, New)8 3341(grams for)1 403 2 1296 2160 t (Mexico 87115, October 1977.)3 1201 1 1296 2280 t 9 B f (Examples:)720 2640 w 10 R f ( n$ matrix A. The 1-)5 861(The following program fragment computes the 1-norm of an $m times)10 2883 2 1296 2640 t (norm is de\256ned by $max from 1)6 1288 1 1296 2760 t 10 S f (<)2584 2760 w 10 R f (=j)2639 2760 w 10 S f (<)2723 2760 w 10 R f (=n sum from i=1 to m)5 882 1 2778 2760 t 10 S f (\357)3685 2760 w 10 R f (a sub i,j\303\303)2 380 1 3759 2760 t 10 S f (\357)4139 2760 w 10 R f ($)4188 2760 w 8 CW f (ANORM1=0.0)1992 3100 w (DO 10 J=1,N)2 528 1 1992 3200 t (ANORMJ = SASUM\(M,A\(1,J\),1\))2 1248 1 2136 3300 t (IF \(ANORMJ .GT. ANORM1\) ANORM1 = ANORMJ)6 1872 1 2136 3400 t (10 CONTINUE)1 528 1 1848 3500 t 10 R f (The next program fragment computes the in\256nity norm of an $m times n$ matrix A, dimen-)15 3744 1 1296 3840 t ( in\256nity norm is de\256ned as $max from 1)8 1683(sioned \(IA,N\). The)2 779 2 1296 3960 t 10 S f (<)3758 3960 w 10 R f (=i)3813 3960 w 10 S f (<)3897 3960 w 10 R f (=m sum from j=1 to n)5 927 1 3952 3960 t 10 S f (\357)4913 3960 w 10 R f (a)4996 3960 w (sub i,j\303\303)1 311 1 1296 4080 t 10 S f (\357)1607 4080 w 10 R f ($)1656 4080 w 8 CW f (ANORM=0.0)2040 4420 w (DO 10 I=1,M)2 528 1 2040 4520 t (ANORMI = SASUM\(N,A\(I,1\),IA\))2 1296 1 2184 4620 t (IF \(ANORMI .GT. ANORM\) ANORM=ANORMI)4 1680 1 2184 4720 t (10 CONTINUE)1 528 1 1896 4820 t 10 R f (Linear Algebra)1 606 1 4794 7500 t (\320 5 \320)2 300 1 2730 7620 t (SASUM)5055 7740 w cleartomark showpage saveobj restore %%EndPage: 5 5 %%Page: 6 6 /saveobj save def mark 6 pagesetup 10 R f (-- --)1 5544 1 0 120 t (Linear Algebra)1 606 1 360 600 t 8 R f (PORT)4903 600 w 10 R f (library)5134 600 w ( 11, 1993)2 375(SASUM February)1 4665 2 360 840 t (SAXPY \320 add multiple of one vector to another)8 1959 1 2188 1320 t 9 B f (Purpose:)720 1680 w 10 R f (SAXPY scales a vector $x$ by a scalar $a$ and adds the result to a vector $y$.)16 3146 1 1296 1680 t 9 B f (Usage:)720 2040 w 10 R f (CALL SAXPY \(N, A, X, INCX, Y, INCY\))7 1731 1 1296 2040 t (N)1440 2280 w 14 S f (\256)1980 2300 w 10 R f (the number of affected elements in X and Y)8 1751 1 2196 2280 t (A)1440 2520 w 14 S f (\256)1980 2540 w 10 R f (the scalar variable)2 725 1 2196 2520 t (X)1440 2760 w 14 S f (\256)1980 2780 w 10 R f (the vector which is to be scaled)6 1253 1 2196 2760 t (INCX)1440 3000 w 14 S f (\256)1980 3020 w 10 R f (the elements are spaced at intervals of INCX in X:)9 2015 1 2196 3000 t (X\(1\), X\(1+INCX\), ..., X\(1+\(N)3 1217 1 2196 3120 t 10 S f (-)3413 3120 w 10 R f (1\))3468 3120 w 10 S f (*)3551 3120 w 10 R f (INCX\))3601 3120 w (Y)1440 3360 w 14 S f (\256)1980 3380 w 10 R f (the vector which is to be added)6 1242 1 2196 3360 t 14 S f (\254)1980 3620 w 10 R f (AX + Y)2 322 1 2196 3600 t (INCY)1440 3840 w 14 S f (\256)1980 3860 w 10 R f (the elements are space at intervals of INCY in Y:)9 1965 1 2196 3840 t (Y\(1\), Y\(1+INCY\), ..., Y\(1+\(N)3 1217 1 2196 3960 t 10 S f (-)3413 3960 w 10 R f (1\))3468 3960 w 10 S f (*)3551 3960 w 10 R f (INCY\))3601 3960 w 9 B f (Note:)720 4320 w 10 R f (If N=0, no action is performed.)5 1245 1 1296 4320 t 9 B f (Error situations:)1 648 1 720 4680 t 10 R f (\(All errors in this subprogram are fatal \320)7 1666 1 1512 4680 t (see)1512 4800 w 10 I f (Error Handling)1 631 1 1664 4800 t 10 R f (, Framework Chapter\))2 884 1 2295 4800 t (Number Error)1 1506 1 1800 5040 t (1 N)1 1108 1 1944 5280 t 10 S f (<)3052 5280 w 10 R f (0)3107 5280 w (2 INCX)1 1280 1 1944 5520 t 10 S f (\243)3224 5520 w 10 R f (0)3279 5520 w (3 INCY)1 1280 1 1944 5760 t 10 S f (\243)3224 5760 w 10 R f (0)3279 5760 w 9 B f (Double-precision version:)1 988 1 720 6120 t 10 R f (DAXPY with X and Y declared double precision)7 1960 1 1783 6120 t 9 B f (Complex version:)1 678 1 720 6480 t 10 R f (CAXPY with X and Y declared complex)6 1636 1 1473 6480 t (Linear Algebra)1 606 1 360 7500 t (\320 6 \320)2 300 1 2730 7620 t (SAXPY)360 7740 w cleartomark showpage saveobj restore %%EndPage: 6 6 %%Page: 7 7 /saveobj save def mark 7 pagesetup 10 R f (-- --)1 5544 1 0 120 t 8 R f (PORT)360 600 w 10 R f ( Algebra)1 346(library Linear)1 4463 2 591 600 t ( SAXPY)1 4305(February 11, 1993)2 735 2 360 840 t 9 B f (See also:)1 333 1 720 1320 t 10 R f (SSCAL)1296 1320 w 9 B f (Author:)720 1680 w 10 R f (Linda Kaufman)1 629 1 1296 1680 t 9 B f (Reference:)720 2040 w 10 R f ( J., Kincaid, D. R., and Krogh, F. T., Basic linear algebra subpro-)12 2643(Lawson, C. L., Hanson, R.)4 1074 2 1323 2040 t (grams for Fortran usage,)3 981 1 1296 2160 t 10 I f (ACM Trans. Math. Software 5)4 1212 1 2302 2160 t 10 R f (, 3 \(1979\), 308-323.)3 799 1 3514 2160 t 9 B f (Example:)720 2520 w 10 R f ( times n$ matrix)3 668(The following program fragment forms the product A$x$ where A is an $m)12 3076 2 1296 2520 t (and puts the result in an array Y:)7 1306 1 1296 2640 t 8 CW f (DO 10 I=1,M)2 528 1 2136 2980 t (Y\(I\)=0.0)2280 3080 w (10 CONTINUE)1 528 1 1992 3180 t (DO 20 I=1,N)2 528 1 2136 3280 t (CALL SAXPY\(M,X\(I\),A\(1,I\),1,Y,1\))1 1488 1 2280 3380 t (20 CONTINUE)1 528 1 1992 3480 t 10 R f (Matrix by vector multiplication is usually done using inner products as in the example in)14 3744 1 1296 3840 t ( above program fragment can be preferable because)7 2075(SDOT, but on a paged machine using the)7 1669 2 1296 3960 t ( refers to the array)4 762(FORTRAN stores two-dimensional arrays column-wise and this program)7 2982 2 1296 4080 t (A one column at a time.)5 960 1 1296 4200 t (Linear Algebra)1 606 1 4794 7500 t (\320 7 \320)2 300 1 2730 7620 t (SAXPY)5072 7740 w cleartomark showpage saveobj restore %%EndPage: 7 7 %%Page: 8 8 /saveobj save def mark 8 pagesetup 10 R f (-- --)1 5544 1 0 120 t (Linear Algebra)1 606 1 360 600 t 8 R f (PORT)4903 600 w 10 R f (library)5134 600 w ( 11, 1993)2 375(SAXPY February)1 4665 2 360 840 t (SDOT \320 dot product of two vectors)6 1465 1 2435 1320 t 9 B f (Purpose:)720 1680 w 10 R f ( from i=1 to n x sub i y)8 931(SDOT determines the inner product of two vectors $x$ and $y$, $sum)11 2813 2 1296 1680 t (sub i$)1 242 1 1296 1800 t 9 B f (Type:)720 2160 w 10 R f (Real function)1 541 1 1296 2160 t 9 B f (Usage:)720 2520 w 10 S f (<)1296 2520 w 10 R f (answer)1351 2520 w 10 S f (>)1633 2520 w 10 R f (= SDOT\(N, X, INCX, Y, INCY\))5 1312 1 1713 2520 t (N)1440 2760 w 14 S f (\256)1980 2780 w 10 R f (the number of elements to be summed)6 1526 1 2196 2760 t (X)1440 3000 w 14 S f (\256)1980 3020 w 10 R f (the \256rst vector)2 577 1 2196 3000 t (INCX)1440 3240 w 14 S f (\256)1980 3260 w 10 R f (the elements are spaced at intervals of INCX in X:)9 2015 1 2196 3240 t (X\(1\), X\(1+INCX\), ..., X\(1+\(N)3 1217 1 2196 3360 t 10 S f (-)3413 3360 w 10 R f (1\))3468 3360 w 10 S f (*)3551 3360 w 10 R f (INCX\))3601 3360 w (Y)1440 3600 w 14 S f (\256)1980 3620 w 10 R f (the second vector)2 698 1 2196 3600 t (INCY)1440 3840 w 14 S f (\256)1980 3860 w 10 R f (the elements are spaced at intervals of INCY in Y:)9 2015 1 2196 3840 t (Y\(1\), Y\(1+INCY\), ..., Y\(1+\(N)3 1217 1 2196 3960 t 10 S f (-)3413 3960 w 10 R f (1\))3468 3960 w 10 S f (*)3551 3960 w 10 R f (INCY\))3601 3960 w 10 S f (<)1440 4200 w 10 R f (answer)1495 4200 w 10 S f (>)1777 4200 w 14 S f (\254)1980 4220 w 10 R f (X\(1\))2196 4200 w 10 S f (*)2384 4200 w 10 R f (Y\(1\)+X\(1+INCX\))2434 4200 w 10 S f (*)3166 4200 w 10 R f (Y\(1+INCY\)+...+)3216 4200 w (X\(1+\(N)2196 4320 w 10 S f (-)2512 4320 w 10 R f (1\))2567 4320 w 10 S f (*)2650 4320 w 10 R f (INCX\))2700 4320 w 10 S f (*)2977 4320 w 10 R f (Y\(1+\(N)3027 4320 w 10 S f (-)3343 4320 w 10 R f (1\))3398 4320 w 10 S f (*)3481 4320 w 10 R f (INCY\))3531 4320 w 9 B f (Note 1:)1 278 1 720 4680 t 10 R f ( can use SDOT to deal with the rows of a)10 1657(Since Fortran stores arrays in column-wise order we)7 2087 2 1296 4680 t (2-dimensional array as in the example below.)6 1816 1 1296 4800 t 9 B f (Note 2:)1 278 1 720 5160 t 10 R f (If N=0, SDOT=0.0 is returned.)4 1235 1 1296 5160 t 9 B f (Note 3:)1 278 1 720 5520 t 10 R f (No attempt is made to prevent under\257ow or over\257ow in the subroutine.)11 2847 1 1296 5520 t (Linear Algebra)1 606 1 360 7500 t (\320 8 \320)2 300 1 2730 7620 t (SDOT)360 7740 w cleartomark showpage saveobj restore %%EndPage: 8 8 %%Page: 9 9 /saveobj save def mark 9 pagesetup 10 R f (-- --)1 5544 1 0 120 t 8 R f (PORT)360 600 w 10 R f ( Algebra)1 346(library Linear)1 4463 2 591 600 t ( SDOT)1 4305(February 11, 1993)2 735 2 360 840 t 9 B f (Error situations:)1 648 1 720 1320 t 10 R f (\(All errors in this subprogram are fatal \320)7 1666 1 1512 1320 t (see)1512 1440 w 10 I f (Error Handling)1 631 1 1664 1440 t 10 R f (, Framework Chapter\))2 884 1 2295 1440 t (Number Error)1 1506 1 1800 1680 t (1 N)1 1108 1 1944 1920 t 10 S f (<)3052 1920 w 10 R f (0)3107 1920 w (2 INCX)1 1280 1 1944 2160 t 10 S f (\243)3224 2160 w 10 R f (0)3279 2160 w (3 INCY)1 1280 1 1944 2400 t 10 S f (\243)3224 2400 w 10 R f (0)3279 2400 w 9 B f (Double-precision version:)1 988 1 720 2760 t 10 R f (DDOT with X and Y declared double precision)7 1893 1 1783 2760 t 9 B f (Complex versions:)1 713 1 720 3120 t 10 R f ( complex.)1 403( with X and Y declared)5 968( CDOTC)1 447(CDOTU with X and Y declared complex.)6 1714 4 1508 3120 t ( conjugate of the elements of X)6 1271( the)1 175( bar sub i y sub i$, i.e.)7 904( x)1 131( from i=1 to n)4 568( sum)1 221(CDOTC $=)1 474 7 1296 3240 t (are used.)1 354 1 1296 3360 t 9 B f (Author:)720 3720 w 10 R f (Linda Kaufman)1 629 1 1296 3720 t 9 B f (Reference:)720 4080 w 10 R f ( J., Kincaid, D. R., and Krogh, F. T., Basic linear algebra subpro-)12 2643(Lawson, C. L., Hanson, R.)4 1074 2 1323 4080 t (grams for Fortran usage,)3 981 1 1296 4200 t 10 I f (ACM Trans. Math. Software 5)4 1212 1 2302 4200 t 10 R f (, 3 \(1979\), 308-323.)3 799 1 3514 4200 t 9 B f (Example:)720 4560 w 10 R f ( is an $m times n$)5 741(The following program fragment forms the product $A bold x$ where $A$)11 3003 2 1296 4560 t (matrix dimensioned \(IA,N\), and puts the result in an array Y:)10 2446 1 1296 4680 t 8 CW f (DO 10 I=1,M)2 528 1 2136 5020 t (Y\(I\)=SDOT\(N,A\(I,1\),IA,X,1\))2280 5120 w (10 CONTINUE)1 528 1 1992 5220 t 10 R f ( might re-)2 398(Because of page faults, the execution of this program fragment on certain machines)12 3346 2 1296 5580 t ( program fragment given in the example in SAXPY,)8 2121( The)1 209( amount of time.)3 673(quire an excessive)2 741 4 1296 5700 t (which accesses the elements of A one column at a time, would be preferable in this case.)16 3542 1 1296 5820 t (Linear Algebra)1 606 1 4794 7500 t (\320 9 \320)2 300 1 2730 7620 t (SDOT)5139 7740 w cleartomark showpage saveobj restore %%EndPage: 9 9 %%Page: 10 10 /saveobj save def mark 10 pagesetup 10 R f (-- --)1 5544 1 0 120 t (Linear Algebra)1 606 1 360 600 t 8 R f (PORT)4903 600 w 10 R f (library)5134 600 w ( 11, 1993)2 375(SDOT February)1 4665 2 360 840 t (SSCAL \320 scale a vector)4 1004 1 2666 1320 t 9 B f (Purpose:)720 1680 w 10 R f (SSCAL multiplies a vector $x$ by a scalar A)8 1804 1 1296 1680 t 9 B f (Usage:)720 2040 w 10 R f ( A, X, INCX\))3 546(CALL SSCAL\(N,)1 753 2 1296 2040 t (N)1440 2280 w 14 S f (\256)1980 2300 w 10 R f (the number of affected elements in X)6 1485 1 2196 2280 t (A)1440 2520 w 14 S f (\256)1980 2540 w 10 R f (the scaling factor)2 687 1 2196 2520 t (X)1440 2760 w 14 S f (\256)1980 2780 w 10 R f (the vector to be scaled)4 892 1 2196 2760 t 14 S f (\254)1980 3020 w 10 R f (the scaled vector)2 670 1 2196 3000 t (INCX)1440 3240 w 14 S f (\256)1980 3260 w 10 R f (the elements are spaced at intervals of INCX in X:)9 2015 1 2196 3240 t (X\(1\), X\(1+INCX\), ..., X\(1+\(N)3 1217 1 2196 3360 t 10 S f (-)3413 3360 w 10 R f (1\))3468 3360 w 10 S f (*)3551 3360 w 10 R f (INCX\))3601 3360 w 9 B f (Note 1:)1 278 1 720 3720 t 10 R f (If N=0, no action is performed.)5 1245 1 1296 3720 t 9 B f (Note 2:)1 278 1 720 4080 t 10 R f ( the rows of)3 477(Since Fortran stores arrays in column-wise order, we can use SSCAL to deal with)13 3267 2 1296 4080 t (a 2-dimensional array as in the example below.)7 1885 1 1296 4200 t 9 B f (Error situations:)1 648 1 720 4560 t 10 R f (\(All errors in this subprogram are fatal \320)7 1666 1 1512 4560 t (see)1512 4680 w 10 I f (Error Handling)1 631 1 1664 4680 t 10 R f (, Framework Chapter\))2 884 1 2295 4680 t (Number Error)1 1506 1 1800 4920 t (1 N)1 1108 1 1944 5160 t 10 S f (<)3052 5160 w 10 R f (0)3107 5160 w (2 INCX)1 1280 1 1944 5400 t 10 S f (\243)3224 5400 w 10 R f (0)3279 5400 w 9 B f (Double-precision version:)1 988 1 720 5760 t 10 R f (DSCAL with X and A declared double precision)7 1944 1 1800 5760 t 9 B f (Complex versions:)1 713 1 720 6120 t 10 R f (CSCAL with X and A declared complex)6 1620 1 1508 6120 t (CSSCAL with X declared complex and A declared real)8 2212 1 1418 6240 t 9 B f (See also:)1 333 1 720 6600 t 10 R f (SAXPY)1296 6600 w (Linear Algebra)1 606 1 360 7500 t (\320 10 \320)2 350 1 2705 7620 t (SSCAL)360 7740 w cleartomark showpage saveobj restore %%EndPage: 10 10 %%Page: 11 11 /saveobj save def mark 11 pagesetup 10 R f (-- --)1 5544 1 0 120 t 8 R f (PORT)360 600 w 10 R f ( Algebra)1 346(library Linear)1 4463 2 591 600 t ( SSCAL)1 4305(February 11, 1993)2 735 2 360 840 t 9 B f (Author:)720 1320 w 10 R f (Linda Kaufman)1 629 1 1296 1320 t 9 B f (Reference:)720 1680 w 10 R f ( J., Kincaid, D. R., and Krogh, F. T., Basic linear algebra subpro-)12 2643(Lawson, C. L., Hanson, R.)4 1074 2 1323 1680 t (grams for Fortran usage,)3 981 1 1296 1800 t 10 I f (ACM Trans. Math. Software 5)4 1212 1 2302 1800 t 10 R f (, 3 \(1979\), 308-323.)3 799 1 3514 1800 t 9 B f (Example:)720 2160 w 10 R f ( that)1 180(In this example the rows of an $m times n$ matrix A, dimensioned \(IA,N\) are scaled so)16 3564 2 1296 2160 t ( SASUM returns the)3 822( function)1 360( The)1 207(the sum of the modulus of the elements in each row is 1.0.)12 2355 4 1296 2280 t (sum of the absolute values of the elements of a vector.)10 2171 1 1296 2400 t 8 CW f (DO 10 J=1,M)2 528 1 2472 2740 t (SC=1.0/SASUM\(N,A\(J,1\),IA\))2616 2840 w (CALL SSCAL\(N,SC,A\(J,1\),IA\))1 1248 1 2616 2940 t (10 CONTINUE)1 528 1 2328 3040 t 10 R f (Linear Algebra)1 606 1 4794 7500 t (\320 11 \320)2 350 1 2705 7620 t (SSCAL)5088 7740 w cleartomark showpage saveobj restore %%EndPage: 11 11 %%Page: 12 12 /saveobj save def mark 12 pagesetup 10 R f (-- --)1 5544 1 0 120 t (Linear Algebra)1 606 1 360 600 t 8 R f (PORT)4903 600 w 10 R f (library)5134 600 w ( 11, 1993)2 375(SSCAL February)1 4665 2 360 840 t (SSWAP \320 interchange two vectors)4 1437 1 2449 1320 t 9 B f (Purpose:)720 1680 w 10 R f (SSWAP interchanges two vectors)3 1351 1 1296 1680 t 9 B f (Usage:)720 2040 w 10 R f (CALL SSWAP\(N, X, INCX, Y, INCY\))5 1590 1 1296 2040 t (N)1440 2280 w 14 S f (\256)1980 2300 w 10 R f (the number of affected elements in X and Y)8 1751 1 2196 2280 t (X)1440 2520 w 14 S f (\256)1980 2540 w 10 R f (the \256rst vector)2 577 1 2196 2520 t 14 S f (\254)1980 2780 w 10 R f (the vector Y)2 493 1 2196 2760 t (INCX)1440 3000 w 14 S f (\256)1980 3020 w 10 R f (the elements are spaced at intervals of INCX in X:)9 2015 1 2196 3000 t (X\(1\), X\(1+INCX\), ..., X\(1+\(N)3 1217 1 2196 3120 t 10 S f (-)3413 3120 w 10 R f (1\)INCX\))3468 3120 w (Y)1440 3360 w 14 S f (\256)1980 3380 w 10 R f (the second vector)2 698 1 2196 3360 t 14 S f (\254)1980 3620 w 10 R f (the vector X)2 493 1 2196 3600 t (INCY)1440 3840 w 14 S f (\256)1980 3860 w 10 R f (the elements are spaced at intervals of INCY in Y:)9 2015 1 2196 3840 t (Y\(1\), Y\(1+INCY\), ..., Y\(1+\(N)3 1217 1 2196 3960 t 10 S f (-)3413 3960 w 10 R f (1\)*INCY\))3468 3960 w 9 B f (Note 1:)1 278 1 720 4320 t 10 R f (If N=0, no action is performed.)5 1245 1 1296 4320 t 9 B f (Note 2:)1 278 1 720 4680 t 10 R f ( stores arrays in column-wise order, we can use SSWAP to deal with the rows)14 3198(Since Fortran)1 546 2 1296 4680 t (of a 2-dimensional array as in the example below.)8 1993 1 1296 4800 t 9 B f (Error situations:)1 648 1 720 5160 t 10 R f (\(All errors in this subprogram are fatal \320)7 1666 1 1512 5160 t (see)1512 5280 w 10 I f (Error Handling)1 631 1 1664 5280 t 10 R f (, Framework Chapter\))2 884 1 2295 5280 t (Number Error)1 1506 1 1800 5520 t (1 N)1 1108 1 1944 5760 t 10 S f (<)3052 5760 w 10 R f (0)3107 5760 w (2 INCX)1 1280 1 1944 6000 t 10 S f (\243)3224 6000 w 10 R f (0)3279 6000 w (3 INCY)1 1255 1 1944 6240 t 10 S f (\243)3199 6240 w 10 R f (0)3254 6240 w 9 B f (Double-precision version:)1 988 1 720 6600 t 10 R f (DSWAP with X and Y declared double precision)7 1966 1 1800 6600 t (Linear Algebra)1 606 1 360 7500 t (\320 12 \320)2 350 1 2705 7620 t (SSWAP)360 7740 w cleartomark showpage saveobj restore %%EndPage: 12 12 %%Page: 13 13 /saveobj save def mark 13 pagesetup 10 R f (-- --)1 5544 1 0 120 t 8 R f (PORT)360 600 w 10 R f ( Algebra)1 346(library Linear)1 4463 2 591 600 t ( SSWAP)1 4305(February 11, 1993)2 735 2 360 840 t 9 B f (Complex version:)1 678 1 720 1320 t 10 R f (CSWAP with X and Y declared complex)6 1642 1 1473 1320 t 9 B f (See also:)1 333 1 720 1680 t 10 R f (MOVExx \(Utility Chapter\))2 1088 1 1296 1680 t 9 B f (Author:)720 2040 w 10 R f (Linda Kaufman)1 629 1 1296 2040 t 9 B f (Reference:)720 2400 w 10 R f ( J., Kincaid, D. R., and Krogh, F. T., Basic linear algebra subpro-)12 2643(Lawson, C. L., Hanson, R.)4 1074 2 1323 2400 t (grams for Fortran usage,)3 981 1 1296 2520 t 10 I f (ACM Trans. Math. Software 5)4 1212 1 2302 2520 t 10 R f (, 3 \(1979\), 308-323.)3 799 1 3514 2520 t 9 B f (Example:)720 2880 w 10 R f ( \(IA,N\) are permuted so)4 987(In this example the rows of an $m times n$ matrix A, dimensioned)12 2757 2 1296 2880 t ( A is the largest in modulus of the elements in the \256rst column of A.)15 2766(that the \(1,1\) element of)4 978 2 1296 3000 t ( vector having maximum)3 1038(The subroutine ISAMAX computes the index of the element of a)10 2706 2 1296 3120 t (modulus.)1296 3240 w 8 CW f (J=ISAMAX\(M,A,1\))2328 3580 w (CALL SSWAP\(N,A,IA,A\(J,1\),IA\))1 1344 1 2328 3680 t 10 R f (Linear Algebra)1 606 1 4794 7500 t (\320 13 \320)2 350 1 2705 7620 t (SSWAP)5066 7740 w (-- --)1 5544 1 0 8030 t cleartomark showpage saveobj restore %%EndPage: 13 13 %%Trailer done %%Pages: 13 %%DocumentFonts: Courier Times-Bold Times-Italic Times-Roman Symbol