Beispiel #1
0
void TraverseDSTable(TrieTree T,Status(*Vi)(Record*))
{ /* 初始条件: Trie键树T存在,Vi是对记录指针操作的应用函数 */
  /* 操作结果: 按关键字的顺序输出关键字及其对应的记录 */
  TrieTree p;
  int i;
  if(T)
  {
    for(i=0;i<LENGTH;i++)
    {
      p=T->a.bh.ptr[i];
      if(p&&p->kind==LEAF)
        Vi(p->a.lf.infoptr);
      else if(p&&p->kind==BRANCH)
        TraverseDSTable(p,Vi);
    }
  }
}
Beispiel #2
0
EvolDF1nlep::EvolDF1nlep(unsigned int dim_i, schemes scheme, orders order, orders_ew 
    order_ew, const StandardModel& model)
: RGEvolutor(dim_i, scheme, order, order_ew), model(model), V(dim_i,0.), Vi(dim_i,0.),
    gs(dim_i,0.), Js(dim_i,0.), ge0(dim_i,0.), K0(dim_i,0.), ge11(dim_i,0.), K11(dim_i,0.),
    JsK0V(dim_i,0.), ViK0Js(dim_i,0.), Gamma_s0T(dim_i,0.), Gamma_s1T(dim_i,0.), 
    Gamma_eT(dim_i,0.), Gamma_seT(dim_i,0.), JsV(dim_i,0.), ViJs(dim_i,0.), K0V(dim_i,0.), 
    ViK0(dim_i,0.), K11V(dim_i,0.), ViK11(dim_i,0.), ge11sing(dim_i,0.), K11sing(dim_i,0.), 
    K11singV(dim_i,0.), e(dim_i,0.), dim(dim_i) {
    
    int nu = 0, nd = 0;
    double  b0 = 0., b1 = 0.;
    
    /* L=3 --> u,d,s,c (nf=3) L=2 --> u,d,s,c (nf=4)  L=1 --> u,d,s,c,b (nf=5) L=0 --> u,d,s,c,b,t (nf=6)*/
    for(int L=3; L>-1; L--){
        
        b0 = model.Beta0(6-L);
        b1 = model.Beta1(6-L);
        
	if(L == 3){nd = 2; nu = 1;} 
        if(L == 2){nd = 2; nu = 2;}
        if(L == 1){nd = 3; nu = 2;} 
        if(L == 0){nd = 3; nu = 3;}
        
        Gamma_s0T = AnomalousDimension_nlep_S(LO,nu,nd).transpose();
        Gamma_s1T = AnomalousDimension_nlep_S(NLO,nu,nd).transpose();
        Gamma_eT = AnomalousDimension_nlep_EM(LO,nu,nd).transpose();
        Gamma_seT = AnomalousDimension_nlep_EM(NLO,nu,nd).transpose();
        
        AnomalousDimension_nlep_S(LO,nu,nd).transpose().eigensystem(V,e);
        Vi = V.inverse();
        
        /* magic numbers of U0 */
        for(unsigned int i = 0; i < dim; i++){
            a[L][i] = e(i).real()/2./b0;
            for (unsigned int j = 0; j < dim; j++){
                for (unsigned int k = 0; k < dim; k++){
                    b[L][i][j][k] = V(i, k).real() * Vi(k, j).real();
                }
            }
        }
    
        gs = (b1/2./b0/b0) * Vi * Gamma_s0T * V - (1./2./b0) * Vi * Gamma_s1T * V;
        for(unsigned int i = 0; i<dim ; i++){
            for(unsigned int j = 0; j<dim ; j++){  
                gs.assign( i , j, gs(i,j)/(1. + a[L][i] - a[L][j]));
            }
        }
        Js = V * gs * Vi;
        
        /*magic numbers related to Js*/
        JsV = Js*V;
        ViJs = Vi * Js;
        for(unsigned int i = 0; i<dim; i++){
            for(unsigned int j = 0; j<dim; j++){
                for(unsigned int k = 0; k<dim; k++){
                    c[L][i][j][k] = JsV(i, k).real() * Vi(k, j).real();
                    d[L][i][j][k] = -V(i, k).real() * ViJs(k, j).real();
                }
            }
        }
        
        ge0 = (1./2./b0) *  Vi * Gamma_eT * V;
        for(unsigned int i = 0; i<dim ; i++){
            for(unsigned int j = 0; j<dim ; j++){
                ge0.assign( i , j, ge0(i,j)/(1. - a[L][i] + a[L][j]));
            }
        }
        K0 = V * ge0 * Vi;
        
        /*magic numbers related to K0*/
        K0V = K0*V;
        ViK0 = Vi * K0;
        for(unsigned int i = 0; i<dim; i++){
            for(unsigned int j = 0; j<dim; j++){
                for(unsigned int k = 0; k<dim; k++){
                    m[L][i][j][k] = K0V(i, k).real() * Vi(k, j).real();
                    n[L][i][j][k] = -V(i, k).real() * ViK0(k, j).real();
                }
            }
        }
        
        ge11 = Gamma_seT - (b1/b0) * Gamma_eT + Gamma_eT * Js - Js * Gamma_eT;
        ge11 = Vi * ge11;
        ge11 = ge11 * V;
        for(unsigned int i = 0; i<dim ; i++){
            for(unsigned int j = 0; j<dim ; j++){
                if(fabs(a[L][j]-a[L][i])> 0.00000000001){
                    ge11.assign( i , j, ge11(i,j)/( 2. * b0 * (a[L][j] - a[L][i])));
                }
                else{
                    ge11sing.assign( i, j, ge11(i,j)/2./b0);
                    ge11.assign( i , j, 0.);
                }
            }
        }
        K11 = V * ge11 * Vi;
        K11sing = V * ge11sing * Vi;
        /*magic numbers related to K11*/
        K11V = K11 * V;
        ViK11 = Vi * K11;
        K11singV = K11sing * V;
        if(L==1){
        }
        for(unsigned int i = 0; i<dim ; i++){
            for(unsigned int j = 0; j<dim ; j++){
                    for(unsigned int k = 0; k<dim ; k++){
                        o[L][i][j][k] = K11V(i, k).real() * Vi(k, j).real();
                        p[L][i][j][k] = -V(i, k).real() * ViK11(k, j).real();
                        u[L][i][j][k] = K11singV(i, k).real() * Vi(k, j).real();
                    }
                }    
            }
        
        /*magic numbers related to K12 and K13*/
        JsK0V = Js * K0 * V; 
        ViK0Js = Vi * K0 * Js;
        for(unsigned int i = 0; i<dim ; i++){
            for(unsigned int j = 0; j<dim ; j++){
                for(unsigned int k=0; k<dim; k++){
                    q[L][i][j][k] =  JsK0V(i, k).real() * Vi(k, j).real();
                    r[L][i][j][k] =  V(i, k).real() * ViK0Js(k, j).real();
                    s[L][i][j][k] = -JsV(i, k).real() * ViK0(k, j).real();
                    t[L][i][j][k] = -K0V(i, k).real() * ViJs(k, j).real();
                }
            }
        }
    }        
}
TEST(Array, CrossConstruct1) {
    vector<int> Vi(3);
    Vi() = 3;
    vector<double> Vd(Vi);
    EXPECT_ARRAY_NEAR(Vd, Vi);
}