00001 #ifndef OPENTISSUE_CORE_MATH_INTERPOLATION_INTERPOLATION_BASE_INTERPOLATOR_H 00002 #define OPENTISSUE_CORE_MATH_INTERPOLATION_INTERPOLATION_BASE_INTERPOLATOR_H 00003 // 00004 // OpenTissue Template Library 00005 // - A generic toolbox for physics-based modeling and simulation. 00006 // Copyright (C) 2008 Department of Computer Science, University of Copenhagen. 00007 // 00008 // OTTL is licensed under zlib: http://opensource.org/licenses/zlib-license.php 00009 // 00010 #include <OpenTissue/configuration.h> 00011 00012 00013 namespace OpenTissue 00014 { 00015 00016 namespace interpolation 00017 { 00018 00028 template<typename child_type_,typename real_type_> 00029 class BaseInterpolator 00030 { 00031 public: 00032 00033 typedef child_type_ child_type; 00034 typedef real_type_ real_type; 00035 00036 public: 00052 void set_tableau(real_type * x,real_type * y,int cnt) 00053 { 00054 child_type & self = static_cast<child_type &>(*this); 00055 self.set_tableau(x,y,cnt); 00056 } 00057 00069 real_type get_value(real_type const & x) 00070 { 00071 child_type & self = static_cast<child_type &>(*this); 00072 return self.get_value(x); 00073 } 00074 00083 real_type get_error_estimate() 00084 { 00085 child_type & self = static_cast<child_type &>(*this); 00086 return self.get_error_estimate(); 00087 } 00088 00089 }; 00090 00091 } // namespace interpolation 00092 00093 } // namespace OpenTissue 00094 00095 //OPENTISSUE_CORE_MATH_INTERPOLATION_INTERPOLATION_BASE_INTERPOLATOR_H 00096 #endif