コード例 #1
0
ファイル: firstfollow.c プロジェクト: krishna2371995/lp
void follow(int i)
{
    int j,k;
    for(j=0;j<=ff0;j++)
        if(array[i][0]==ff[j])
            return;
        if(j>ff0)ff[++ff0]=array[i][0];
            if(i==0)fol[l][++f]='$';
        for(j=0;j<n;j++)
            for(k=2;array[j][k]!='\0';k++)
                if(array[j][k]==array[i][0])
                    ffun(j,k);
}
コード例 #2
0
ファイル: mg2.c プロジェクト: wilmerhenao/PDE-Opencl
/* ------------------------------------------------------------------------- */
void init_f (unsigned points, ftype f[],ftype dx, unsigned field_start, unsigned dim_x, unsigned dim_other, ftype lo){

ftype x, y, z;
    
for (size_t i = 0; i < points; ++i)
   for (size_t j = 0; j < points; ++j)
     for (size_t k = 0; k < points; ++k){
	  // el cubo se llena primero de forma ascendiente y luego por el eje y.
	  // notese que los campos de la cola se "invaden" el principio de la siguiente fila
          //unsigned base = field_start + i + dim_x*(j + dim_other * k);
          x = lo + i * dx;
          y = lo + j * dx;
          z = lo + k * dx;
          F(i,j,k) = ffun(x, y, z);
      }
}