source: XIOS2/trunk/src/transformation/Functions/average_reduction.hpp @ 2428

Last change on this file since 2428 was 1704, checked in by yushan, 5 years ago

Introducing the new graph functionality. Attribute build_workflow_graph=.TRUE. is used in the field definition section in the xml file to enable the workflow graph of the field and other fields referecing to it. A more detailed document will be available soon on the graph fuctionality.

File size: 1.1 KB
Line 
1/*!
2   \file average.hpp
3   \author Ha NGUYEN
4   \since 8 Sep 2016
5   \date 8 Sep 2016
6
7   \brief Average reduction
8 */
9#ifndef __XIOS_REDUCTION_AVERAGE_ALGORITHM_HPP__
10#define __XIOS_REDUCTION_AVERAGE_ALGORITHM_HPP__
11
12#include "reduction.hpp"
13
14namespace xios {
15
16/*!
17  \class CAverageReductionAlgorithm
18  Interface for all reduction alogrithms.
19*/
20class CAverageReductionAlgorithm : public CReductionAlgorithm
21{
22public:
23  CAverageReductionAlgorithm();
24
25  virtual void apply(const std::vector<std::pair<int,double> >& localIndex,
26                     const double* dataInput,
27                     CArray<double,1>& dataOut,
28                     std::vector<bool>& flagInitial,                     
29                     bool ignoreMissingValue, bool firstPass);
30
31  virtual void updateData(CArray<double,1>& dataOut);
32
33  virtual ~CAverageReductionAlgorithm() {}
34
35  virtual StdString getName() {return "Average reduction";}
36
37protected:
38  CArray<double,1> weights_;
39  bool resetWeight_;
40
41public:
42  static bool registerTrans();
43
44protected:
45  static CReductionAlgorithm* create();
46};
47
48}
49#endif // __XIOS_REDUCTION_AVERAGE_ALGORITHM_HPP__
Note: See TracBrowser for help on using the repository browser.