void prop_group_t::get_inverting(in_source_t &source,gauge_conf_t &gauge_conf,int rotate_to_physical_basis) { //get ntheta,nmass,nr int nmass,ntheta,nr; get_ntheta_mass_r(ntheta,nmass,nr); //allocate spincolor *temp_source=nissa_malloc("temp_source",loc_vol+bord_vol,spincolor); spincolor *temp_reco[2]={nissa_malloc("temp_reco",loc_vol+bord_vol,spincolor),nissa_malloc("temp_reco",loc_vol+bord_vol,spincolor)}; spincolor *cgm_solution[nmass]; for(int imass=0;imass<nmass;imass++) cgm_solution[imass]=nissa_malloc(combine("cgm_solution_%d",imass).c_str(),loc_vol+bord_vol,spincolor); for(int id=0;id<4;id++) { //extract index of the source get_spincolor_from_colorspinspin(temp_source,source.eta,id); //put the g5 safe_dirac_prod_spincolor(temp_source,base_gamma+5,temp_source); for(int itheta=0;itheta<ntheta;itheta++) { //adapt the border condition double th=theta->theta[itheta]; momentum_t mom={1,th,th,th}; gauge_conf.adapt_theta(mom); //invert int niter_max=100000; inv_tmQ2_cgm(cgm_solution,gauge_conf.U,gauge_conf.kappa,mass_res->mass,nmass,niter_max,mass_res->residues,temp_source); for(int imass=0;imass<nmass;imass++) { //reconstruct the doublet reconstruct_tm_doublet(temp_reco[0],temp_reco[1],gauge_conf.U,gauge_conf.kappa,mass_res->mass[imass],cgm_solution[imass]); master_printf("Mass %d (%g) reconstructed \n",imass,mass_res->mass[imass]); //convert the id-th spincolor into the colorspinspin for(int rdest=0;rdest<nr;rdest++) put_spincolor_into_colorspinspin(S[iprop(itheta,imass,rdest)],temp_reco[(nr==2)?rdest:which_r],id); } } } //rotate if needed if(rotate_to_physical_basis) for(int itheta=0;itheta<ntheta;itheta++) for(int imass=0;imass<nmass;imass++) for(int rdest=0;rdest<nr;rdest++) //rotate opposite of D rotate_vol_colorspinspin_to_physical_basis(S[iprop(itheta,imass,rdest)],!rdest,!rdest); //free for(int imass=0;imass<nmass;imass++) nissa_free(cgm_solution[imass]); nissa_free(temp_source); for(int r=0;r<2;r++) nissa_free(temp_reco[r]); }
ReflectionComponent Animation::Reflection(Animation* val) { ReflectionComponent refcomp; Property sprop(Property::STRING); (refcomp.properties["Animation Name"] = sprop).Set<std::string>(val->animation_name); refcomp.properties["Animation Name"].update_func = [val] (Property& prop) { val->animation_name = prop.Get<std::string>(); }; Property iprop(Property::INTEGER); (refcomp.properties["Current Frame"] = sprop).Set<int>(val->current_frame_index); refcomp.properties["Current Frame"].update_func = [val] (Property& prop) { val->current_frame_index = prop.Get<int>(); }; return std::move(refcomp); }
void Functions::getNextItemProperty(Aurora::NWScript::FunctionContext &ctx) { Item *item = NWN2::ObjectContainer::toItem(getParamObject(ctx, 0)); if (!item) return; ItemProperty *nextIP = item->getNextItemProperty(); if (!nextIP) return; ItemProperty iprop(*nextIP); ctx.getReturn() = iprop; }
void prop_group_t::write(const char *ext_template_path,int save_reconstructing,int is_rotated,gauge_conf_t &gauge_conf) { char template_path[1024]; sprintf(template_path,"%s/%s",base_out_folder,ext_template_path); int ntheta,nmass,nr; get_ntheta_mass_r(ntheta,nmass,nr); for(int itheta=0;itheta<ntheta;itheta++) for(int imass=0;imass<nmass;imass++) for(int id=0;id<4;id++) { int ivol1=8,id1=2,ic1=1,ri1=1,mu1=1; int ip0=iprop(itheta,imass,0); int ip1=iprop(itheta,imass,1); } for(int itheta=0;itheta<ntheta;itheta++) for(int imass=0;imass<nmass;imass++) if(nr==2 && save_reconstructing) { int ip0=iprop(itheta,imass,0); int ip1=iprop(itheta,imass,1); double th=theta->theta[itheta]; momentum_t mom={1,th,th,th}; gauge_conf.adapt_theta(mom); master_printf("involved: %d %d\n",ip0,ip1); write_tm_colorspinspin_anti_reconstructing(combine(template_path,ip0).c_str(),S[ip0],S[ip1],is_rotated,mass_res->mass[imass],64,gauge_conf.U,gauge_conf.kappa,gauge_conf.theta); } else for(int r=0;r<2;r++) { int ip=iprop(itheta,imass,r); write_colorspinspin(combine(template_path,ip).c_str(),S[ip],64); } }
void prop_group_t::get_reading(const char *ext_template_path,gauge_conf_t &conf,int load_reconstructing,int rotate_to_physical_basis) { char template_path[1024]; sprintf(template_path,"%s/%s",base_out_folder,ext_template_path); int ntheta,nmass,nr; get_ntheta_mass_r(ntheta,nmass,nr); for(int itheta=0;itheta<ntheta;itheta++) for(int imass=0;imass<nmass;imass++) { if(nr==2 && load_reconstructing) { double th=theta->theta[itheta]; momentum_t mom={1,th,th,th}; conf.adapt_theta(mom); int ip0=iprop(itheta,imass,0); int ip1=iprop(itheta,imass,1); colorspinspin *temp[2]={S[ip0],S[ip1]}; read_tm_colorspinspin_reconstructing(temp,combine(template_path,ip0).c_str(),NULL,conf.U,conf.kappa,mass_res->mass[imass]); } else for(int r=0;r<nr;r++) { int ip=iprop(itheta,imass,r); read_colorspinspin(S[ip],combine(template_path,ip).c_str(),NULL); } if(rotate_to_physical_basis) for(int r=0;r<nr;r++) { int ip=iprop(itheta,imass,r); rotate_vol_colorspinspin_to_physical_basis(S[ip],!r,!r); } } }