00001
00040 #ifndef __MIX_2D__
00041 #define __MIX_2D__
00042
00043 namespace Function_2D{
00044
00045
00046 template<typename Function1,typename Function2>
00047 class Minus{
00048
00049 public:
00050 typedef double real_type;
00051
00052 Minus(Function1& f1,
00053 Function2& f2);
00054
00055 inline real_type operator()(const real_type x,
00056 const real_type y) const;
00057
00058 private:
00059 Function1& f;
00060 Function2& g;
00061 };
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077 template<typename Function1,typename Function2>
00078 Minus<Function1,Function2>::Minus(Function1& f1,
00079 Function2& f2):
00080 f(f1),g(f2){}
00081
00082
00083 template<typename Function1,typename Function2>
00084 typename Minus<Function1,Function2>::real_type
00085 Minus<Function1,Function2>::
00086 operator()(const real_type x,
00087 const real_type y) const{
00088
00089 return f(x,y) - g(x,y);
00090 }
00091
00092 }
00093
00094 #endif