InterpolationUtil.h

00001 #ifndef gridripper_math_InterpolationUtil_h
00002 #define gridripper_math_InterpolationUtil_h
00003 
00004 
00005 #include <gridripper/tvalarray.h>
00006 #include <gridripper/math.h>
00007 #include <gridripper/lang/IllegalArgumentException.h>
00008 
00009 
00010 namespace gridripper { namespace math {
00011 
00012 
00019 class InterpolationUtil
00020 {
00021 
00022     public:
00023 
00032         static void resizeLinear(const tvalarray<GReal_t>& xarr, const tvalarray<GReal_t>& data,
00033                                         tvalarray<GReal_t>& oxarr, tvalarray<GReal_t>& odata)
00034                 throw(IllegalArgumentException&);
00035 
00045         static void resizeLinear(const tvalarray<int>& xarr, const tvalarray<GReal_t>& data,
00046                                         tvalarray<int>& oxarr, tvalarray<GReal_t>& odata)
00047                 throw(IllegalArgumentException&);
00048 
00059         static void resizeCubic(const tvalarray<GReal_t>& xarr, const tvalarray<GReal_t>& data,
00060                                         tvalarray<GReal_t>& oxarr, tvalarray<GReal_t>& odata)
00061                 throw(IllegalArgumentException&);
00062 
00074         static void resizeCubic(const tvalarray<int>& xarr, const tvalarray<GReal_t>& data,
00075                                         tvalarray<int>& oxarr, tvalarray<GReal_t>& odata)
00076                 throw(IllegalArgumentException&);
00077 
00088         static void resizeQuintic(const tvalarray<GReal_t>& xarr, const tvalarray<GReal_t>& data,
00089                                         tvalarray<GReal_t>& oxarr, tvalarray<GReal_t>& odata)
00090                 throw(IllegalArgumentException&);
00091 
00103         static void resizeQuintic(const tvalarray<int>& xarr, const tvalarray<GReal_t>& data,
00104                                         tvalarray<int>& oxarr, tvalarray<GReal_t>& odata)
00105                 throw(IllegalArgumentException&);
00106 
00121         static void cubicCoeff12(GReal_t x, GReal_t x0, GReal_t x1,
00122                                         GReal_t x2, GReal_t x3, GReal_t* w);
00123 
00136         static void quadraticCoeff01(GReal_t x,
00137                                         GReal_t x0, GReal_t x1, GReal_t x2,
00138                                         GReal_t* w);
00139 
00152         static void quadraticCoeff23(GReal_t x, GReal_t x1, GReal_t x2,
00153                                                 GReal_t x3, GReal_t* w);
00154 
00171         static void quinticCoeff23(GReal_t x, GReal_t x0, GReal_t x1,
00172                         GReal_t x2, GReal_t x3, GReal_t x4, GReal_t x5, GReal_t* w);
00173 
00188         static void quarticCoeff12(GReal_t x, GReal_t x0, GReal_t x1,
00189                                         GReal_t x2, GReal_t x3, GReal_t x4,
00190                                         GReal_t* w);
00191 
00206         static void quarticCoeff01(GReal_t x, GReal_t x0, GReal_t x1,
00207                                         GReal_t x2, GReal_t x3, GReal_t x4,
00208                                         GReal_t* w);
00209 
00224         static void quarticCoeff34(GReal_t x, GReal_t x1, GReal_t x2,
00225                                         GReal_t x3, GReal_t x4, GReal_t x5,
00226                                         GReal_t* w);
00227 
00242         static void quarticCoeff45(GReal_t x, GReal_t x1, GReal_t x2,
00243                                         GReal_t x3, GReal_t x4, GReal_t x5,
00244                                         GReal_t* w);
00245 
00246     private:
00247 
00248         static void checkResizeArgs(int xarrlen, int datalen,
00249                                                 int oxarrlen, int odatalen,
00250                                                 int nc, int mul)
00251                 throw(IllegalArgumentException&);
00252 
00253         static void copyData(int i,
00254                                 const tvalarray<GReal_t>& xarr, const tvalarray<GReal_t>& data, int nc,
00255                                 tvalarray<GReal_t>& oxarr, tvalarray<GReal_t>& odata, int mul);
00256 
00257         static void copyData(int i, const tvalarray<int>& xarr, const tvalarray<GReal_t>& data, int nc,
00258                                         tvalarray<int>& oxarr, tvalarray<GReal_t>& odata, int mul);
00259 
00260         static void leftQuadratic(GReal_t x,
00261                 GReal_t x0, GReal_t x1, GReal_t x2, GReal_t* w,
00262                 const tvalarray<GReal_t>& data, int nc, tvalarray<GReal_t>& odata, int ooff);
00263 
00264         static void centralCubic(GReal_t x,
00265                 GReal_t x0, GReal_t x1, GReal_t x2, GReal_t x3, GReal_t* w,
00266                 const tvalarray<GReal_t>& data, int nc, int off, tvalarray<GReal_t>& odata, int ooff);
00267 
00268         static void rightQuadratic(GReal_t x,
00269                 GReal_t x1, GReal_t x2, GReal_t x3, GReal_t* w,
00270                 const tvalarray<GReal_t>& data, int nc, tvalarray<GReal_t>& odata, int ooff);
00271 
00272         static void leftQuartic2(GReal_t x, GReal_t x0, GReal_t x1, GReal_t x2,
00273                 GReal_t x3, GReal_t x4, GReal_t* w,
00274                 const tvalarray<GReal_t>& data, int nc, tvalarray<GReal_t>& odata, int ooff);
00275 
00276         static void leftQuartic1(GReal_t x, GReal_t x0, GReal_t x1, GReal_t x2,
00277                 GReal_t x3, GReal_t x4, GReal_t* w,
00278                 const tvalarray<GReal_t>& data, int nc, tvalarray<GReal_t>& odata, int ooff);
00279 
00280         static void centralQuintic(GReal_t x, GReal_t x0, GReal_t x1,
00281                 GReal_t x2, GReal_t x3, GReal_t x4, GReal_t x5, GReal_t* w,
00282                 const tvalarray<GReal_t>& data, int nc, int off, tvalarray<GReal_t>& odata, int ooff);
00283 
00284         static void rightQuartic1(GReal_t x, GReal_t x1, GReal_t x2,
00285                 GReal_t x3, GReal_t x4, GReal_t x5, GReal_t* w,
00286                 const tvalarray<GReal_t>& data, int nc, tvalarray<GReal_t>& odata, int ooff);
00287 
00288         static void rightQuartic2(GReal_t x, GReal_t x1, GReal_t x2,
00289                 GReal_t x3, GReal_t x4, GReal_t x5, GReal_t* w,
00290                 const tvalarray<GReal_t>& data, int nc, tvalarray<GReal_t>& odata, int ooff);
00291 
00292 };
00293 
00294 
00295 } } // namespace gridripper::math
00296 
00297 
00298 #endif /* gridripper_math_InterpolationUtil_h */

Generated on Wed Jun 17 18:46:47 2009 for GridRipper by  doxygen 1.5.6