Files Classes Functions Hierarchy
00001 #ifndef LINEPATHD1_H 00002 #define LINEPATHD1_H 00003 00004 //#include <cassert> 00005 //#include <iostream> 00006 00007 //using namespace std; 00008 00009 #include <typeop.h> 00010 00022 template< typename FN, typename XI, typename X, typename T > 00023 class linepath_d1 00024 { 00025 public: 00026 00028 uintc dim; 00029 00031 typename typeop<FN>::Tref fn; 00033 XI xi; 00035 X x0; 00037 X di; 00038 00039 linepath_d1 00040 ( 00041 uintc dim_, 00042 typename typeop<FN>::Tref fn_, 00043 XI xi_, 00044 X x0_, 00045 X di_ 00046 ); 00047 00049 void eval(T const t) 00050 { 00051 for (uint i=0; i<dim; ++i) 00052 xi[i] = x0[i]+di[i]*t; 00053 //cout << "***"; 00054 //cout << printvecfunc(xi,dim) << endl; 00055 } 00057 void eval(T& fval, T const t) 00058 { eval(t); fn(fval); } 00060 //void fneval(T& fval) 00061 // { fn(fval); } 00062 00064 ostream & print(ostream & os) const; 00065 00066 }; 00067 00068 00069 //----------------------------------------------- 00070 // Implementation 00071 00072 00073 template< typename FN, typename XI, typename X, typename T > 00074 ostream & linepath_d1<FN,XI,X,T>::print(ostream & os) const 00075 { 00076 os << "dim=" << dim << endl; 00077 os << "xi[]=" << printvecfunc(xi,dim) << endl; 00078 os << "x0[]=" << printvecfunc(x0,dim) << endl; 00079 os << "di[]=" << printvecfunc(di,dim) << endl; 00080 00081 return os; 00082 } 00083 00084 template< typename FN, typename XI, typename X, typename T > 00085 linepath_d1<FN,XI,X,T>::linepath_d1 00086 ( 00087 uintc dim_, 00088 typename typeop<FN>::Tref fn_, 00089 XI xi_, 00090 X x0_, 00091 X di_ 00092 ) 00093 : dim(dim_), fn(fn_), xi(xi_), x0(x0_), di(di_) 00094 { 00095 } 00096 00097 00098 00099 00100 00101 00102 #endif 00103 00104
1.5.8