[219] | 1 | #include "functor.hpp" |
---|
[369] | 2 | #include "array_new.hpp" |
---|
[219] | 3 | |
---|
[335] | 4 | namespace xios |
---|
[219] | 5 | { |
---|
| 6 | namespace func |
---|
| 7 | { |
---|
| 8 | /// ////////////////////// Définitions ////////////////////// /// |
---|
| 9 | |
---|
[369] | 10 | CFunctor::CFunctor(const StdString & id, CArray<double, 1>& doutput) |
---|
[266] | 11 | : SuperClass(id), doutput(doutput), nbcall(0) |
---|
[219] | 12 | { /* Ne rien faire de plus */ } |
---|
| 13 | |
---|
| 14 | CFunctor::~CFunctor(void) |
---|
| 15 | { /* Ne rien faire de plus */ } |
---|
| 16 | |
---|
| 17 | //--------------------------------------------------------------- |
---|
| 18 | |
---|
[369] | 19 | CArray<double,1> CFunctor::getDataOutput(void) const |
---|
[219] | 20 | { |
---|
| 21 | return (this->doutput); |
---|
| 22 | } |
---|
| 23 | |
---|
| 24 | //--------------------------------------------------------------- |
---|
| 25 | |
---|
| 26 | StdString CFunctor::toString(void) const |
---|
| 27 | { |
---|
| 28 | ERROR("CFunctor::toString()", << "Not implemented yet !"); |
---|
| 29 | return (SuperClass::getId()); |
---|
| 30 | } |
---|
| 31 | |
---|
| 32 | void CFunctor::fromString(const StdString & str) |
---|
| 33 | { |
---|
| 34 | ERROR("CFunctor::fromString(str)", |
---|
| 35 | << "[ str = " << str << "] Not implemented yet !"); |
---|
| 36 | } |
---|
| 37 | |
---|
| 38 | //--------------------------------------------------------------- |
---|
| 39 | |
---|
[369] | 40 | CArray<double,1> CFunctor::operator ()(const CArray<double,1>& dinput) |
---|
[219] | 41 | { |
---|
[266] | 42 | this->nbcall++; |
---|
[369] | 43 | if (dinput.numElements() != this->doutput.numElements()) |
---|
[219] | 44 | ERROR("CFunctor::operator ()(dinput)", |
---|
[369] | 45 | << "[ input size = " << dinput.numElements() |
---|
| 46 | << ", output size = " << this->doutput.numElements() << " ]" |
---|
[219] | 47 | << " size of input array != size of output array !"); |
---|
| 48 | this->apply(dinput, this->doutput); |
---|
| 49 | return (this->doutput); |
---|
| 50 | } |
---|
| 51 | |
---|
[266] | 52 | void CFunctor::final(void) |
---|
| 53 | { |
---|
| 54 | this->nbcall = 0; |
---|
| 55 | } |
---|
| 56 | |
---|
[219] | 57 | //--------------------------------------------------------------- |
---|
| 58 | |
---|
| 59 | } // namespace func |
---|
[335] | 60 | } // namespace xios |
---|