1 // -*- C++ -*- 2 /** 3 * @brief 4 * 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_SAMPLINGSTRATEGYIMPLEMENTATION_HXX 22 #define OPENTURNS_SAMPLINGSTRATEGYIMPLEMENTATION_HXX 23 24 #include "openturns/PersistentObject.hxx" 25 #include "openturns/Point.hxx" 26 #include "openturns/Sample.hxx" 27 #include "openturns/PersistentObject.hxx" 28 29 BEGIN_NAMESPACE_OPENTURNS 30 31 /** 32 * @class SamplingStrategyImplementation 33 */ 34 35 class OT_API SamplingStrategyImplementation 36 : public PersistentObject 37 { 38 39 CLASSNAME 40 41 public: 42 43 /** Constructor with parameters */ 44 explicit SamplingStrategyImplementation(const UnsignedInteger dimension = 0); 45 46 /** Virtual constructor */ 47 SamplingStrategyImplementation * clone() const override; 48 49 /** Generate a set of directions */ 50 virtual Sample generate() const; 51 52 /** Generate a uniform random unit vector */ 53 Point getUniformUnitVectorRealization(const UnsignedInteger dimension) const; 54 55 /** Generate a uniform random unit vector */ 56 Point getUniformUnitVectorRealization() const; 57 58 /** Dimension accessor */ 59 void setDimension(const UnsignedInteger dimension); 60 UnsignedInteger getDimension() const; 61 62 /** String converter */ 63 String __repr__() const override; 64 65 /** Method save() stores the object through the StorageManager */ 66 void save(Advocate & adv) const override; 67 68 /** Method load() reloads the object from the StorageManager */ 69 void load(Advocate & adv) override; 70 71 protected: 72 73 UnsignedInteger dimension_; 74 75 } ; /* class SamplingStrategyImplementation */ 76 77 END_NAMESPACE_OPENTURNS 78 79 #endif /* OPENTURNS_SAMPLINGSTRATEGYIMPLEMENTATION_HXX */ 80