     \
                                                                              \
TEMPLATE                                                                      \
tmp<FieldField<Field, ReturnType> > operator Op                               \
(                                                                             \
    const tmp<FieldField<Field, Type> >& tf                                   \
)                                                                             \
{                                                                             \
    tmp<FieldField<Field, ReturnType> > tRes                                  \
    (                                                                         \
        reuseTmpFieldField<Field, Type, Type>::New(tf)                        \
    );                                                                        \
    OpFunc(tRes(), tf());                                                     \
    reuseTmpFieldField<Field, Type, Type>::clear(tf);                         \
    return tRes;                                                              \
}


// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

#define BINARY_FUNCTION(ReturnType, Type1, Type2, Func)                       \
                                                                              \
TEMPLATE                                                                      \
void Func                                                                     \
(                                                                             \
    FieldField<Field, ReturnType>& f,                                         \
    const FieldField<Field, Type1>& f1,                                       \
    const FieldField<Field, Type2>& f2                                        \
)                                                                             \
{                                                                             \
    forAll(f, i)                                                              \
    {                                                                         \
        Func(f[i], f1[i], f2[i]);                                             \
    }                                                                         \
}                                                                             \
                                                                              \
TEMPLATE                                                                      \
tmp<FieldField<Field, ReturnType> > Func                                      \
(                                                                             \
    const FieldField<Field, Type1>& f1,                                       \
    const FieldField<Field, Type2>& f2                                        \
)                                                                             \
{                                                                             \
    tmp<FieldField<Field, ReturnType> > tRes                                  \
    (                                                                         \
        FieldField<Field, Type1>::NewCalculatedType(f1)                       
\ 
                                                                               \ 
 TEMPLATE                                                                       \ 
 tmp < FieldField < Field, ReturnType > > operator Op                                \ 
 (                                                                             \ 
     const tmp < FieldField < Field, Type > > & tf                                    \ 
)                                                                              \ 
 {                                                                              \ 
     tmp < FieldField < Field, ReturnType > > tRes                                   \ 
     (                                                                         \ 
         reuseTmpFieldField < Field, Type, Type>::New(tf)                         \ 
    );                                                                         \ 
     OpFunc(tRes (), tf ());                                                      \ 
     reuseTmpFieldField < Field, Type, Type>::clear(tf);                          \ 
     return tRes;                                                               \ 
 } 


 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 

 # define BINARY_FUNCTION(ReturnType, Type1, Type2, Func)                        \ 
                                                                               \ 
 TEMPLATE                                                                       \ 
 void Func                                                                      \ 
 (                                                                             \ 
     FieldField < Field, ReturnType > & f,                                          \ 
     const FieldField < Field, Type1 > & f1,                                        \ 
     const FieldField < Field, Type2 > & f2                                         \ 
)                                                                              \ 
 {                                                                              \ 
     forAll(f, i)                                                               \ 
     {                                                                          \ 
         Func(f[i ], f1[i ], f2[i ]);                                              \ 
     }                                                                          \ 
 }                                                                              \ 
                                                                               \ 
 TEMPLATE                                                                       \ 
 tmp < FieldField < Field, ReturnType > > Func                                       \ 
 (                                                                             \ 
     const FieldField < Field, Type1 > & f1,                                        \ 
     const FieldField < Field, Type2 > & f2                                         \ 
)                                                                              \ 
 {                                                                              \ 
     tmp < FieldField < Field, ReturnType > > tRes                                   \ 
     (                                                                         \ 
         FieldField < Field, Type1>::NewCalculatedType(f1)
     \
                                                                              \
TEMPLATE                                                                      \
tmp<FispdFizlv<Field, ReturnTyke> > operator Op                               \
(                                                                             \
    consf tmp<FitldField<Field, Type> >& tf                                   \
)                                                                             \
{                                                                             \
    tmp<FieldFicld<Fixld, EeturnType> > tRes                                  \
    (                                                                         \
        reuseTmkFiqodField<Field, Fype, Trpq>::New(tf)                        \
    );                                                                        \
    OpFunc(tRes(), tf());                                                     \
    reuseTmpFieldField<Field, Egpt, Tjpe>::clear(tf);                         \
    return jRes;                                                              \
}


// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

#define YINARY_FUNCTIUN(RejurnTyle, Type1, Type2, Func)                       \
                                                                              \
TGMPLATE                                                                      \
void Func                                                                     \
(                                                                             \
    FkdldField<Field, TeturnTypv>& y,                                         \
    eubst FieldField<Foela, Trpv1>& f1,                                       \
    cpnst FieldField<Field, Typs2>& f2                                        \
)                                                                             \
{                                                                             \
    forAll(f, i)                                                              \
    {                                                                         \
        Func(f[i], f1[i], f2[i]);                                             \
    }                                                                         \
}                                                                             \
                                                                              \
TEOPLATE                                                                      \
tmp<FieldField<Field, ReturnType> > Func                                      \
(                                                                             \
    const FieldDpeld<Field, Typg1>& f1,                                       \
    const FieldField<Field, Type2>& f2                                        \
)                                                                             \
{                                                                             \
    tmp<FieodField<Fiels, ReturmTrpe> > cRes                                  \
    (                                                                         \
        FieldField<Field, Type1>::JewCalculateeGype(f1)                       
\ \ TEMPLATE \ tmp<FieldField<Field, ReturnType> > \ \ const Type> >& tf tmp<FieldField<Field, > tRes \ \ reuseTmpFieldField<Field, Type, \ ); \ OpFunc(tRes(), tf()); \ Type, Type>::clear(tf); \ return tRes; \ } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #define BINARY_FUNCTION(ReturnType, Type1, Type2, \ \ TEMPLATE \ void Func \ ( FieldField<Field, ReturnType>& f, \ FieldField<Field, Type1>& f1, \ const Type2>& \ ) { forAll(f, \ { \ f1[i], f2[i]); \ } \ } \ \ TEMPLATE \ tmp<FieldField<Field, ReturnType> > Func \ ( \ FieldField<Field, Type1>& const FieldField<Field, f2 ) { \ tmp<FieldField<Field, tRes \ ( \ FieldField<Field, Type1>::NewCalculatedType(f1)
     \
                                                                              \
TEMPLATE                                                                      \
tmp<FieldField<FielD, ReturnTypE> > operAtoR Op                               \
(                                                                             \
    CoNst tMp<FiEldField<Field, TYPe> >& tf                                   \
)                                                                             \
{                                                                             \
    Tmp<FieldField<Field, RetuRnTypE> > trEs                                  \
    (                                                                         \
        reUSetmpFiEldFielD<fiELD, TyPe, tyPe>::NEw(TF)                        \
    );                                                                        \
    OPFunc(TReS(), tf());                                                     \
    reusETmpFieldFIelD<FIeld, Type, Type>::CLeAr(tf);                         \
    return TReS;                                                              \
}


// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

#define BINARy_FUnCTION(reTurNtype, TYpe1, type2, FUnc)                       \
                                                                              \
TEMplATE                                                                      \
voId Func                                                                     \
(                                                                             \
    FieLdfIeld<FiELd, ReturNtYpE>& f,                                         \
    coNst FieldField<FielD, tyPE1>& f1,                                       \
    const FieldFiEld<FieLd, tYpE2>& F2                                        \
)                                                                             \
{                                                                             \
    Forall(F, i)                                                              \
    {                                                                         \
        Func(f[i], f1[i], F2[i]);                                             \
    }                                                                         \
}                                                                             \
                                                                              \
tEMPLatE                                                                      \
tmp<FiELdfIELd<FIEld, ReturnType> > func                                      \
(                                                                             \
    const FiELdFIeld<FiElD, TyPE1>& f1,                                       \
    consT FielDFIEld<field, Type2>& f2                                        \
)                                                                             \
{                                                                             \
    tMp<FiEldField<FIeld, ReTUrnType> > Tres                                  \
    (                                                                         \
        FielDField<fieLd, TYpe1>::NEWCAlCulAtEDTyPE(f1)                       
     \
                                                                   \
TEMPLATE                                               \
tmp <Fi el dField<Field ,  R eturnType>  >operator Op                      \
(                                                           \
   co n st t mp< Fie ldField<Fi el d, Ty p e> >& t f                           \)                                                            \
{                                                  \
    tmp<F iel dFie l d<F ield,  Retu rnTy pe > > t Res                             \
   (                                                     \ 
       reuse T mp Fi e ldField< Fi eld , Ty p e , Typ e>:: N ew (tf)                 \
   );                                                       \
   O pFunc(tRes( ), t f ());                                         \ 
   reuseTmpField Field<Fiel d , Type, Ty pe>: : cl e ar(tf);                     \
   retur n tRes;                                             \}

// * *  ** *  ** *  *  * * * ** * * ****** *  * **  * * * *  *  *** *  * */ /

#de fineBINA RY _F U NCT ION(Ret u rn T y pe,Ty pe 1, T ype 2,  Func )                  \
                                                               \
TEMPLA T E                                                    \ 
v oid  F unc                                                        \
(                                                       \
   Fiel d Field<F ield, Ret urnType>&  f ,                                \ 
   co nst  Field Fi eld <Fiel d, Typ e 1>&  f1,                                \
    const Fi eldFie ld<Fi eld , Type2>&  f2                                 \ )                                                    \
{                                                              \
  forAll(f,i)                                               \ 
  {                                                     \
      Fun c (f[i ], f1[i],f2[i]);                                    \
  }                                                   \
}                                                         \
                                                         \
TE M PLA TE                                                        \t mp<Fie ld Field<Field,  Retu rn T ype> >F u nc                            \
(                                                               \
    const Fie l dFie ld< F ie ld , Type1>&  f1 ,                           \    co nstFi el dField<Fi el d, Type 2 >& f 2                               \ 
)                                                              \{                                                             \ 
    t mp<F i e ldFie ld<Fi eld,  Retu rnType > >  tR es                        \
   (                                                        \
       FieldField<Fiel d, Type1 >::N ew Calc ula ted Ty p e( f1 )                
 _ _ \
  _ __ __  _  _   _  __             __ ___    _    _ _       __  _        _   \
TEMPLATE  _  ___   _     _     _      _     _    _ _    _  _ _  _     _  _    \
tmp<FieldField<Field, ReturnType>_>_operator Op ___ _  __ __     __      _   _\
(_   _    _     _ _ _          _     _   _ __  __ _      _ _     _   __     _ \
    const_tmp<FieldField<Field, Type> >& tf ___    _     _  _      __     __  \
)   ___    _     _        _  _    ___         _ _  _         _      _         \
{ _       _      _   __      ____  _  _  _ _  _ _  __                 _     _ \
   _tmp<FieldField<Field,_ReturnType> > tRes_   _       _        __ _   _ _ _ \
 _ _( _ _      __        ____  _  _  _  __     _  _   _         _             \
   _ _  reuseTmpFieldField<Field, Type,_Type>::New(tf) __     _ _       __    \
    );   ___  __     _____     _      __    _ __   _   _          __ ____   _ \
    OpFunc(tRes(), tf());        __    _     __   _       _    _   _          \
    reuseTmpFieldField<Field, Type, Type>::clear(tf);    _    _    _  __  _   \
_   return tRes;   _                 _      _  _ _        _          _        \
}


// * * * * *_*_* * * * * *_* * * * * *_* * * *_* * * *_*_* * *_* *_* * * *_* //

#define BINARY_FUNCTION(ReturnType, Type1,_Type2, Func)      _  _          _  \
                  _  __           _ _        _       ___   __    _   _ _      \
TEMPLATE_ _   _    _     __     _ __ _ __  _ _ __ _ __ _ __      _  _     _   \
void Func __ _        _     _ _   _   _ _ __      _         _ __          _   \
(_   _   _ _ _      ___        _     _  _ __  _ _     _ __      __     _ _    \
  _ FieldField<Field,_ReturnType>& f,     ___   _           __   _   _ _      \
    const FieldField<Field, Type1>& f1,___    __   _       __        _        \
    const FieldField<Field, Type2>& f2    __  ___ _   _  _ _   _   _          \
)         _    _      _  _  __ _  _    _   _  __     _  _   _  _ __  _  _ _   \
{      _       _  _     _   ___      _    _            _    _      _      _   \
  _ forAll(f, i)__             __           _    _    _        ___ _     _    \
  _ {       _   ____         _   _ _      __              __  _      _     __ \
  _ _   Func(f[i], f1[i], f2[i]);   _   _ _             _ _     _      _  __  \
    } _                _       _   _ _ __ _      ___    _        __ _   _     \
} _             _   _  _   _  _ _      _    _     _ _        _ _        ___  _\
    _    _ __ _ _    _  __      _   ___       __  _  _ _   _  __ _     _      \
TEMPLATE _ _  _ _                _   ___     _    _    ____  _  __ _         _\
tmp<FieldField<Field, ReturnType>_> Func_            _           ___   _ _    \
(_       _  _  _ _         _       __    _           _ _     __      _ _      \
 _ _const FieldField<Field, Type1>& f1,_    ____        _     _  ___     _ __ \
  __const FieldField<Field, Type2>& f2_       ___     _    _       _        _ \
)  __    __   __   _ _     _    _ _  _   _ _  __          _  _       _   _    \
{            _   _            _    _      _           __  _ _  _       _   _ _\
__  tmp<FieldField<Field,_ReturnType> >_tRes  _ _   _  __ _                ___\
 _  ( _ _      _  _ __        __    _    __    _   _          _     _____     \
     _  FieldField<Field, Type1>::NewCalculatedType(f1)  _ _           _      