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