1 // -*- C++ -*- 2 /** 3 * @brief The class PlatformInfo gives information about the library 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/OTconfig.hxx" 22 #include "openturns/OTconfigureArgs.hxx" 23 #include "openturns/Exception.hxx" 24 #include "openturns/PlatformInfo.hxx" 25 26 BEGIN_NAMESPACE_OPENTURNS 27 28 29 30 UnsignedInteger PlatformInfo::Precision_ = 6; 31 PlatformInfo()32PlatformInfo::PlatformInfo() 33 { 34 } 35 36 GetVersion()37String PlatformInfo::GetVersion() 38 { 39 return PACKAGE_VERSION; 40 } 41 GetName()42String PlatformInfo::GetName() 43 { 44 return PACKAGE_NAME; 45 } 46 GetRevision()47String PlatformInfo::GetRevision() 48 { 49 return Revision; 50 } 51 GetDate()52String PlatformInfo::GetDate() 53 { 54 return ConfigureDate; 55 } 56 GetInstallationDirectory()57String PlatformInfo::GetInstallationDirectory() 58 { 59 return InstallationDirectory; 60 } 61 GetNumericalPrecision()62UnsignedInteger PlatformInfo::GetNumericalPrecision() 63 { 64 return PlatformInfo::Precision_; 65 } 66 SetNumericalPrecision(SignedInteger precision)67void PlatformInfo::SetNumericalPrecision(SignedInteger precision) 68 { 69 if (precision < 0) 70 throw InvalidArgumentException(HERE) << "in SetNumericalPrecision, precision must be positive"; 71 PlatformInfo::Precision_ = precision; 72 } 73 74 END_NAMESPACE_OPENTURNS 75