synaps/arithm/texp-macros.h

00001 
00002 #define TEXP_DCL2(OP,X,Y) texp< texpb< OP, texp<X >, texp<Y> > >
00003 #define TEXP_RETURN2(OP,X,Y,a,b) return texp< texpb< OP, texp<X >, texp<Y> > > ( texp<X>(a), texp<Y>(b) )
00004 #define TEXP_NEG(HEAD,X)\
00005   HEAD inline texp< texpu< _neg_, texp<X> > >\
00006   operator-( const X & x )\
00007   { return texp< texpu< _neg_, texp<X> > >( texp<X>(x) ); };
00008 
00009 #define TEXP_ADD(HEAD,X,Y)\
00010 HEAD inline texp< texpb< _add_ , texp< X >, texp< Y > > >\
00011 operator+( const X & x, const Y & y )\
00012 { return texp< texpb< _add_, texp< X >, texp< Y > > >(texp< X >(x),texp< Y >(y)); };\
00013 HEAD inline texp< texpb< _add_ , texp< X >, texp< Y > > >\
00014 operator+( const texp<X> & x, const Y & y )\
00015 { return texp< texpb< _add_, texp< X >, texp< Y > > >(x,texp<Y>(y)); };\
00016 HEAD inline texp< texpb< _add_ , texp< X >, texp< Y > > >\
00017 operator+( const X & x, const texp<Y> & y )\
00018 { return texp< texpb< _add_, texp< X >, texp< Y > > >(texp< X >(x),y); }
00019 
00020 #define TEXP_SUB(HEAD,X,Y)\
00021 HEAD inline texp< texpb< _sub_ , texp< X >, texp< Y > > >\
00022 operator-( const X & x, const Y & y )\
00023 { return texp< texpb< _sub_, texp< X >, texp< Y > > >(texp< X >(x),texp< Y >(y)); };\
00024 HEAD inline texp< texpb< _sub_ , texp< X >, texp< Y > > >\
00025 operator-( const texp<X> & x, const Y & y )\
00026 { return texp< texpb< _sub_, texp< X >, texp< Y > > >(x,texp< Y >(y)); };\
00027 HEAD inline texp< texpb< _sub_ , texp< X >, texp< Y > > >\
00028 operator-( const X & x, const texp<Y> & y )\
00029 { return texp< texpb< _sub_, texp< X >, texp< Y > > >(texp<X>(x),y); };
00030 
00031 #define TEXP_MUL(HEAD,X,Y)\
00032 HEAD inline texp< texpb< _mul_ , texp< X >, texp< Y > > >\
00033 operator*( const X & x, const Y & y )\
00034 { return texp< texpb< _mul_, texp< X >, texp< Y > > >(texp< X >(x),texp< Y >(y)); };\
00035 HEAD inline texp< texpb< _mul_ , texp< X >, texp< Y > > >\
00036 operator*( const texp<X> & x, const Y & y )\
00037 { return texp< texpb< _mul_, texp< X >, texp< Y > > >(x,texp< Y >(y)); };\
00038 HEAD inline texp< texpb< _mul_ , texp< X >, texp< Y > > >\
00039 operator*( const X & x, const texp<Y> & y )\
00040 { return texp< texpb< _mul_, texp< X >, texp< Y > > >(texp< X >(x),y); };
00041 
00042 #define TEXP_DIV(HEAD,X,Y)\
00043 HEAD inline texp< texpb< _div_ , texp< X >, texp< Y > > >\
00044 operator/( const X & x, const Y & y )\
00045 { return texp< texpb< _div_, texp< X >, texp< Y > > >(texp< X >(x),texp< Y >(y)); };\
00046 HEAD inline texp< texpb< _div_ , texp< X >, texp< Y > > >\
00047 operator/( const texp<X> & x, const Y & y )\
00048 { return texp< texpb< _div_, texp< X >, texp< Y > > >(x,texp< Y >(y)); };\
00049 HEAD inline texp< texpb< _div_ , texp< X >, texp< Y > > >\
00050 operator/( const X & x, const texp<Y> & y )\
00051 { return texp< texpb< _div_, texp< X >, texp< Y > > >(texp< X >(x),y); };
00052 
00053 #define TEXP_POW(HEAD,X,Y)\
00054 HEAD inline texp< texpb< _pow_, texp<X>, texp<Y> > >\
00055 operator^( const X & x, const Y & y )\
00056 { return texp< texpb< _pow_, texp<X>, texp<Y> > >( texp<X>(x), texp<Y>(y) ); };\
00057 HEAD inline texp< texpb< _pow_, texp<X>, texp<Y> > >\
00058 operator^( const texp<X> & x, const Y & y )\
00059 { return texp< texpb< _pow_, texp<X>, texp<Y> > >( x, texp<Y>(y) ); };\
00060 HEAD inline texp< texpb< _pow_, texp<X>, texp<Y> > >\
00061 operator^( const X & x, const texp<Y> & y )\
00062 { return texp< texpb< _pow_, texp<X>, texp<Y> > >( texp<X>(x), y ); }\
00063 
00064 #define TEXP_MOD(HEAD,X,Y)\
00065 HEAD inline texp< texpb< _mod_, texp<X>, texp<Y> > >\
00066 operator%( const X & x, const Y & y )\
00067 { return texp< texpb< _mod_, texp<X>, texp<Y> > >( texp<X>(x), texp<Y>(y) ); };\
00068 HEAD inline texp< texpb< _mod_, texp<X>, texp<Y> > >\
00069 operator%( const texp<X> & x, const Y & y )\
00070 { return texp< texpb< _mod_, texp<X>, texp<Y> > >( x, texp<Y>(y) ); };\
00071 HEAD inline texp< texpb< _mod_, texp<X>, texp<Y> > >\
00072 operator%( const X & x, const texp<Y> & y )\
00073 { return texp< texpb< _mod_, texp<X>, texp<Y> > >( texp<X>(x), y ); }

SYNAPS DOCUMENTATION
logo