1 // -*- C++ -*- 2 /** 3 * @brief ARMAState class enables to set a State before a simulation 4 * of an ARMA process and / or t get the State 5 * Copyright 2005-2021 Airbus-EDF-IMACS-ONERA-Phimeca 6 * 7 * This library is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU Lesser General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * This library is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU Lesser General Public License for more details. 16 * 17 * You should have received a copy of the GNU Lesser General Public License 18 * along with this library. If not, see <http://www.gnu.org/licenses/>. 19 * 20 */ 21 #ifndef OPENTURNS_ARMASTATE_HXX 22 #define OPENTURNS_ARMASTATE_HXX 23 24 #include "openturns/PersistentObject.hxx" 25 #include "openturns/Sample.hxx" 26 #include "openturns/Point.hxx" 27 #include "openturns/Field.hxx" 28 29 BEGIN_NAMESPACE_OPENTURNS 30 31 /** 32 * @class ARMAState 33 * 34 * The implementation of ARMA State 35 */ 36 class OT_API ARMAState 37 : public PersistentObject 38 { 39 CLASSNAME 40 41 public: 42 43 /** Some typedefs to ease reading */ 44 45 /** Default constructors */ 46 ARMAState(); 47 ARMAState(const Sample & x, 48 const Sample & epsilon); 49 50 /** Virtual constructor */ 51 ARMAState * clone() const override; 52 53 /** String converter */ 54 String __repr__() const override; 55 String __str__(const String & offset = "") const override; 56 57 /** Data X accessor */ 58 Sample getX() const; 59 void setXEpsilon(const Sample & x, 60 const Sample & epsilon); 61 62 /** Noise \epsilon accessor */ 63 Sample getEpsilon() const; 64 65 /** Dimension accessor */ 66 UnsignedInteger getDimension() const; 67 68 /** Method save() stores the object through the StorageManager */ 69 void save(Advocate & adv) const override; 70 71 /** Method load() reloads the object from the StorageManager */ 72 void load(Advocate & adv) override; 73 74 private: 75 76 /** Store the p last values of an ARMA(p, q) */ 77 Sample x_; 78 /** Store the q last value of the noise of an ARMA(p, q) */ 79 Sample epsilon_; 80 81 }; /* class ARMAState */ 82 83 84 END_NAMESPACE_OPENTURNS 85 86 #endif /* OPENTURNS_ARMASTATE_HXX */ 87