コード例 #1
0
ファイル: check-cg.c プロジェクト: usqcd-software/clover
static double
c_reader(int mu, int nu, const int pos[NDIM], int a, int b, int re_im, void *e)
{
    int xm, xn, d;
    
    for (d = 0, xm = 0; xm < NDIM; xm++) {
        for (xn = xm + 1; xn < NDIM; xn++, d++) {
            if ((xm == mu) && (xn == nu))
                goto found;
        }
    }
    return 0.0;
    
found:
    {
        QLA_Real xx;
        QLA_ColorMatrix *m = QDP_expose_M(C[d]);
        int n = QDP_node_number(pos);
        int i = QDP_index(pos);

        assert(n == self);
        if (re_im == 0) {
            QLA_r_eq_Re_c(xx, QLA_elem_M(m[i], a, b));
        } else {
            QLA_r_eq_Im_c(xx, QLA_elem_M(m[i], a, b));
        }
        QDP_reset_M(C[d]);
        return xx;
    }
}
コード例 #2
0
void Print(QDP_ColorMatrix * field){
  QLA_ColorMatrix *mom0;
  const int x[4] = {0,0,0,0};
  int ind = QDP_index(x);
  
  mom0 = QDP_expose_M(field);        
  printf("Field: %e %e %e\n\n", mom0[ind].e[0][0].real, mom0[ind].e[0][1].real, mom0[ind].e[0][2].real);

  QDP_reset_M(field);
}
コード例 #3
0
ファイル: qopwilson.c プロジェクト: jcosborn/qll
void
packM(Layout *l, real *y, QDP_ColorMatrix *m)
{
  QDP_Lattice *lat = QDP_get_lattice_M(m);
  QDP_ColorMatrix *xx = QDP_create_M_L(lat);
  //QDP_M_eq_M(xx, m, QDP_all_L(lat));
  QDP_M_eq_transpose_M(xx, m, QDP_all_L(lat));
  real *x = QDP_expose_M(xx);
  int nelem = 2*QDP_Nc*QDP_Nc;
  fromQDP_F(y, l, x, lat, nelem, 1);
  QDP_reset_M(xx);
  QDP_destroy_M(xx);
}
コード例 #4
0
ファイル: qopwilson.c プロジェクト: jcosborn/qll
void
unpackM(Layout *l, QDP_ColorMatrix *m, real *y)
{
  QDP_Lattice *lat = QDP_get_lattice_M(m);
  QDP_ColorMatrix *xx = QDP_create_M_L(lat);
  real *x = QDP_expose_M(xx);
  int nelem = 2*QDP_Nc*QDP_Nc;
  toQDP_F(x, lat, y, l, nelem, 1);
  QDP_reset_M(xx);
  //QDP_M_eq_M(m, xx, QDP_all_L(lat));
  QDP_M_eq_transpose_M(m, xx, QDP_all_L(lat));
  QDP_destroy_M(xx);
}
コード例 #5
0
static void 
PrintMsite(QDP_ColorMatrix * field, int *x){
  QLA_ColorMatrix *mom0;
  int ind = QDP_index(x);

  mom0 = QDP_expose_M(field);
  printf("Field: %e %e %e\n", mom0[ind].e[0][0].real,
	 mom0[ind].e[0][1].real, mom0[ind].e[0][2].real);
  printf("       %e %e %e\n", mom0[ind].e[1][0].real,
	 mom0[ind].e[1][1].real, mom0[ind].e[1][2].real);
  printf("       %e %e %e\n\n", mom0[ind].e[2][0].real,
	 mom0[ind].e[2][1].real, mom0[ind].e[2][2].real);

  QDP_reset_M(field);
}
コード例 #6
0
ファイル: check-cg.c プロジェクト: usqcd-software/clover
static double
u_reader(int dir, const int pos[NDIM], int a, int b, int re_im, void *e)
{
    QLA_Real xx;
    int n = QDP_node_number(pos);
    int i = QDP_index(pos);
    QLA_ColorMatrix *m = QDP_expose_M(U[dir]);

    assert(n == self);
    if (re_im == 0) {
        QLA_r_eq_Re_c(xx, QLA_elem_M(m[i], a, b));
    } else {
        QLA_r_eq_Im_c(xx, QLA_elem_M(m[i], a, b));
    }

    QDP_reset_M(U[dir]);
    return xx;
}