ScaLAPACK  2.0.2
ScaLAPACK: Scalable Linear Algebra PACKage
BI_cvvamn2.c
Go to the documentation of this file.
00001 #include "Bdef.h"
00002 void BI_cvvamn2(int N, char *vec1, char *vec2)
00003 {
00004    int r, i;
00005    float *v1=(float*)vec1, *v2=(float*)vec2;
00006    float diff;
00007 
00008    N *= 2;
00009    for (r=0, i=1; r != N; r += 2, i += 2)
00010    {
00011       diff = (Rabs(v1[r]) + Rabs(v1[i])) - (Rabs(v2[r]) + Rabs(v2[i]));
00012       if (diff > 0)
00013       {
00014          v1[r] = v2[r];
00015          v1[i] = v2[i];
00016       }
00017       else if (diff == 0)
00018       {
00019          if (v1[r] != v2[r])
00020          {
00021             if (v1[r] < v2[r])
00022             {
00023                v1[r] = v2[r];
00024                v1[i] = v2[i];
00025             }
00026          }
00027          else
00028          {
00029             if (v1[i] < v2[i])
00030             {
00031                v1[r] = v2[r];
00032                v1[i] = v2[i];
00033             }
00034          }
00035       }
00036    }
00037 }