ScaLAPACK 2.1  2.1
ScaLAPACK: Scalable Linear Algebra PACKage
BI_zvvamx2.c
Go to the documentation of this file.
1 #include "Bdef.h"
2 void BI_zvvamx2(int N, char *vec1, char *vec2)
3 {
4  int r, i;
5  double *v1=(double*)vec1, *v2=(double*)vec2;
6  double diff;
7 
8  N *= 2;
9  for (r=0, i=1; r != N; r += 2, i += 2)
10  {
11  diff = (Rabs(v1[r]) + Rabs(v1[i])) - (Rabs(v2[r]) + Rabs(v2[i]));
12  if (diff < 0)
13  {
14  v1[r] = v2[r];
15  v1[i] = v2[i];
16  }
17  else if (diff == 0)
18  {
19  if (v1[r] != v2[r])
20  {
21  if (v1[r] < v2[r])
22  {
23  v1[r] = v2[r];
24  v1[i] = v2[i];
25  }
26  }
27  else
28  {
29  if (v1[i] < v2[i])
30  {
31  v1[r] = v2[r];
32  v1[i] = v2[i];
33  }
34  }
35  }
36  }
37 }
BI_zvvamx2
void BI_zvvamx2(int N, char *vec1, char *vec2)
Definition: BI_zvvamx2.c:2
Rabs
#define Rabs(x)
Definition: Bdef.h:269
Bdef.h