Last change
on this file since 1614 was
1260,
checked in by ymipsl, 7 years ago
|
Buf fix in reduction. Missing value update was not set correctly
YM
|
File size:
1.1 KB
|
Rev | Line | |
---|
[895] | 1 | /*! |
---|
| 2 | \file extract.cpp |
---|
| 3 | \author Ha NGUYEN |
---|
| 4 | \since 27 June 2016 |
---|
| 5 | \date 27 June 2016 |
---|
| 6 | |
---|
| 7 | \brief extract reduction |
---|
| 8 | */ |
---|
| 9 | #include "extract.hpp" |
---|
| 10 | |
---|
| 11 | namespace xios { |
---|
| 12 | |
---|
| 13 | CExtractReductionAlgorithm::CExtractReductionAlgorithm() |
---|
| 14 | : CReductionAlgorithm() |
---|
| 15 | { |
---|
| 16 | } |
---|
| 17 | |
---|
| 18 | CReductionAlgorithm* CExtractReductionAlgorithm::create() |
---|
| 19 | { |
---|
| 20 | return (new CExtractReductionAlgorithm()); |
---|
| 21 | } |
---|
| 22 | |
---|
| 23 | bool CExtractReductionAlgorithm::registerTrans() |
---|
| 24 | { |
---|
| 25 | return registerOperation(TRANS_REDUCE_EXTRACT, CExtractReductionAlgorithm::create); |
---|
| 26 | } |
---|
| 27 | |
---|
| 28 | void CExtractReductionAlgorithm::apply(const std::vector<std::pair<int,double> >& localIndex, |
---|
| 29 | const double* dataInput, |
---|
| 30 | CArray<double,1>& dataOut, |
---|
[1158] | 31 | std::vector<bool>& flagInitial, |
---|
[1260] | 32 | bool ignoreMissingValue, bool firstPass) |
---|
[895] | 33 | { |
---|
| 34 | int nbLocalIndex = localIndex.size(); |
---|
| 35 | int currentlocalIndex = 0; |
---|
| 36 | for (int idx = 0; idx < nbLocalIndex; ++idx) |
---|
| 37 | { |
---|
| 38 | currentlocalIndex = localIndex[idx].first; |
---|
| 39 | dataOut(currentlocalIndex) = *(dataInput + idx); |
---|
| 40 | } |
---|
| 41 | } |
---|
| 42 | |
---|
| 43 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.