root / www / HPL_dswap.html
Historique | Voir | Annoter | Télécharger (2,22 ko)
1 |
<HTML>
|
---|---|
2 |
<HEAD>
|
3 |
<TITLE>HPL_dswap HPL 2.0 Library Functions September 10, 2008</TITLE> |
4 |
</HEAD>
|
5 |
|
6 |
<BODY BGCOLOR="WHITE" TEXT = "#000000" LINK = "#0000ff" VLINK = "#000099" |
7 |
ALINK = "#ffff00"> |
8 |
|
9 |
<H1>Name</H1> |
10 |
<B>HPL_dswap</B> y <-> x. |
11 |
|
12 |
<H1>Synopsis</H1> |
13 |
<CODE>#include "hpl.h"</CODE><BR><BR> |
14 |
<CODE>void</CODE> |
15 |
<CODE>HPL_dswap(</CODE> |
16 |
<CODE>const int</CODE> |
17 |
<CODE>N</CODE>, |
18 |
<CODE>double *</CODE> |
19 |
<CODE>X</CODE>, |
20 |
<CODE>const int</CODE> |
21 |
<CODE>INCX</CODE>, |
22 |
<CODE>double *</CODE> |
23 |
<CODE>Y</CODE>, |
24 |
<CODE>const int</CODE> |
25 |
<CODE>INCY</CODE> |
26 |
<CODE>);</CODE> |
27 |
|
28 |
<H1>Description</H1> |
29 |
<B>HPL_dswap</B> |
30 |
swaps the vectors x and y. |
31 |
|
32 |
<H1>Arguments</H1> |
33 |
<PRE>
|
34 |
N (local input) const int |
35 |
On entry, N specifies the length of the vectors x and y. N |
36 |
must be at least zero. |
37 |
</PRE>
|
38 |
<PRE>
|
39 |
X (local input/output) double * |
40 |
On entry, X is an incremented array of dimension at least |
41 |
( 1 + ( n - 1 ) * abs( INCX ) ) that contains the vector x. |
42 |
On exit, the entries of the incremented array X are updated |
43 |
with the entries of the incremented array Y. |
44 |
</PRE>
|
45 |
<PRE>
|
46 |
INCX (local input) const int |
47 |
On entry, INCX specifies the increment for the elements of X. |
48 |
INCX must not be zero. |
49 |
</PRE>
|
50 |
<PRE>
|
51 |
Y (local input/output) double * |
52 |
On entry, Y is an incremented array of dimension at least |
53 |
( 1 + ( n - 1 ) * abs( INCY ) ) that contains the vector y. |
54 |
On exit, the entries of the incremented array Y are updated |
55 |
with the entries of the incremented array X. |
56 |
</PRE>
|
57 |
<PRE>
|
58 |
INCY (local input) const int |
59 |
On entry, INCY specifies the increment for the elements of Y. |
60 |
INCY must not be zero. |
61 |
</PRE>
|
62 |
|
63 |
<H1>Example</H1> |
64 |
<CODE>#include "hpl.h"</CODE><BR><BR> |
65 |
<PRE>
|
66 |
int main(int argc, char *argv[]) |
67 |
{ |
68 |
double x[3], y[3]; |
69 |
x[0] = 1.0; x[1] = 2.0; x[2] = 3.0; |
70 |
y[0] = 4.0; y[1] = 5.0; y[2] = 6.0; |
71 |
HPL_dswap( 3, x, 1, y, 1 ); |
72 |
printf("x=[%f,%f,%f]\n", x[0], x[1], x[2]); |
73 |
printf("y=[%f,%f,%f]\n", y[0], y[1], y[2]); |
74 |
exit(0); return(0); |
75 |
} |
76 |
</PRE>
|
77 |
|
78 |
<H1>See Also</H1> |
79 |
<A HREF="HPL_daxpy.html">HPL_daxpy</A>, |
80 |
<A HREF="HPL_dcopy.html">HPL_dcopy</A>, |
81 |
<A HREF="HPL_dscal.html">HPL_dscal</A>. |
82 |
|
83 |
</BODY>
|
84 |
</HTML>
|