ScaLAPACK  2.0.2
ScaLAPACK: Scalable Linear Algebra PACKage
BI_ivmcopy.c
Go to the documentation of this file.
00001 #include "Bdef.h"
00002 
00003 void BI_ivmcopy(int m, int n, int *A, int lda, int *buff)
00004 /*
00005  *  performs an vector to matrix copy (unpack) for the data type int
00006  */
00007 {
00008    int i, j;
00009 
00010    if ( (m == lda) || (n == 1) )
00011    {
00012       m = n * m;
00013       for (i=0; i < m; i++) A[i] = buff[i];
00014    }
00015    else if (m == 1)
00016    {
00017       for (j=0; j < n; j++) A[j*lda] = buff[j];
00018    }
00019    else
00020    {
00021       for (j=0; j< n; j++)
00022       {
00023          for (i=0; i < m; i++) A[i] = buff[i];
00024          A += lda;
00025          buff += m;
00026       }
00027    }
00028 }