source: XIOS/trunk/src/functor/maximum.cpp @ 369

Last change on this file since 369 was 369, checked in by ymipsl, 12 years ago

Major Update

  • redesign Type and attribute manipulation
  • add enumerate type and attribute
  • use blitz class array instead of boost class array

YM

File size: 1.0 KB
Line 
1#include "maximum.hpp"
2#include "array_new.hpp"
3
4
5
6namespace xios
7{
8   namespace func
9   {
10      /// ////////////////////// Définitions ////////////////////// ///
11
12      CMaximum::CMaximum(CArray<double,1>& doutput)
13         : SuperClass(StdString("maximum"), doutput)
14      { /* Ne rien faire de plus */ }
15
16      CMaximum::~CMaximum(void)
17      { /* Ne rien faire de plus */ }
18
19      //---------------------------------------------------------------
20
21      void CMaximum::apply(const CArray<double,1>& _dinput,
22                                 CArray<double,1>& _doutput)
23      {
24        const double * it1  = _dinput.dataFirst(),
25                     * end1 = _dinput.dataFirst() + _dinput.numElements();
26              double * it   = _doutput.dataFirst();
27         if (this->nbcall == 1) for (; it1 != end1; it1++, it++) *it = *it1;
28         else for (; it1 != end1; it1++, it++) *it = std::max(*it1, *it);
29
30
31      }
32
33      //---------------------------------------------------------------
34
35   } // namespace func
36} // namespace xmlioserver
Note: See TracBrowser for help on using the repository browser.