#include "AMEGIC++/Amplitude/Zfunc.H" #include "AMEGIC++/Amplitude/Pfunc.H" #include "AMEGIC++/Amplitude/Zfunctions/Zfunc_Calc.H" #include "ATOOLS/Org/Message.H" #include "ATOOLS/Org/My_MPI.H" using namespace AMEGIC; using namespace ATOOLS; using namespace std; #define new_calc Zfunc::Zfunc() { p_equal = this; m_narg = 0; m_ncoupl = 0; m_nprop = 0; } Zfunc::Zfunc(const Zfunc& z) { m_narg = 0; m_ncoupl = 0; m_nprop = 0; *this = z; } Zfunc::~Zfunc() { if (m_narg!=0) delete[] p_arguments; if (m_ncoupl!=0) delete[] p_couplings; if (m_nprop!=0) delete[] p_propagators; for (CL_Iterator clit=m_calclist.begin();clit!=m_calclist.end();++clit) {delete[] (*clit).p_args;} } Zfunc& Zfunc::operator=(const Zfunc& z) { if (this!=&z) { if (m_narg!=0) delete[] p_arguments; if (m_ncoupl!=0) delete[] p_couplings; if (m_nprop!=0) delete[] p_propagators; m_type = z.m_type; m_narg = z.m_narg; m_ncoupl = z.m_ncoupl; m_nprop = z.m_nprop; if (m_narg>0) { p_arguments = new int[m_narg]; for (int i=0;i0) { p_couplings = new Complex[m_ncoupl]; for (int i=0;i0) { p_propagators = new Argument[m_nprop]; for (int i=0;i* pairlist) { for(int i=0;isize();k++) { if ((*pairlist)[k].pold==p_arguments[i]) { p_arguments[i] = (*pairlist)[k].pnew; break; } } } for (int i=0;isize();k++) { if ((*pairlist)[k].pold==p_propagators[i].numb) { p_propagators[i].numb = (*pairlist)[k].pnew; break; } } } } void Zfunc::ClearCalcList() { if (!m_calclist.empty()){ for (CL_Iterator clit=m_calclist.begin();clit!=m_calclist.end();++clit) delete[] (*clit).p_args; m_calclist.clear(); } } void Zfunc::Print() { if (!msg_LevelIsTracking()) return; msg_Out()<<"Z(["<0) msg_Out()<Out().precision()); msg->SetPrecision(2); for (int i=0;iSetPrecision(precision); } Zfunc_Group::Zfunc_Group(const Zfunc& z) : Zfunc(z) { m_op = '+'; m_sign = 1; if (m_nprop!=0) delete[] p_propagators; m_nprop = 0; p_equal = this; } Zfunc_Group::Zfunc_Group(Zfunc& z1,Zfunc& z2,int si,Pfunc_List* pl) { int n99 = 0; //Marker 99 int i1 = 0; for(int i=0;i0) || (i2==0&&i1>0) ) { msg_Error()<<"Error in Zfunc_Group(Z*Z-Constructor): sum index, will abort."<0) { p_arguments = new int[m_narg]; while (iibegin();pit!=pl->end();++pit) { Pfunc* p = *pit; if (p->arg[0]==z1.p_propagators[i].numb && p->on==0){ m_nprop++; break; } } } } int k = m_nprop; if (z2.GetOp()=='*') m_nprop += z2.m_nprop; if (z2.GetOp()==0) { for (int i=0;ibegin();pit!=pl->end();++pit) { Pfunc* p = *pit; if (p->arg[0]==z2.p_propagators[i].numb && p->on==0){ m_nprop++; break; } } } } m_nprop++; if (m_nprop>0) { p_propagators = new Argument[m_nprop]; if ( (z1.GetOp()=='*') && (z1.m_nprop>0) ) { for (int i=0;ibegin();pit!=pl->end();++pit) { Pfunc* p = *pit; if (p->arg[0]==z1.p_propagators[i].numb && p->on==0){ p_propagators[j] = z1.p_propagators[i]; j++; break; } } } } if ( (z2.GetOp()=='*') && (z2.m_nprop>0) ) { for (int i=0;ibegin();pit!=pl->end();++pit) { Pfunc* p = *pit; if (p->arg[0]==z2.p_propagators[i].numb && p->on==0){ p_propagators[j] = z2.p_propagators[i]; j++; break; } } } } p_propagators[m_nprop-1].numb = si; } if (m_ncoupl>0) { p_couplings = new Complex[m_ncoupl]; for (int i=0;i* pairlist) { for (size_t k=0;ksize();k++) { if ((*pairlist)[k].pold==m_sumindex) { m_sumindex = (*pairlist)[k].pnew; break; } } Zfunc::ReplaceProp(pairlist); for (size_t i=0;iReplaceProp(pairlist); } void Zfunc_Group::ClearCalcList() { Zfunc::ClearCalcList(); for (size_t i=0;iClearCalcList(); } void Zfunc_Group::KillZList() { for (Zfunc_Iterator zit=m_zlist.begin();zit!=m_zlist.end();++zit) { (*zit)->KillZList(); delete (*zit); } } void Zfunc_Group::Print() { if (!msg_LevelIsTracking()) return; msg_Out()<<"SZ(["<0) msg_Out()<p_propagators[0].numb<<" * "; m_zlist[i]->Print(); } else { if (m_zlist[i]->p_propagators!=NULL) { msg_Out()<<" + "; m_zlist[i]->Print(); } else { msg_Out()<<" ??? "<<" * ";m_zlist[i]->Print(); } } } } if (m_op=='*'){ for (size_t i=0;i0) msg_Out()<<" *";else msg_Out()<<" ->"; m_zlist[i]->Print(); } msg_Out()<<"Sum over "<