source: XIOS/trunk/src/transformation/axis_algorithm_interpolate.hpp @ 631

Last change on this file since 631 was 630, checked in by mhnguyen, 9 years ago

Implementing interpolation (polynomial) and correct some bugs

+) Implement interpolation (polynomial)
+) Correct some minor bugs relating to memory allocation
+) Clear some redundant codes

Test
+) On Curie
+) test_client and test_complete pass

File size: 1.2 KB
Line 
1/*!
2   \file axis_algorithm_interpolate.hpp
3   \author Ha NGUYEN
4   \since 23 June 2015
5   \date 23 June 2015
6
7   \brief Algorithm for interpolation on an axis.
8 */
9#ifndef __XIOS_AXIS_ALGORITHM_INTERPOLATE_HPP__
10#define __XIOS_AXIS_ALGORITHM_INTERPOLATE_HPP__
11
12#include "axis_algorithm_transformation.hpp"
13#include "axis.hpp"
14#include "interpolate_axis.hpp"
15
16namespace xios {
17/*!
18  \class CAxisAlgorithmInterpolate
19  Implementing interpolation on axis
20  The values on axis source are assumed monotonic
21*/
22class CAxisAlgorithmInterpolate : public CAxisAlgorithmTransformation
23{
24public:
25  CAxisAlgorithmInterpolate(CAxis* axisDestination, CAxis* axisSource, CInterpolateAxis* interpAxis);
26
27  virtual ~CAxisAlgorithmInterpolate() {}
28
29  virtual void computeIndexSourceMapping();
30
31private:
32  void retrieveAllAxisValue(std::vector<double>& recvBuff, std::vector<int>& indexVec);
33  void computeInterpolantPoint(const std::vector<double>& recvBuff, const std::vector<int>& indexVec);
34  void computeWeightedValueAndMapping(const std::map<int, std::vector<std::pair<int,double> > >& interpolatingIndexValues);
35
36private:
37  // Interpolation order
38  int order_;
39};
40
41}
42#endif // __XIOS_AXIS_ALGORITHM_INTERPOLATE_HPP__
Note: See TracBrowser for help on using the repository browser.