1\par 2\subsection{{\tt ZV} : {\tt double complex } vector methods} 3\label{subsection:Utilities:proto:ZV} 4\par 5A double precision complex vector of length {\tt n} 6is simply a double precision vector of length {\tt 2n}. 7There is a separate {\tt ZVinit()} allocator and initializer method, 8since it requires a real and imaginary part to fill the vector. 9However, there is no {\tt ZVinit2()} method (which allocates 10without initializing the entries) nor a {\tt ZVfree()} method 11to free the entries; 12the {\tt DVinit2()} and {\tt DVfree()} methods can be used. 13Similarly, there is no {\tt ZVfscanf()} method, 14instead the {\tt DVfscanf()} method can be used. 15\par 16%======================================================================= 17\begin{enumerate} 18%----------------------------------------------------------------------- 19\item 20\begin{verbatim} 21double * ZVinit ( int n, double real, double imag ) ; 22\end{verbatim} 23\index{ZVinit@{\tt ZVinit()}} 24This is the allocator and initializer method 25for {\tt double complex} vectors. 26Storage for an array with size {\tt n} is found and each 27entry is filled with {\tt (real,imag)}. 28A pointer to the array is returned. 29%----------------------------------------------------------------------- 30\item 31\begin{verbatim} 32void ZVfprintf ( FILE *fp, int n, double y[] ) ; 33\end{verbatim} 34\index{ZVfprintf@{\tt ZVfprintf()}} 35This method prints {\tt n} entries in {\tt y[]} to file {\tt fp}. 36The format is new line followed by 37{\tt "< \%12.4e, \%12.4e >"} format. 38%----------------------------------------------------------------------- 39\item 40\begin{verbatim} 41double Zabs ( double real, double imag ) ; 42\end{verbatim} 43\index{Zabs@{\tt Zabs()}} 44This method returns the magnitude of {\tt (real,imag)}. 45%----------------------------------------------------------------------- 46\item 47\begin{verbatim} 48int Zrecip ( double areal, double aimag, double *pbreal, double *pbimag ) ; 49\end{verbatim} 50\index{Zrecip@{\tt Zrecip()}} 51This method fills {\tt *pbreal} and {\tt *pbimag} with the real and 52imaginary parts of the reciprocal of {\tt (areal,aimag)}. 53The return value is {\tt 0} if {\tt areal} and {\tt aimag} are zero, 54otherwise the return value is {\tt 1}. 55%----------------------------------------------------------------------- 56\item 57\begin{verbatim} 58int Zrecip2 ( double areal, double aimag, double breal, double bimag, 59 double creal, double cimag, double dreal, double dimag, 60 double *pereal, double *peimag, double *pfreal, double *pfimag, 61 double *pgreal, double *pgimag, double *phreal, double *phimag ) ; 62\end{verbatim} 63\index{Zrecip2@{\tt Zrecip2()}} 64This method computes 65$ 66\displaystyle 67\left \lbrack \begin{array}{cc} 68e & f \\ 69g & h 70\end{array} \right \rbrack 71= 72\left \lbrack \begin{array}{cc} 73a & b \\ 74c & d 75\end{array} \right \rbrack^{-1} 76$. 77If {\tt pereal} is not {\tt NULL}, then {\tt *pereal} is loaded with 78the real part of $e$. 79If {\tt peimag} is not {\tt NULL}, then {\tt *peimag} is loaded with 80the imaginary part of $e$. 81Similarly for $f$, $g$ and $h$. 82The return value is {\tt 0} if $2 \times 2$ matrix is singular, 83otherwise the return value is {\tt 1}. 84%----------------------------------------------------------------------- 85\item 86\begin{verbatim} 87void ZVaxpy ( int n, double y[], double areal, double aimag, double x[] ) ; 88\end{verbatim} 89\index{ZVaxpy@{\tt ZVaxpy()}} 90This method adds a scaled multiple of {\tt n} entries from {\tt x[]} 91into {\tt y[]}, 92i.e., 93{\tt y[i] += (areal,aimag) * x[i]} for {\tt 0 <= i < n}. 94%----------------------------------------------------------------------- 95\item 96\begin{verbatim} 97void ZVaxpy2 ( int n, double z[], double areal, double aimag, 98 double x[], double breal, double bimag, double y[] ) ; 99\end{verbatim} 100\index{ZVaxpy@{\tt ZVaxpy()}} 101This method adds a scaled multiple of two vectors {\tt x[]} 102and {\tt y[]} to another vector {\tt z[]}, i.e., 103i.e., 104{\tt z[i] += (areal,aimag) * x[i] + (breal,bimag) * y[i]} for {\tt 0 <= i < n}. 105%----------------------------------------------------------------------- 106\item 107\begin{verbatim} 108void ZVaxpy33 ( int n, double y0[], double y1[], double y2[], 109 double alpha[], double x0[], double x1[], double x2[] ) ; 110\end{verbatim} 111\index{ZVaxpy33@{\tt ZVaxpy33()}} 112This method computes the following. 113\begin{verbatim} 114y0[] = y0[] + alpha[0:1] * x0[] + alpha[2:3] * x1[] + alpha[4:5] * x2[] 115y1[] = y1[] + alpha[6:7] * x0[] + alpha[8:9] * x1[] + alpha[10:11] * x2[] 116y2[] = y2[] + alpha[12:13] * x0[] + alpha[14:15] * x1[] + alpha[16:17] * x2[] 117\end{verbatim} 118%----------------------------------------------------------------------- 119\item 120\begin{verbatim} 121void ZVaxpy32 ( int n, double y0[], double y1[], double y2[], 122 double alpha[], double x0[], double x1[] ) ; 123\end{verbatim} 124\index{ZVaxpy32@{\tt ZVaxpy32()}} 125This method computes the following. 126\begin{verbatim} 127y0[] = y0[] + alpha[0:1] * x0[] + alpha[2:3] * x1[] 128y1[] = y1[] + alpha[4:5] * x0[] + alpha[6:7] * x1[] 129y2[] = y2[] + alpha[8:9] * x0[] + alpha[10:11] * x1[] 130\end{verbatim} 131%----------------------------------------------------------------------- 132\item 133\begin{verbatim} 134void ZVaxpy31 ( int n, double y0[], double y1[], double y2[], 135 double alpha[], double x0[] ) ; 136\end{verbatim} 137\index{ZVaxpy31@{\tt ZVaxpy31()}} 138This method computes the following. 139\begin{verbatim} 140y0[] = y0[] + alpha[0:1] * x0[] 141y1[] = y1[] + alpha[2:3] * x0[] 142y2[] = y2[] + alpha[4:5] * x0[] 143\end{verbatim} 144%----------------------------------------------------------------------- 145\item 146\begin{verbatim} 147void ZVaxpy23 ( int n, double y0[], double y1[], 148 double alpha[], double x0[], double x1[], double x2[] ) ; 149\end{verbatim} 150\index{ZVaxpy23@{\tt ZVaxpy23()}} 151This method computes the following. 152\begin{verbatim} 153y0[] = y0[] + alpha[0:1] * x0[] + alpha[2:3] * x1[] + alpha[4:5] * x2[] 154y1[] = y1[] + alpha[6:7] * x0[] + alpha[8:9] * x1[] + alpha[10:11] * x2[] 155\end{verbatim} 156%----------------------------------------------------------------------- 157\item 158\begin{verbatim} 159void ZVaxpy22 ( int n, double y0[], double y1[], 160 double alpha[], double x0[], double x1[] ) ; 161\end{verbatim} 162\index{ZVaxpy22@{\tt ZVaxpy22()}} 163This method computes the following. 164\begin{verbatim} 165y0[] = y0[] + alpha[0:1] * x0[] + alpha[2:3] * x1[] 166y1[] = y1[] + alpha[4:5] * x0[] + alpha[6:7] * x1[] 167\end{verbatim} 168%----------------------------------------------------------------------- 169\item 170\begin{verbatim} 171void ZVaxpy21 ( int n, double y0[], double y1[], 172 double alpha[], double x0[] ) ; 173\end{verbatim} 174\index{ZVaxpy21@{\tt ZVaxpy21()}} 175This method computes the following. 176\begin{verbatim} 177y0[] = y0[] + alpha[0:1] * x0[] 178y1[] = y1[] + alpha[2:3] * x0[] 179\end{verbatim} 180%----------------------------------------------------------------------- 181\item 182\begin{verbatim} 183void ZVaxpy13 ( int n, double y0[], 184 double alpha[], double x0[], double x1[], double x2[] ) ; 185\end{verbatim} 186\index{ZVaxpy13@{\tt ZVaxpy13()}} 187This method computes the following. 188\begin{verbatim} 189y0[] = y0[] + alpha[0:1] * x0[] + alpha[2:3] * x1[] + alpha[4:5] * x2[] 190\end{verbatim} 191%----------------------------------------------------------------------- 192\item 193\begin{verbatim} 194void ZVaxpy12 ( int n, double y0[], double alpha[], double x0[], double x1[] ) ; 195\end{verbatim} 196\index{ZVaxpy12@{\tt ZVaxpy12()}} 197This method computes the following. 198\begin{verbatim} 199y0[] = y0[] + alpha[0:1] * x0[] + alpha[2:3] * x1[] 200\end{verbatim} 201%----------------------------------------------------------------------- 202\item 203\begin{verbatim} 204void ZVaxpy11 ( int n, double y0[], double alpha[], double x0[] ) ; 205\end{verbatim} 206\index{ZVaxpy11@{\tt ZVaxpy11()}} 207This method computes the following. 208\begin{verbatim} 209y0[] = y0[] + alpha[0:1] * x0[] 210\end{verbatim} 211%----------------------------------------------------------------------- 212\item 213\begin{verbatim} 214void ZVcopy ( int n, double y[], double x[] ) ; 215\end{verbatim} 216\index{ZVcopy@{\tt ZVcopy()}} 217This method copies {\tt n} entries from {\tt x[]} to {\tt y[]}, 218i.e., 219{\tt y[i] = x[i]} for {\tt 0 <= i < n}. 220%----------------------------------------------------------------------- 221\item 222\begin{verbatim} 223void ZVdotU ( int n, double y[], double x[], double *prdot, double *pidot ) ; 224\end{verbatim} 225\index{ZVdotU@{\tt ZVdotU()}} 226This method fills {\tt *prdot} and {\tt *pidot} with the real and 227imaginary part of ${\tt y}^T{\tt x}$, 228the dot product of the vector {\tt x[]} and {\tt y[]}. 229%----------------------------------------------------------------------- 230\item 231\begin{verbatim} 232void ZVdotC ( int n, double y[], double x[], double *prdot, double *pidot ) ; 233\end{verbatim} 234\index{ZVdotC@{\tt ZVdotC()}} 235This method fills {\tt *prdot} and {\tt *pidot} with the real and 236imaginary part of ${\tt y}^H{\tt x}$, 237the dot product of the vector {\tt x[]} and {\tt y[]}. 238%----------------------------------------------------------------------- 239\item 240\begin{verbatim} 241void ZVdotiU ( int n, double y[], int index[], double x[], 242 double *prdot, double *pidot ) ; 243\end{verbatim} 244\index{ZVdotiU@{\tt ZVdotiU()}} 245This method fills {\tt *prdot} and {\tt *pidot} with the real and 246imaginary parts of the indexed dot product 247$\displaystyle \sum_{{\tt i=0}}^{{\tt n-1}} {\tt y[index[i]] * x[i]}$. 248%----------------------------------------------------------------------- 249\item 250\begin{verbatim} 251void ZVdotiC ( int n, double y[], int index[], double x[], 252 double *prdot, double *pidot ) ; 253\end{verbatim} 254\index{ZVdotiC@{\tt ZVdotiC()}} 255This method fills {\tt *prdot} and {\tt *pidot} with the real and 256imaginary parts of the indexed dot product 257$\displaystyle \sum_{{\tt i=0}}^{{\tt n-1}} 258\overline{\tt y[index[i]]} * {\tt x[i]}$. 259%----------------------------------------------------------------------- 260\item 261\begin{verbatim} 262int ZVdotU33 ( int n, double row0[], double row1[], double row2[], 263 double col0[], double col1[], double col2[], double sums[] ) ; 264\end{verbatim} 265\index{ZVdotU33@{\tt ZVdotU33()}} 266This method computes nine dot products. 267\par 268\begin{tabular}{ll} 269$\displaystyle{\tt sums[0;1]} 270 = \sum_{\tt i = 0}^{\tt n-1} {\tt row0[i] * col0[i]}$ & 271$\displaystyle{\tt sums[2:3]} 272 = \sum_{\tt i = 0}^{\tt n-1} {\tt row0[i] * col1[i]}$ \\ 273$\displaystyle{\tt sums[4:5]} 274 = \sum_{\tt i = 0}^{\tt n-1} {\tt row0[i] * col2[i]}$ & 275$\displaystyle{\tt sums[6:7]} 276 = \sum_{\tt i = 0}^{\tt n-1} {\tt row1[i] * col0[i]}$ \\ 277$\displaystyle{\tt sums[8:9]} 278 = \sum_{\tt i = 0}^{\tt n-1} {\tt row1[i] * col1[i]}$ & 279$\displaystyle{\tt sums[10:11]} 280 = \sum_{\tt i = 0}^{\tt n-1} {\tt row1[i] * col2[i]}$ \\ 281$\displaystyle{\tt sums[12:13]} 282 = \sum_{\tt i = 0}^{\tt n-1} {\tt row2[i] * col0[i]}$ & 283$\displaystyle{\tt sums[14:15]} 284 = \sum_{\tt i = 0}^{\tt n-1} {\tt row2[i] * col1[i]}$ \\ 285$\displaystyle{\tt sums[16:17]} 286 = \sum_{\tt i = 0}^{\tt n-1} {\tt row2[i] * col2[i]}$ 287\end{tabular} 288%----------------------------------------------------------------------- 289\item 290\begin{verbatim} 291int ZVdotU32 ( int n, double row0[], double row1[], double row2[], 292 double col0[], double col1[], double sums[] ) ; 293\end{verbatim} 294\index{ZVdotU32@{\tt ZVdotU32()}} 295This method computes six dot products. 296\par 297\begin{tabular}{ll} 298$\displaystyle{\tt sums[0:1]} 299 = \sum_{\tt i = 0}^{\tt n-1} {\tt row0[i] * col0[i]}$ & 300$\displaystyle{\tt sums[2:3]} 301 = \sum_{\tt i = 0}^{\tt n-1} {\tt row0[i] * col1[i]}$ \\ 302$\displaystyle{\tt sums[4:5]} 303 = \sum_{\tt i = 0}^{\tt n-1} {\tt row1[i] * col0[i]}$ & 304$\displaystyle{\tt sums[6:7]} 305 = \sum_{\tt i = 0}^{\tt n-1} {\tt row1[i] * col1[i]}$ \\ 306$\displaystyle{\tt sums[8:9]} 307 = \sum_{\tt i = 0}^{\tt n-1} {\tt row2[i] * col0[i]}$ & 308$\displaystyle{\tt sums[10:11]} 309 = \sum_{\tt i = 0}^{\tt n-1} {\tt row2[i] * col1[i]}$ 310\end{tabular} 311%----------------------------------------------------------------------- 312\item 313\begin{verbatim} 314int ZVdotU31 ( int n, double row0[], double row1[], double row2[], 315 double col0[], double sums[] ) ; 316\end{verbatim} 317\index{ZVdotU31@{\tt ZVdotU31()}} 318This method computes three dot products. 319\par 320\begin{tabular}{l} 321$\displaystyle{\tt sums[0:1]} 322 = \sum_{\tt i = 0}^{\tt n-1} {\tt row0[i] * col0[i]}$ \\ 323$\displaystyle{\tt sums[2:3]} 324 = \sum_{\tt i = 0}^{\tt n-1} {\tt row1[i] * col0[i]}$ \\ 325$\displaystyle{\tt sums[4:5]} 326 = \sum_{\tt i = 0}^{\tt n-1} {\tt row2[i] * col0[i]}$ 327\end{tabular} 328%----------------------------------------------------------------------- 329\item 330\begin{verbatim} 331int ZVdotU23 ( int n, double row0[], double row1[], 332 double col0[], double col1[], double col2[], double sums[] ) ; 333\end{verbatim} 334\index{ZVdotU23@{\tt ZVdotU23()}} 335This method computes six dot products. 336\par 337\begin{tabular}{ll} 338$\displaystyle{\tt sums[0:1]} 339 = \sum_{\tt i = 0}^{\tt n-1} {\tt row0[i] * col0[i]}$ & 340$\displaystyle{\tt sums[2:3]} 341 = \sum_{\tt i = 0}^{\tt n-1} {\tt row0[i] * col1[i]}$ \\ 342$\displaystyle{\tt sums[4:5]} 343 = \sum_{\tt i = 0}^{\tt n-1} {\tt row0[i] * col2[i]}$ & 344$\displaystyle{\tt sums[6:7]} 345 = \sum_{\tt i = 0}^{\tt n-1} {\tt row1[i] * col0[i]}$ \\ 346$\displaystyle{\tt sums[8:9]} 347 = \sum_{\tt i = 0}^{\tt n-1} {\tt row1[i] * col1[i]}$ & 348$\displaystyle{\tt sums[10:11]} 349 = \sum_{\tt i = 0}^{\tt n-1} {\tt row1[i] * col2[i]}$ 350\end{tabular} 351%----------------------------------------------------------------------- 352\item 353\begin{verbatim} 354int ZVdotU22 ( int n, double row0[], double row1[], 355 double col0[], double col1[], double sums[] ) ; 356\end{verbatim} 357\index{ZVdotU22@{\tt ZVdotU22()}} 358This method computes four dot products. 359\par 360\begin{tabular}{ll} 361$\displaystyle{\tt sums[0:1]} 362 = \sum_{\tt i = 0}^{\tt n-1} {\tt row0[i] * col0[i]}$ & 363$\displaystyle{\tt sums[2:3]} 364 = \sum_{\tt i = 0}^{\tt n-1} {\tt row0[i] * col1[i]}$ \\ 365$\displaystyle{\tt sums[4:5]} 366 = \sum_{\tt i = 0}^{\tt n-1} {\tt row1[i] * col0[i]}$ & 367$\displaystyle{\tt sums[6:7]} 368 = \sum_{\tt i = 0}^{\tt n-1} {\tt row1[i] * col1[i]}$ 369\end{tabular} 370%----------------------------------------------------------------------- 371\item 372\begin{verbatim} 373int ZVdotU21 ( int n, double row0[], double row1[], 374 double col0[], double sums[] ) ; 375\end{verbatim} 376\index{ZVdotU21@{\tt ZVdotU21()}} 377This method computes two dot products. 378\par 379\begin{tabular}{l} 380$\displaystyle{\tt sums[0:1]} 381 = \sum_{\tt i = 0}^{\tt n-1} {\tt row0[i] * col0[i]}$ \\ 382$\displaystyle{\tt sums[2:3]} 383 = \sum_{\tt i = 0}^{\tt n-1} {\tt row1[i] * col0[i]}$ 384\end{tabular} 385%----------------------------------------------------------------------- 386\item 387\begin{verbatim} 388int ZVdotU13 ( int n, double row0[], 389 double col0[], double col1[], double col2[], double sums[] ) ; 390\end{verbatim} 391\index{ZVdotU13@{\tt ZVdotU13()}} 392This method computes six dot products. 393\par 394\begin{tabular}{ll} 395$\displaystyle{\tt sums[0:1]} 396 = \sum_{\tt i = 0}^{\tt n-1} {\tt row0[i] * col0[i]}$ & 397$\displaystyle{\tt sums[2:3]} 398 = \sum_{\tt i = 0}^{\tt n-1} {\tt row0[i] * col1[i]}$ \\ 399$\displaystyle{\tt sums[4:5]} 400 = \sum_{\tt i = 0}^{\tt n-1} {\tt row0[i] * col2[i]}$ 401\end{tabular} 402%----------------------------------------------------------------------- 403\item 404\begin{verbatim} 405int ZVdotU12 ( int n, double row0[], double row1[], 406 double col0[], double col1[], double sums[] ) ; 407\end{verbatim} 408\index{ZVdotU12@{\tt ZVdotU12()}} 409This method computes two dot products. 410\par 411\begin{tabular}{ll} 412$\displaystyle{\tt sums[0:1]} 413 = \sum_{\tt i = 0}^{\tt n-1} {\tt row0[i] * col0[i]}$ & 414$\displaystyle{\tt sums[2:3]} 415 = \sum_{\tt i = 0}^{\tt n-1} {\tt row0[i] * col1[i]}$ 416\end{tabular} 417%----------------------------------------------------------------------- 418\item 419\begin{verbatim} 420int ZVdotU11 ( int n, double row0[], double col0[], double sums[] ) ; 421\end{verbatim} 422\index{ZVdotU11@{\tt ZVdotU11()}} 423This method computes one dot product. 424\par 425\begin{tabular}{l} 426$\displaystyle{\tt sums[0:1]} 427 = \sum_{\tt i = 0}^{\tt n-1} {\tt row0[i] * col0[i]}$ 428\end{tabular} 429%----------------------------------------------------------------------- 430\item 431\begin{verbatim} 432int ZVdotC33 ( int n, double row0[], double row1[], double row2[], 433 double col0[], double col1[], double col2[], double sums[] ) ; 434\end{verbatim} 435\index{ZVdotC33@{\tt ZVdotC33()}} 436This method computes nine dot products. 437\par 438\begin{tabular}{ll} 439$\displaystyle{\tt sums[0;1]} 440= \sum_{\tt i = 0}^{\tt n-1} \overline{\tt row0[i]} * {\tt col0[i]}$ & 441$\displaystyle{\tt sums[2:3]} 442= \sum_{\tt i = 0}^{\tt n-1} \overline{\tt row0[i]} * {\tt col1[i]}$ \\ 443$\displaystyle{\tt sums[4:5]} 444= \sum_{\tt i = 0}^{\tt n-1} \overline{\tt row0[i]} * {\tt col2[i]}$ & 445$\displaystyle{\tt sums[6:7]} 446= \sum_{\tt i = 0}^{\tt n-1} \overline{\tt row1[i]} * {\tt col0[i]}$ \\ 447$\displaystyle{\tt sums[8:9]} 448= \sum_{\tt i = 0}^{\tt n-1} \overline{\tt row1[i]} * {\tt col1[i]}$ & 449$\displaystyle{\tt sums[10:11]} 450= \sum_{\tt i = 0}^{\tt n-1} \overline{\tt row1[i]} * {\tt col2[i]}$ \\ 451$\displaystyle{\tt sums[12:13]} 452= \sum_{\tt i = 0}^{\tt n-1} \overline{\tt row2[i]} * {\tt col0[i]}$ & 453$\displaystyle{\tt sums[14:15]} 454= \sum_{\tt i = 0}^{\tt n-1} \overline{\tt row2[i]} * {\tt col1[i]}$ \\ 455$\displaystyle{\tt sums[16:17]} 456= \sum_{\tt i = 0}^{\tt n-1} \overline{\tt row2[i]} * {\tt col2[i]}$ 457\end{tabular} 458%----------------------------------------------------------------------- 459\item 460\begin{verbatim} 461int ZVdotC32 ( int n, double row0[], double row1[], double row2[], 462 double col0[], double col1[], double sums[] ) ; 463\end{verbatim} 464\index{ZVdotC32@{\tt ZVdotC32()}} 465This method computes six dot products. 466\par 467\begin{tabular}{ll} 468$\displaystyle{\tt sums[0:1]} 469= \sum_{\tt i = 0}^{\tt n-1} \overline{\tt row0[i]} * {\tt col0[i]}$ & 470$\displaystyle{\tt sums[2:3]} 471= \sum_{\tt i = 0}^{\tt n-1} \overline{\tt row0[i]} * {\tt col1[i]}$ \\ 472$\displaystyle{\tt sums[4:5]} 473= \sum_{\tt i = 0}^{\tt n-1} \overline{\tt row1[i]} * {\tt col0[i]}$ & 474$\displaystyle{\tt sums[6:7]} 475= \sum_{\tt i = 0}^{\tt n-1} \overline{\tt row1[i]} * {\tt col1[i]}$ \\ 476$\displaystyle{\tt sums[8:9]} 477= \sum_{\tt i = 0}^{\tt n-1} \overline{\tt row2[i]} * {\tt col0[i]}$ & 478$\displaystyle{\tt sums[10:11]} 479= \sum_{\tt i = 0}^{\tt n-1} \overline{\tt row2[i]} * {\tt col1[i]}$ 480\end{tabular} 481%----------------------------------------------------------------------- 482\item 483\begin{verbatim} 484int ZVdotC31 ( int n, double row0[], double row1[], double row2[], 485 double col0[], double sums[] ) ; 486\end{verbatim} 487\index{ZVdotC31@{\tt ZVdotC31()}} 488This method computes three dot products. 489\par 490\begin{tabular}{l} 491$\displaystyle{\tt sums[0:1]} 492= \sum_{\tt i = 0}^{\tt n-1} \overline{\tt row0[i]} * {\tt col0[i]}$ \\ 493$\displaystyle{\tt sums[2:3]} 494= \sum_{\tt i = 0}^{\tt n-1} \overline{\tt row1[i]} * {\tt col0[i]}$ \\ 495$\displaystyle{\tt sums[4:5]} 496= \sum_{\tt i = 0}^{\tt n-1} \overline{\tt row2[i]} * {\tt col0[i]}$ 497\end{tabular} 498%----------------------------------------------------------------------- 499\item 500\begin{verbatim} 501int ZVdotC23 ( int n, double row0[], double row1[], 502 double col0[], double col1[], double col2[], double sums[] ) ; 503\end{verbatim} 504\index{ZVdotC23@{\tt ZVdotC23()}} 505This method computes six dot products. 506\par 507\begin{tabular}{ll} 508$\displaystyle{\tt sums[0:1]} 509= \sum_{\tt i = 0}^{\tt n-1} \overline{\tt row0[i]} * {\tt col0[i]}$ & 510$\displaystyle{\tt sums[2:3]} 511= \sum_{\tt i = 0}^{\tt n-1} \overline{\tt row0[i]} * {\tt col1[i]}$ \\ 512$\displaystyle{\tt sums[4:5]} 513= \sum_{\tt i = 0}^{\tt n-1} \overline{\tt row0[i]} * {\tt col2[i]}$ & 514$\displaystyle{\tt sums[6:7]} 515= \sum_{\tt i = 0}^{\tt n-1} \overline{\tt row1[i]} * {\tt col0[i]}$ \\ 516$\displaystyle{\tt sums[8:9]} 517= \sum_{\tt i = 0}^{\tt n-1} \overline{\tt row1[i]} * {\tt col1[i]}$ & 518$\displaystyle{\tt sums[10:11]} 519= \sum_{\tt i = 0}^{\tt n-1} \overline{\tt row1[i]} * {\tt col2[i]}$ 520\end{tabular} 521%----------------------------------------------------------------------- 522\item 523\begin{verbatim} 524int ZVdotC22 ( int n, double row0[], double row1[], 525 double col0[], double col1[], double sums[] ) ; 526\end{verbatim} 527\index{ZVdotC22@{\tt ZVdotC22()}} 528This method computes four dot products. 529\par 530\begin{tabular}{ll} 531$\displaystyle{\tt sums[0:1]} 532= \sum_{\tt i = 0}^{\tt n-1} \overline{\tt row0[i]} * {\tt col0[i]}$ & 533$\displaystyle{\tt sums[2:3]} 534= \sum_{\tt i = 0}^{\tt n-1} \overline{\tt row0[i]} * {\tt col1[i]}$ \\ 535$\displaystyle{\tt sums[4:5]} 536= \sum_{\tt i = 0}^{\tt n-1} \overline{\tt row1[i]} * {\tt col0[i]}$ & 537$\displaystyle{\tt sums[6:7]} 538= \sum_{\tt i = 0}^{\tt n-1} \overline{\tt row1[i]} * {\tt col1[i]}$ 539\end{tabular} 540%----------------------------------------------------------------------- 541\item 542\begin{verbatim} 543int ZVdotC21 ( int n, double row0[], double row1[], 544 double col0[], double sums[] ) ; 545\end{verbatim} 546\index{ZVdotC21@{\tt ZVdotC21()}} 547This method computes two dot products. 548\par 549\begin{tabular}{l} 550$\displaystyle{\tt sums[0:1]} 551= \sum_{\tt i = 0}^{\tt n-1} \overline{\tt row0[i]} * {\tt col0[i]}$ \\ 552$\displaystyle{\tt sums[2:3]} 553= \sum_{\tt i = 0}^{\tt n-1} \overline{\tt row1[i]} * {\tt col0[i]}$ 554\end{tabular} 555%----------------------------------------------------------------------- 556\item 557\begin{verbatim} 558int ZVdotC13 ( int n, double row0[], 559 double col0[], double col1[], double col2[], double sums[] ) ; 560\end{verbatim} 561\index{ZVdotC13@{\tt ZVdotC13()}} 562This method computes six dot products. 563\par 564\begin{tabular}{ll} 565$\displaystyle{\tt sums[0:1]} 566= \sum_{\tt i = 0}^{\tt n-1} \overline{\tt row0[i]} * {\tt col0[i]}$ & 567$\displaystyle{\tt sums[2:3]} 568= \sum_{\tt i = 0}^{\tt n-1} \overline{\tt row0[i]} * {\tt col1[i]}$ \\ 569$\displaystyle{\tt sums[4:5]} 570= \sum_{\tt i = 0}^{\tt n-1} \overline{\tt row0[i]} * {\tt col2[i]}$ 571\end{tabular} 572%----------------------------------------------------------------------- 573\item 574\begin{verbatim} 575int ZVdotC12 ( int n, double row0[], double row1[], 576 double col0[], double col1[], double sums[] ) ; 577\end{verbatim} 578\index{ZVdotC12@{\tt ZVdotC12()}} 579This method computes two dot products. 580\par 581\begin{tabular}{ll} 582$\displaystyle{\tt sums[0:1]} 583= \sum_{\tt i = 0}^{\tt n-1} \overline{\tt row0[i]} * {\tt col0[i]}$ & 584$\displaystyle{\tt sums[2:3]} 585= \sum_{\tt i = 0}^{\tt n-1} \overline{\tt row0[i]} * {\tt col1[i]}$ 586\end{tabular} 587%----------------------------------------------------------------------- 588\item 589\begin{verbatim} 590int ZVdotC11 ( int n, double row0[], double col0[], double sums[] ) ; 591\end{verbatim} 592\index{ZVdotC11@{\tt ZVdotC11()}} 593This method computes one dot product. 594\par 595\begin{tabular}{l} 596$\displaystyle{\tt sums[0:1]} 597= \sum_{\tt i = 0}^{\tt n-1} \overline{\tt row0[i]} * {\tt col0[i]}$ 598\end{tabular} 599%----------------------------------------------------------------------- 600\item 601\begin{verbatim} 602void ZVgather ( int n, double y[], double x[], int index[] ) ; 603\end{verbatim} 604\index{ZVgather@{\tt ZVgather()}} 605{\tt y[i] = x[index[i]]} for {\tt 0 <= i < n}. 606%----------------------------------------------------------------------- 607\item 608\begin{verbatim} 609double ZVmaxabs ( int n, double y[] ) ; 610\end{verbatim} 611\index{ZVmaxabs@{\tt ZVmaxabs()}} 612This method returns the maximum magnitude of entries in {\tt y[0:n-1]}. 613%----------------------------------------------------------------------- 614\item 615\begin{verbatim} 616double ZVminabs ( int n, double y[] ) ; 617\end{verbatim} 618\index{ZVminabs@{\tt ZVminabs()}} 619This method returns the minimum magnitude of entries in {\tt y[0:n-1]}. 620%----------------------------------------------------------------------- 621\item 622\begin{verbatim} 623void ZVscale ( int n, double y[], double areal, double aimag ) ; 624\end{verbatim} 625\index{ZVscale@{\tt ZVscale()}} 626This method scales a vector {\tt y[]} by {\tt (areal,aimag)}, 627i.e., 628{\tt y[i] *= (areal,aimag)}. 629for {\tt 0 <= i < n}. 630%----------------------------------------------------------------------- 631\item 632\begin{verbatim} 633void ZVscale2 ( int n, double x[], double y[], 634 double areal, double aimag, double breal, double bimag, 635 double creal, double cimag, double dreal, double dimag ) ; 636\end{verbatim} 637\index{ZVscale@{\tt ZVscale()}} 638This method scales two vectors {\tt y[]} by a $2 \times 2$ matrix, 639i.e., 640$$ 641\left \lbrack \begin{array}{ccc} 642{\tt x[0]} & \ldots & {\tt x[n-1]} \\ 643{\tt y[0]} & \ldots & {\tt y[n-1]} 644\end{array} \right \rbrack 645:= 646\left \lbrack \begin{array}{cc} 647{\tt (areal,aimag)} & {\tt (breal,bimag)} \\ 648{\tt (creal,cimag)} & {\tt (dreal,dimag)} 649\end{array} \right \rbrack 650\left \lbrack \begin{array}{ccc} 651{\tt x[0]} & \ldots & {\tt x[n-1]} \\ 652{\tt y[0]} & \ldots & {\tt y[n-1]} 653\end{array} \right \rbrack. 654$$ 655%----------------------------------------------------------------------- 656\item 657\begin{verbatim} 658void ZVscatter ( int n, double y[], int index[], double x[] ) ; 659\end{verbatim} 660\index{ZVscatter@{\tt ZVscatter()}} 661This method scatters {\tt n} entries of {\tt x[]} into {\tt y[]} 662as follows, 663{\tt y[index[i]] = x[i]} 664for {\tt 0 <= i < n}. 665%----------------------------------------------------------------------- 666\item 667\begin{verbatim} 668void ZVsub ( int n, double y[], double x[] ) ; 669\end{verbatim} 670\index{ZVsub@{\tt ZVsub()}} 671This method subtracts {\tt n} entries from {\tt x[]} to {\tt y[]}, 672i.e., 673{\tt y[i] -= x[i]} 674for {\tt 0 <= i < n}. 675%----------------------------------------------------------------------- 676\item 677\begin{verbatim} 678void ZVzero ( int n, double y[] ) ; 679\end{verbatim} 680\index{ZVzero@{\tt ZVzero()}} 681This method zeroes {\tt n} entries in {\tt y[]}, 682i.e., 683{\tt y[i] = 0} 684for {\tt 0 <= i < n}. 685%----------------------------------------------------------------------- 686\end{enumerate} 687