Changeset 1158 for XIOS/dev/dev_olga/src/functor
- Timestamp:
- 06/06/17 17:58:16 (7 years ago)
- Location:
- XIOS/dev/dev_olga/src/functor
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_olga/src/functor/accumulate.cpp
r591 r1158 1 1 #include "accumulate.hpp" 2 2 #include "array_new.hpp" 3 #include "utils.hpp" 3 4 4 5 namespace xios … … 33 34 double* out=_doutput.dataFirst(); 34 35 for (i=0; i<n; ++i,++in,++out) 35 if ( *in!=missingValue)36 if (!NumTraits<double>::isnan(*in)) 36 37 { 37 if( *out!=missingValue) *out += *in;38 if(!NumTraits<double>::isnan(*out)) *out += *in; 38 39 else *out=*in ; 39 40 } -
XIOS/dev/dev_olga/src/functor/average.cpp
r591 r1158 1 1 #include "average.hpp" 2 2 #include "array_new.hpp" 3 #include "utils.hpp" 3 4 4 5 namespace xios … … 42 43 int* nc=nbcalls.dataFirst() ; 43 44 for (i=0; i<n; ++i,++nc,++in) 44 if ( *in!=missingValue) (*nc) ++;45 if (!NumTraits<double>::isnan(*in)) (*nc) ++; 45 46 } 46 47 } … … 54 55 int* nc=nbcalls.dataFirst() ; 55 56 for (i=0; i<n; ++i,++in,++out,++nc) 56 if ( *in!=missingValue)57 if (!NumTraits<double>::isnan(*in)) 57 58 { 58 59 if (*nc != 0) (*out) += *in; -
XIOS/dev/dev_olga/src/functor/maximum.cpp
r591 r1158 1 1 #include "maximum.hpp" 2 2 #include "array_new.hpp" 3 4 3 #include "utils.hpp" 5 4 6 5 namespace xios … … 35 34 { 36 35 for (; it1 != end1; it1++, it++) 37 if ( *it1 != missingValue)36 if (!NumTraits<double>::isnan(*it1)) 38 37 { 39 if ( *it != missingValue) *it = std::max(*it1, *it);38 if (!NumTraits<double>::isnan(*it)) *it = std::max(*it1, *it); 40 39 else *it=*it1 ; 41 40 } -
XIOS/dev/dev_olga/src/functor/minimum.cpp
r591 r1158 2 2 #include "array_new.hpp" 3 3 #include <algorithm> 4 #include "utils.hpp" 4 5 5 6 namespace xios … … 26 27 { 27 28 const double * it1 = _dinput.dataFirst(), 28 * 29 *end1 = _dinput.dataFirst() + _dinput.numElements(); 29 30 double * it = _doutput.dataFirst(); 30 31 … … 35 36 { 36 37 for (; it1 != end1; it1++, it++) 37 if ( *it1!=missingValue)38 if (!NumTraits<double>::isnan(*it1)) 38 39 { 39 if ( *it != missingValue) *it = std::min(*it1, *it);40 if (!NumTraits<double>::isnan(*it)) *it = std::min(*it1, *it); 40 41 else *it=*it1 ; 41 42 }
Note: See TracChangeset
for help on using the changeset viewer.