Ignore:
Timestamp:
09/06/11 16:45:08 (13 years ago)
Author:
hozdoba
Message:

Corrections après tests sur titane

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XMLIO_V2/dev/common/src/xmlio/functor/average.cpp

    r219 r266  
    1616      //--------------------------------------------------------------- 
    1717 
    18       void CAverage::apply(const DoubleArray         UNUSED(dinput), 
    19                                  DoubleArray         UNUSED(doutput)) 
     18      void CAverage::apply(const DoubleArray _dinput, 
     19                                 DoubleArray _doutput) 
    2020      { 
    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;                
    2227      } 
    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      } 
    2636   } // namespace func 
    2737} // namespace xmlioserver 
Note: See TracChangeset for help on using the changeset viewer.