source:
vendors/XIOS/current/src/functor/maximum.cpp
@
3428
Last change on this file since 3428 was 3428, checked in by rblod, 12 years ago | |
---|---|
File size: 1.2 KB |
Line | |
---|---|
1 | #include "maximum.hpp" |
2 | #include <algorithm> |
3 | |
4 | |
5 | namespace xios |
6 | { |
7 | namespace func |
8 | { |
9 | /// ////////////////////// Définitions ////////////////////// /// |
10 | |
11 | CMaximum::CMaximum(DoubleArray doutput) |
12 | : SuperClass(StdString("maximum"), doutput) |
13 | { /* Ne rien faire de plus */ } |
14 | |
15 | CMaximum::~CMaximum(void) |
16 | { /* Ne rien faire de plus */ } |
17 | |
18 | //--------------------------------------------------------------- |
19 | |
20 | void CMaximum::apply(const DoubleArray _dinput, |
21 | DoubleArray _doutput) |
22 | { |
23 | const double * it1 = _dinput->data(), |
24 | * end1 = _dinput->data() + _dinput->num_elements(); |
25 | double * it = _doutput->data(); |
26 | if (this->nbcall == 1) |
27 | for (; it1 != end1; it1++, it++) *it = *it1; |
28 | else for (; it1 != end1; it1++, it++) *it = std::max(*it1, *it); |
29 | |
30 | it1 = _dinput->data(), |
31 | end1 = _dinput->data() + _dinput->num_elements(); |
32 | it = _doutput->data(); |
33 | double sum=0 ; |
34 | for (; it1 != end1; it1++, it++) sum+=*it; |
35 | } |
36 | |
37 | //--------------------------------------------------------------- |
38 | |
39 | } // namespace func |
40 | } // namespace xmlioserver |
Note: See TracBrowser
for help on using the repository browser.