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
|
Rev | Line | |
---|
[630] | 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 | |
---|
| 16 | namespace xios { |
---|
| 17 | /*! |
---|
| 18 | \class CAxisAlgorithmInterpolate |
---|
| 19 | Implementing interpolation on axis |
---|
| 20 | The values on axis source are assumed monotonic |
---|
| 21 | */ |
---|
| 22 | class CAxisAlgorithmInterpolate : public CAxisAlgorithmTransformation |
---|
| 23 | { |
---|
| 24 | public: |
---|
| 25 | CAxisAlgorithmInterpolate(CAxis* axisDestination, CAxis* axisSource, CInterpolateAxis* interpAxis); |
---|
| 26 | |
---|
| 27 | virtual ~CAxisAlgorithmInterpolate() {} |
---|
| 28 | |
---|
| 29 | virtual void computeIndexSourceMapping(); |
---|
| 30 | |
---|
| 31 | private: |
---|
| 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 | |
---|
| 36 | private: |
---|
| 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.