[624] | 1 | /*! |
---|
| 2 | \file generic_algorithm_transformation.hpp |
---|
| 3 | \author Ha NGUYEN |
---|
| 4 | \since 14 May 2015 |
---|
[630] | 5 | \date 29 June 2015 |
---|
[624] | 6 | |
---|
| 7 | \brief Interface for all transformation algorithms. |
---|
| 8 | */ |
---|
[620] | 9 | #ifndef __XIOS_GENERIC_ALGORITHM_TRANSFORMATION_HPP__ |
---|
| 10 | #define __XIOS_GENERIC_ALGORITHM_TRANSFORMATION_HPP__ |
---|
| 11 | |
---|
| 12 | #include <map> |
---|
[630] | 13 | #include <set> |
---|
[620] | 14 | #include "array_new.hpp" |
---|
[866] | 15 | #include "client_client_dht_template.hpp" |
---|
[1984] | 16 | #include "local_view.hpp" |
---|
| 17 | #include "transform_connector.hpp" |
---|
| 18 | #include "weight_transform_connector.hpp" |
---|
[620] | 19 | |
---|
[1984] | 20 | namespace xios |
---|
| 21 | { |
---|
[862] | 22 | class CGrid; |
---|
| 23 | class CDomain; |
---|
| 24 | class CAxis; |
---|
[888] | 25 | class CScalar; |
---|
[1999] | 26 | class CGridAlgorithm ; |
---|
[2007] | 27 | class CTransformFilter ; |
---|
| 28 | class CGarbageCollector ; |
---|
[862] | 29 | |
---|
[624] | 30 | /*! |
---|
| 31 | \class CGenericAlgorithmTransformation |
---|
[933] | 32 | This class defines the interface for all other inherited algorithms class |
---|
[624] | 33 | */ |
---|
[2270] | 34 | class CGenericAlgorithmTransformation : public std::enable_shared_from_this<CGenericAlgorithmTransformation> |
---|
[620] | 35 | { |
---|
[1984] | 36 | public : |
---|
[2011] | 37 | CGenericAlgorithmTransformation(bool isSource) ; |
---|
[2270] | 38 | virtual shared_ptr<CGridAlgorithm> createGridAlgorithm(CGrid* gridSrc, CGrid* newGrid, int pos) ; |
---|
| 39 | virtual CTransformFilter* createTransformFilter(CGarbageCollector& gc, shared_ptr<CGridAlgorithm> algo, bool detectMissingValues, double defaultValue) ; |
---|
[2011] | 40 | virtual void apply(int dimBefore, int dimAfter, const CArray<double,1>& dataIn, CArray<double,1>& dataOut) { abort() ;} //=0 |
---|
| 41 | virtual void apply(int dimBefore, int dimAfter, const CArray<double,1>& dataIn, const vector<CArray<double,1>>& auxData, CArray<double,1>& dataOut) { abort() ;} //=0 |
---|
[2016] | 42 | virtual bool isGenerateTransformation(void) { return false ;} |
---|
[2145] | 43 | virtual StdString getAlgoName() { return "\\nGeneric algorithm transformation";} |
---|
[2122] | 44 | virtual bool transformAuxField(int pos) { return true ;} |
---|
[2011] | 45 | virtual vector<string> getAuxFieldId(void) ; |
---|
[1999] | 46 | protected : |
---|
[2011] | 47 | typedef std::unordered_map<int, std::vector<int> > TransformationIndexMap; |
---|
| 48 | typedef std::unordered_map<int, std::vector<double> > TransformationWeightMap; |
---|
| 49 | |
---|
[2267] | 50 | shared_ptr<CLocalElement> recvElement_ ; |
---|
[2011] | 51 | bool isSource_ ; |
---|
[1999] | 52 | |
---|
| 53 | public: |
---|
[2267] | 54 | shared_ptr<CLocalElement> getRecvElement(void) { return recvElement_ ;} |
---|
[1999] | 55 | |
---|
[620] | 56 | }; |
---|
| 57 | |
---|
| 58 | } |
---|
| 59 | #endif // __XIOS_GENERIC_ALGORITHM_TRANSFORMATION_HPP__ |
---|