Changeset 266 for XMLIO_V2/dev/common/src/xmlio/functor/average.cpp
- Timestamp:
- 09/06/11 16:45:08 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XMLIO_V2/dev/common/src/xmlio/functor/average.cpp
r219 r266 16 16 //--------------------------------------------------------------- 17 17 18 void CAverage::apply(const DoubleArray UNUSED(dinput),19 DoubleArray UNUSED(doutput))18 void CAverage::apply(const DoubleArray _dinput, 19 DoubleArray _doutput) 20 20 { 21 ERROR("CAverage::apply(...)", << "Not implemented yet !"); 21 const double * it1 = _dinput->data(), 22 * end1 = _dinput->data() + _dinput->num_elements(); 23 double * it = _doutput->data(); 24 if (this->nbcall == 1) 25 for (; it1 != end1; it1++, it++) *it = *it1; 26 else for (; it1 != end1; it1++, it++) *it += *it1; 22 27 } 23 24 //--------------------------------------------------------------- 25 28 29 void CAverage::final(void) 30 { 31 double * it1 = this->getDataOutput()->data(), 32 * end1 = this->getDataOutput()->data() + this->getDataOutput()->num_elements(); 33 for (; it1 != end1; it1++) *it1 /= this->nbcall; 34 this->nbcall = 0; 35 } 26 36 } // namespace func 27 37 } // namespace xmlioserver
Note: See TracChangeset
for help on using the changeset viewer.