00001 00002 00008 /* 00009 */ 00011 00012 #ifndef __SSF_LINEAR_INTERPOLATOR_H__ 00013 #define __SSF_LINEAR_INTERPOLATOR_H__ 00014 00015 #include <Matrix.h> 00016 #include "Interpolator.h" 00017 00018 namespace O_SESSAME { 00043 class LinearInterpolator : public Interpolator 00044 { 00045 public: 00049 LinearInterpolator(); 00050 00055 LinearInterpolator(const Vector& _timePoints, const Matrix& _dataPoints); 00056 00060 virtual ~LinearInterpolator(); 00061 00073 virtual void Interpolate(const Vector& _timePoints, const Matrix& _dataPoints); 00074 00081 virtual Vector Evaluate(const double& _inputPoint); 00082 00088 virtual int GetNumberDataPoints() {return m_NumDataPoints;}; 00089 00097 virtual LinearInterpolator* NewPointer(); 00105 virtual LinearInterpolator* Clone(); 00106 00107 protected: 00113 void BuildLinearInterpolation(const double& _x1, const double& _y1, const double& _x2, const double& _y2, double& _Slope, double& _Offset); 00114 00116 virtual void SetNumberDataPoints(const int& _numberDataPoints) {}; 00117 private: 00119 int m_NumDataPoints; 00121 int m_NumElements; 00123 Vector m_Slope; 00125 Vector m_Offset; 00126 Vector m_tempOutput; // this is faster, but larger could be a problem for big histories 00127 }; 00128 } // close namespace O_SESSAME 00129 00130 #endif 00131 00132 00133 // Do not change the comments below - they will be added automatically by CVS 00134 /***************************************************************************** 00135 * $Log: LinearInterpolator.h,v $ 00136 * Revision 1.2 2003/06/06 00:34:47 nilspace 00137 * ? 00138 * 00139 * Revision 1.1 2003/05/13 18:42:08 nilspace 00140 * Initial Submission. 00141 * 00142 * 00143 ******************************************************************************/