#include "METOOLS/Currents/C_Pseudo.H" #include "ATOOLS/Org/CXXFLAGS.H" using namespace METOOLS; using namespace ATOOLS; template double CAsT4::s_accu(1.0e-12); template std::ostream & METOOLS::operator<<(std::ostream &s,const CAsT4 &ten) { return s<<'{'< bool CAsT4::Nan() const { for(short unsigned int i(0);i<6;++i) { if (IsNan(m_x[i])) return true; } return false; } template void CAsT4::ResetAccu() { s_accu=Accu(); } template CAsT4::CAsT4(const CVec4 &v1,const CVec4 &v2) { m_x[0]=v1[0]*v2[1]-v1[1]*v2[0];// 0,1 m_x[1]=v1[1]*v2[2]-v1[2]*v2[1];// 1,2 m_x[2]=v1[2]*v2[3]-v1[3]*v2[2];// 2,3 m_x[3]=v1[0]*v2[2]-v1[2]*v2[0];// 0,2 m_x[4]=v1[1]*v2[3]-v1[3]*v2[1];// 1,3 m_x[5]=v1[0]*v2[3]-v1[3]*v2[0];// 0,3 m_c[0]=v2(0); m_c[1]=v1(1); m_h=v1.H()|v2.H(); m_s=v1.S()|v2.S(); } template CAsT4::CAsT4(const CAsT4 &v,const SComplex &c) { m_x[0]=v[0]*c; m_x[1]=v[1]*c; m_x[2]=v[2]*c; m_x[3]=v[3]*c; m_x[4]=v[4]*c; m_x[5]=v[5]*c; m_c[0]=v(0); m_c[1]=v(1); m_h=v.m_h; m_s=v.m_s; } template CAsT4::CAsT4(const CAsT4 &v,const Scalar &c) { m_x[0]=v[0]*c; m_x[1]=v[1]*c; m_x[2]=v[2]*c; m_x[3]=v[3]*c; m_x[4]=v[4]*c; m_x[5]=v[5]*c; m_c[0]=v(0); m_c[1]=v(1); m_h=v.m_h; m_s=v.m_s; } template CAsT4& CAsT4::operator*=(const SComplex &c) { m_x[0]*=c; m_x[1]*=c; m_x[2]*=c; m_x[3]*=c; m_x[4]*=c; m_x[5]*=c; return *this; } template CVec4 METOOLS::operator*(const CVec4 &v,const CAsT4 &t) { CVec4 j; j[0]=-t[0]/*-0,1*/*v[1]-t[3]/*-0,2*/*v[2]-t[5]/*-0,3*/*v[3]; j[1]=-t[0]/*-0,1*/*v[0]-t[1]/*-1,2*/*v[2]-t[4]/*-1,3*/*v[3]; j[2]=-t[3]/*-0,2*/*v[0]+t[1]/* 1,2*/*v[1]-t[2]/*-2,3*/*v[3]; j[3]=-t[5]/*-0,3*/*v[0]+t[4]/* 1,3*/*v[1]+t[2]/* 2,3*/*v[2]; return j; } template void CAsT4::Add(const CObject *c) { const CAsT4 *t(static_cast(c)); m_x[0]+=t->m_x[0]; m_x[1]+=t->m_x[1]; m_x[2]+=t->m_x[2]; m_x[3]+=t->m_x[3]; m_x[4]+=t->m_x[4]; m_x[5]+=t->m_x[5]; } template void CAsT4::Divide(const double &d) { m_x[0]/=Scalar(d); m_x[1]/=Scalar(d); m_x[2]/=Scalar(d); m_x[3]/=Scalar(d); m_x[4]/=Scalar(d); m_x[5]/=Scalar(d); } template void CAsT4::Multiply(const Complex &c) { m_x[0]*=SComplex(c); m_x[1]*=SComplex(c); m_x[2]*=SComplex(c); m_x[3]*=SComplex(c); m_x[4]*=SComplex(c); m_x[5]*=SComplex(c); } template void CAsT4::Invert() { m_x[0]=-m_x[0]; m_x[1]=-m_x[1]; m_x[2]=-m_x[2]; m_x[3]=-m_x[3]; m_x[4]=-m_x[4]; m_x[5]=-m_x[5]; } template bool CAsT4::IsZero() const { return m_x[0]==Scalar(0.0) && m_x[1]==Scalar(0.0) && m_x[2]==Scalar(0.0) && m_x[3]==Scalar(0.0) && m_x[4]==Scalar(0.0) && m_x[5]==Scalar(0.0); } template typename ATOOLS::AutoDelete_Vector > CAsT4::s_objects; template CAsT4 *CAsT4::New() { #ifndef USING__Threading if (s_objects.empty()) #endif return new CAsT4(); CAsT4 *v(s_objects.back()); s_objects.pop_back(); return v; } template CAsT4 *CAsT4::New(const CAsT4 &s) { #ifndef USING__Threading if (s_objects.empty()) #endif return new CAsT4(s); CAsT4 *v(s_objects.back()); s_objects.pop_back(); *v=s; return v; } template CObject *CAsT4::Copy() const { return CAsT4::New(*this); } template void CAsT4::Delete() { #ifndef USING__Threading s_objects.push_back(this); #else delete this; #endif } namespace METOOLS { template class DCAsT4D; template CVec4 operator* (const CVec4 &v,const CAsT4 &t); template std::ostream &operator<<(std::ostream &ostr,const DCAsT4D &s); template class QCAsT4D; template CVec4 operator* (const CVec4 &v,const CAsT4 &t); template std::ostream &operator<<(std::ostream &ostr,const QCAsT4D &s); }