1 // -*- C++ -*- 2 /** 3 * @brief Abstract top-level class for all Greater 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 #include "openturns/Greater.hxx" 22 #include "openturns/PersistentObjectFactory.hxx" 23 24 BEGIN_NAMESPACE_OPENTURNS 25 26 CLASSNAMEINIT(Greater) 27 28 static const Factory<Greater> Factory_Greater; 29 30 /* Default constructor */ Greater()31Greater::Greater() 32 : ComparisonOperatorImplementation() 33 { 34 // Nothing to do 35 } 36 37 /* String converter */ __repr__() const38String Greater::__repr__() const 39 { 40 return OSS() << "class=" << Greater::GetClassName() 41 << " name=" << getName(); 42 } 43 __str__(const String & offset) const44String Greater::__str__(const String & offset) const 45 { 46 return OSS() << offset << ">"; 47 } 48 49 /* Here is the interface that all derived class must implement */ 50 51 /* Virtual constructor */ clone() const52Greater * Greater::clone() const 53 { 54 return new Greater(*this); 55 } 56 57 /* Return true if comparison succeeds */ operator ()(const Scalar a,const Scalar b) const58Bool Greater::operator() (const Scalar a, 59 const Scalar b) const 60 { 61 return (a > b); 62 } 63 64 /* Method save() stores the object through the StorageManager */ save(Advocate & adv) const65void Greater::save(Advocate & adv) const 66 { 67 ComparisonOperatorImplementation::save(adv); 68 } 69 70 71 /* Method load() reloads the object from the StorageManager */ load(Advocate & adv)72void Greater::load(Advocate & adv) 73 { 74 ComparisonOperatorImplementation::load(adv); 75 } 76 77 78 79 80 81 END_NAMESPACE_OPENTURNS 82