LCOV - code coverage report
Current view: top level - generated/include/ad/physics - RatioValue.hpp (source / functions) Hit Total Coverage
Test: ad_physics Lines: 108 108 100.0 %
Date: 2022-10-04 09:47:07 Functions: 29 29 100.0 %
Branches: 46 48 95.8 %

           Branch data     Line data    Source code
       1                 :            : /*
       2                 :            :  * ----------------- BEGIN LICENSE BLOCK ---------------------------------
       3                 :            :  *
       4                 :            :  * Copyright (C) 2018-2020 Intel Corporation
       5                 :            :  *
       6                 :            :  * SPDX-License-Identifier: MIT
       7                 :            :  *
       8                 :            :  * ----------------- END LICENSE BLOCK -----------------------------------
       9                 :            :  */
      10                 :            : 
      11                 :            : /**
      12                 :            :  * Generated file
      13                 :            :  * @file
      14                 :            :  *
      15                 :            :  * Generator Version : 11.0.0-1997
      16                 :            :  */
      17                 :            : 
      18                 :            : #pragma once
      19                 :            : 
      20                 :            : #include <cmath>
      21                 :            : #include <iostream>
      22                 :            : #include <limits>
      23                 :            : #include <sstream>
      24                 :            : #include <stdexcept>
      25                 :            : #include "spdlog/fmt/ostr.h"
      26                 :            : #include "spdlog/spdlog.h"
      27                 :            : /*!
      28                 :            :  * @brief namespace ad
      29                 :            :  */
      30                 :            : namespace ad {
      31                 :            : /*!
      32                 :            :  * @brief namespace physics
      33                 :            :  */
      34                 :            : namespace physics {
      35                 :            : 
      36                 :            : /*!
      37                 :            :  * \brief Define to indicate whether throwing exceptions is enabled
      38                 :            :  */
      39                 :            : #define AD_PHYSICS_RATIOVALUE_THROWS_EXCEPTION 1
      40                 :            : 
      41                 :            : #if SAFE_DATATYPES_EXPLICIT_CONVERSION
      42                 :            : /*!
      43                 :            :  * \brief Enable/Disable explicit conversion. Currently set to "only explicit conversion".
      44                 :            :  */
      45                 :            : #define _AD_PHYSICS_RATIOVALUE_EXPLICIT_CONVERSION_ explicit
      46                 :            : #else
      47                 :            : /*!
      48                 :            :  * \brief Enable/Disable explicit conversion. Currently set to "implicit conversion allowed".
      49                 :            :  */
      50                 :            : #define _AD_PHYSICS_RATIOVALUE_EXPLICIT_CONVERSION_
      51                 :            : #endif
      52                 :            : 
      53                 :            : /*!
      54                 :            :  * \brief DataType RatioValue
      55                 :            :  *
      56                 :            :  * Defines a general ratio.
      57                 :            :  * The unit is: Ratio
      58                 :            :  */
      59                 :            : class RatioValue
      60                 :            : {
      61                 :            : public:
      62                 :            :   /*!
      63                 :            :    * \brief constant defining the minimum valid RatioValue value (used in isValid())
      64                 :            :    */
      65                 :            :   static const double cMinValue;
      66                 :            : 
      67                 :            :   /*!
      68                 :            :    * \brief constant defining the maximum valid RatioValue value (used in isValid())
      69                 :            :    */
      70                 :            :   static const double cMaxValue;
      71                 :            : 
      72                 :            :   /*!
      73                 :            :    * \brief constant defining the assumed RatioValue value accuracy
      74                 :            :    *   (used in comparison operator==(), operator!=())
      75                 :            :    */
      76                 :            :   static const double cPrecisionValue;
      77                 :            : 
      78                 :            :   /*!
      79                 :            :    * \brief default constructor
      80                 :            :    *
      81                 :            :    * The default value of RatioValue is:
      82                 :            :    * std::numeric_limits<double>::quiet_NaN()
      83                 :            :    */
      84                 :         14 :   RatioValue()
      85                 :         14 :     : mRatioValue(std::numeric_limits<double>::quiet_NaN())
      86                 :            :   {
      87                 :         14 :   }
      88                 :            : 
      89                 :            :   /*!
      90                 :            :    * \brief standard constructor
      91                 :            :    *
      92                 :            :    * \note \ref \_AD_PHYSICS_RATIOVALUE_EXPLICIT_CONVERSION\_ defines, if only an explicit conversion is allowed.
      93                 :            :    */
      94                 :         73 :   _AD_PHYSICS_RATIOVALUE_EXPLICIT_CONVERSION_ RatioValue(double const iRatioValue)
      95                 :         73 :     : mRatioValue(iRatioValue)
      96                 :            :   {
      97                 :         73 :   }
      98                 :            : 
      99                 :            :   /*!
     100                 :            :    * \brief standard copy constructor
     101                 :            :    */
     102                 :            :   RatioValue(const RatioValue &other) = default;
     103                 :            : 
     104                 :            :   /*!
     105                 :            :    * \brief standard move constructor
     106                 :            :    */
     107                 :            :   RatioValue(RatioValue &&other) = default;
     108                 :            : 
     109                 :            :   /**
     110                 :            :    * \brief standard assignment operator
     111                 :            :    *
     112                 :            :    * \param[in] other Other RatioValue
     113                 :            :    *
     114                 :            :    * \returns Reference to this RatioValue.
     115                 :            :    */
     116                 :            :   RatioValue &operator=(const RatioValue &other) = default;
     117                 :            : 
     118                 :            :   /**
     119                 :            :    * \brief standard move operator
     120                 :            :    *
     121                 :            :    * \param[in] other Other RatioValue
     122                 :            :    *
     123                 :            :    * \returns Reference to this RatioValue.
     124                 :            :    */
     125                 :            :   RatioValue &operator=(RatioValue &&other) = default;
     126                 :            : 
     127                 :            :   /**
     128                 :            :    * \brief standard comparison operator
     129                 :            :    *
     130                 :            :    * \param[in] other Other RatioValue
     131                 :            :    *
     132                 :            :    * \returns \c true if both RatioValue are valid and can be taken as numerically equal
     133                 :            :    */
     134                 :         31 :   bool operator==(const RatioValue &other) const
     135                 :            :   {
     136                 :         31 :     ensureValid();
     137                 :         29 :     other.ensureValid();
     138                 :         27 :     return std::fabs(mRatioValue - other.mRatioValue) < cPrecisionValue;
     139                 :            :   }
     140                 :            : 
     141                 :            :   /**
     142                 :            :    * \brief standard comparison operator
     143                 :            :    *
     144                 :            :    * \param[in] other Other RatioValue.
     145                 :            :    *
     146                 :            :    * \returns \c true if one of the RatioValue is not valid or they can be taken as numerically different
     147                 :            :    */
     148                 :         11 :   bool operator!=(const RatioValue &other) const
     149                 :            :   {
     150                 :         11 :     return !operator==(other);
     151                 :            :   }
     152                 :            : 
     153                 :            :   /**
     154                 :            :    * \brief standard comparison operator
     155                 :            :    *
     156                 :            :    * \param[in] other Other RatioValue.
     157                 :            :    *
     158                 :            :    * \returns \c true if both RatioValue are valid and
     159                 :            :    *   this RatioValue is strictly numerically greater than other.
     160                 :            :    * \note the precision of RatioValue is considered
     161                 :            :    */
     162                 :          5 :   bool operator>(const RatioValue &other) const
     163                 :            :   {
     164                 :          5 :     ensureValid();
     165                 :          4 :     other.ensureValid();
     166   [ +  +  +  + ]:          3 :     return (mRatioValue > other.mRatioValue) && operator!=(other);
     167                 :            :   }
     168                 :            : 
     169                 :            :   /**
     170                 :            :    * \brief standard comparison operator
     171                 :            :    *
     172                 :            :    * \param[in] other Other RatioValue.
     173                 :            :    *
     174                 :            :    * \returns \c true if both RatioValue are valid and
     175                 :            :    *   this RatioValue is strictly numerically smaller than other.
     176                 :            :    * \note the precision of RatioValue is considered
     177                 :            :    */
     178                 :          5 :   bool operator<(const RatioValue &other) const
     179                 :            :   {
     180                 :          5 :     ensureValid();
     181                 :          4 :     other.ensureValid();
     182   [ +  +  +  + ]:          3 :     return (mRatioValue < other.mRatioValue) && operator!=(other);
     183                 :            :   }
     184                 :            : 
     185                 :            :   /**
     186                 :            :    * \brief standard comparison operator
     187                 :            :    *
     188                 :            :    * \param[in] other Other RatioValue.
     189                 :            :    *
     190                 :            :    * \returns \c true if both RatioValue are valid and
     191                 :            :    *   this RatioValue is numerically greater than other.
     192                 :            :    * \note the precision of RatioValue is considered
     193                 :            :    */
     194                 :          7 :   bool operator>=(const RatioValue &other) const
     195                 :            :   {
     196                 :          7 :     ensureValid();
     197                 :          6 :     other.ensureValid();
     198   [ +  +  +  + ]:          5 :     return ((mRatioValue > other.mRatioValue) || operator==(other));
     199                 :            :   }
     200                 :            : 
     201                 :            :   /**
     202                 :            :    * \brief standard comparison operator
     203                 :            :    *
     204                 :            :    * \param[in] other Other RatioValue
     205                 :            :    *
     206                 :            :    * \returns \c true if both RatioValue are valid and
     207                 :            :    *   this RatioValue is numerically smaller than other.
     208                 :            :    * \note the precision of RatioValue is considered
     209                 :            :    */
     210                 :          9 :   bool operator<=(const RatioValue &other) const
     211                 :            :   {
     212                 :          9 :     ensureValid();
     213                 :          8 :     other.ensureValid();
     214   [ +  +  +  + ]:          7 :     return ((mRatioValue < other.mRatioValue) || operator==(other));
     215                 :            :   }
     216                 :            : 
     217                 :            :   /**
     218                 :            :    * \brief standard arithmetic operator
     219                 :            :    *
     220                 :            :    * \param[in] other Other RatioValue
     221                 :            :    *
     222                 :            :    * \returns Result of arithmetic operation.
     223                 :            :    *
     224                 :            :    * \note throws a std::out_of_range exception if one of the two operands or the result of
     225                 :            :    *   the operation is not valid
     226                 :            :    */
     227                 :          4 :   RatioValue operator+(const RatioValue &other) const
     228                 :            :   {
     229         [ +  + ]:          4 :     ensureValid();
     230         [ +  + ]:          3 :     other.ensureValid();
     231                 :          2 :     RatioValue const result(mRatioValue + other.mRatioValue);
     232         [ +  + ]:          2 :     result.ensureValid();
     233                 :          1 :     return result;
     234                 :            :   }
     235                 :            : 
     236                 :            :   /**
     237                 :            :    * \brief standard arithmetic operator
     238                 :            :    *
     239                 :            :    * \param[in] other Other RatioValue
     240                 :            :    *
     241                 :            :    * \returns Result of arithmetic operation.
     242                 :            :    *
     243                 :            :    * \note throws a std::out_of_range exception if one of the two operands or the result of
     244                 :            :    *   the operation is not valid
     245                 :            :    */
     246                 :          4 :   RatioValue &operator+=(const RatioValue &other)
     247                 :            :   {
     248                 :          4 :     ensureValid();
     249                 :          3 :     other.ensureValid();
     250                 :          2 :     mRatioValue += other.mRatioValue;
     251                 :          2 :     ensureValid();
     252                 :          1 :     return *this;
     253                 :            :   }
     254                 :            : 
     255                 :            :   /**
     256                 :            :    * \brief standard arithmetic operator
     257                 :            :    *
     258                 :            :    * \param[in] other Other RatioValue
     259                 :            :    *
     260                 :            :    * \returns Result of arithmetic operation.
     261                 :            :    *
     262                 :            :    * \note throws a std::out_of_range exception if one of the two operands or the result of
     263                 :            :    *   the operation is not valid
     264                 :            :    */
     265                 :          4 :   RatioValue operator-(const RatioValue &other) const
     266                 :            :   {
     267         [ +  + ]:          4 :     ensureValid();
     268         [ +  + ]:          3 :     other.ensureValid();
     269                 :          2 :     RatioValue const result(mRatioValue - other.mRatioValue);
     270         [ +  + ]:          2 :     result.ensureValid();
     271                 :          1 :     return result;
     272                 :            :   }
     273                 :            : 
     274                 :            :   /**
     275                 :            :    * \brief standard arithmetic operator
     276                 :            :    *
     277                 :            :    * \param[in] other Other RatioValue
     278                 :            :    *
     279                 :            :    * \returns Result of arithmetic operation.
     280                 :            :    *
     281                 :            :    * \note throws a std::out_of_range exception if one of the two operands or the result of
     282                 :            :    *   the operation is not valid
     283                 :            :    */
     284                 :          4 :   RatioValue operator-=(const RatioValue &other)
     285                 :            :   {
     286                 :          4 :     ensureValid();
     287                 :          3 :     other.ensureValid();
     288                 :          2 :     mRatioValue -= other.mRatioValue;
     289                 :          2 :     ensureValid();
     290                 :          1 :     return *this;
     291                 :            :   }
     292                 :            : 
     293                 :            :   /**
     294                 :            :    * \brief standard arithmetic operator
     295                 :            :    *
     296                 :            :    * \param[in] scalar Scalar double value
     297                 :            :    *
     298                 :            :    * \returns Result of arithmetic operation.
     299                 :            :    *
     300                 :            :    * \note throws a std::out_of_range exception if \c value or the result of
     301                 :            :    *   the operation is not valid
     302                 :            :    */
     303                 :          4 :   RatioValue operator*(const double &scalar) const
     304                 :            :   {
     305         [ +  + ]:          4 :     ensureValid();
     306                 :          3 :     RatioValue const result(mRatioValue * scalar);
     307         [ +  + ]:          3 :     result.ensureValid();
     308                 :          2 :     return result;
     309                 :            :   }
     310                 :            : 
     311                 :            :   /**
     312                 :            :    * \brief standard arithmetic operator
     313                 :            :    *
     314                 :            :    * \param[in] scalar Scalar double value
     315                 :            :    *
     316                 :            :    * \returns Result of arithmetic operation.
     317                 :            :    *
     318                 :            :    * \note throws a std::out_of_range exception if this or the result of
     319                 :            :    *   the operation is not valid or other is zero
     320                 :            :    */
     321                 :          5 :   RatioValue operator/(const double &scalar) const
     322                 :            :   {
     323                 :          5 :     RatioValue const scalarRatioValue(scalar);
     324         [ +  + ]:          5 :     RatioValue const result(operator/(scalarRatioValue));
     325         [ +  + ]:          2 :     result.ensureValid();
     326                 :          1 :     return result;
     327                 :            :   }
     328                 :            : 
     329                 :            :   /**
     330                 :            :    * \brief standard arithmetic operator
     331                 :            :    *
     332                 :            :    * \param[in] other Other RatioValue
     333                 :            :    *
     334                 :            :    * \returns Result of arithmetic operation.
     335                 :            :    *
     336                 :            :    * \note throws a std::out_of_range exception if one of the two operands or the result of
     337                 :            :    *   the operation is not valid or other is zero
     338                 :            :    * \note since RatioValue is a type with physical unit, the division results in the dimensionless type.
     339                 :            :    */
     340                 :          9 :   double operator/(const RatioValue &other) const
     341                 :            :   {
     342                 :          9 :     ensureValid();
     343                 :          7 :     other.ensureValidNonZero();
     344                 :          3 :     double const result = mRatioValue / other.mRatioValue;
     345                 :          3 :     return result;
     346                 :            :   }
     347                 :            : 
     348                 :            :   /**
     349                 :            :    * \brief standard arithmetic operator
     350                 :            :    *
     351                 :            :    * \returns Result of arithmetic operation.
     352                 :            :    *
     353                 :            :    * \note throws a std::out_of_range exception if this or the result of
     354                 :            :    *   the operation is not valid
     355                 :            :    */
     356                 :          2 :   RatioValue operator-() const
     357                 :            :   {
     358         [ +  + ]:          2 :     ensureValid();
     359                 :          1 :     RatioValue const result(-mRatioValue);
     360                 :          1 :     result.ensureValid(); // LCOV_EXCL_BR_LINE Some types do not throw an exception
     361                 :          1 :     return result;
     362                 :            :   }
     363                 :            : 
     364                 :            :   /*!
     365                 :            :    * \brief conversion to base type: double
     366                 :            :    *
     367                 :            :    * \note the conversion to the base type removes the physical unit.
     368                 :            :    *       \ref \_AD_PHYSICS_RATIOVALUE_EXPLICIT_CONVERSION\_ defines, if only explicit calls are allowed.
     369                 :            :    */
     370                 :        105 :   _AD_PHYSICS_RATIOVALUE_EXPLICIT_CONVERSION_ operator double() const
     371                 :            :   {
     372                 :        105 :     return mRatioValue;
     373                 :            :   }
     374                 :            : 
     375                 :            :   /*!
     376                 :            :    * \returns \c true if the RatioValue in a valid range
     377                 :            :    *
     378                 :            :    * An RatioValue value is defined to be valid if:
     379                 :            :    * - It is normal or zero (see std::fpclassify())
     380                 :            :    * - \ref cMinValue <= value <= \ref cMaxValue
     381                 :            :    */
     382                 :        194 :   bool isValid() const
     383                 :            :   {
     384                 :        194 :     auto const valueClass = std::fpclassify(mRatioValue);
     385   [ +  +  +  - ]:        194 :     return ((valueClass == FP_NORMAL) || (valueClass == FP_ZERO)) && (cMinValue <= mRatioValue)
     386   [ +  +  +  - ]:        388 :       && (mRatioValue <= cMaxValue);
     387                 :            :   }
     388                 :            : 
     389                 :            :   /*!
     390                 :            :    * \brief ensure that the RatioValue is valid
     391                 :            :    *
     392                 :            :    * Throws an std::out_of_range() exception if the RatioValue
     393                 :            :    * in not valid (i.e. isValid() returns false)
     394                 :            :    */
     395                 :        175 :   void ensureValid() const
     396                 :            :   {
     397         [ +  + ]:        175 :     if (!isValid())
     398                 :            :     {
     399                 :         34 :       spdlog::info("ensureValid(::ad::physics::RatioValue)>> {} value out of range", *this); // LCOV_EXCL_BR_LINE
     400                 :            : #if (AD_PHYSICS_RATIOVALUE_THROWS_EXCEPTION == 1)
     401                 :         34 :       throw std::out_of_range("RatioValue value out of range"); // LCOV_EXCL_BR_LINE
     402                 :            : #endif
     403                 :            :     }
     404                 :        141 :   }
     405                 :            : 
     406                 :            :   /*!
     407                 :            :    * \brief ensure that the RatioValue is valid and non zero
     408                 :            :    *
     409                 :            :    * Throws an std::out_of_range() exception if the RatioValue
     410                 :            :    * in not valid or zero (i.e. isValid() returns false)
     411                 :            :    */
     412                 :          9 :   void ensureValidNonZero() const
     413                 :            :   {
     414                 :          9 :     ensureValid();
     415                 :          6 :     if (operator==(RatioValue(0.))) // LCOV_EXCL_BR_LINE
     416                 :            :     {
     417                 :          3 :       spdlog::info("ensureValid(::ad::physics::RatioValue)>> {} value is zero", *this); // LCOV_EXCL_BR_LINE
     418                 :            : #if (AD_PHYSICS_RATIOVALUE_THROWS_EXCEPTION == 1)
     419                 :          3 :       throw std::out_of_range("RatioValue value is zero"); // LCOV_EXCL_BR_LINE
     420                 :            : #endif
     421                 :            :     }
     422                 :          3 :   }
     423                 :            : 
     424                 :            :   /*!
     425                 :            :    * \brief get minimum valid RatioValue (i.e. \ref cMinValue)
     426                 :            :    */
     427                 :          6 :   static RatioValue getMin()
     428                 :            :   {
     429                 :          6 :     return RatioValue(cMinValue);
     430                 :            :   }
     431                 :            : 
     432                 :            :   /*!
     433                 :            :    * \brief get maximum valid RatioValue (i.e. \ref cMaxValue)
     434                 :            :    */
     435                 :          5 :   static RatioValue getMax()
     436                 :            :   {
     437                 :          5 :     return RatioValue(cMaxValue);
     438                 :            :   }
     439                 :            : 
     440                 :            :   /*!
     441                 :            :    * \brief get assumed accuracy of RatioValue (i.e. \ref cPrecisionValue)
     442                 :            :    */
     443                 :          3 :   static RatioValue getPrecision()
     444                 :            :   {
     445                 :          3 :     return RatioValue(cPrecisionValue);
     446                 :            :   }
     447                 :            : 
     448                 :            : private:
     449                 :            :   /*!
     450                 :            :    * \brief the actual value of the type
     451                 :            :    */
     452                 :            :   double mRatioValue;
     453                 :            : };
     454                 :            : 
     455                 :            : } // namespace physics
     456                 :            : } // namespace ad
     457                 :            : /**
     458                 :            :  * \brief standard arithmetic operator
     459                 :            :  *
     460                 :            :  * \param[in] other Other RatioValue as double value
     461                 :            :  * \param[in] value RatioValue value
     462                 :            :  *
     463                 :            :  * \returns Result of arithmetic operation.
     464                 :            :  *
     465                 :            :  * \note throws a std::out_of_range exception if \c value or the result of
     466                 :            :  *   the operation is not valid
     467                 :            :  */
     468                 :          1 : inline ::ad::physics::RatioValue operator*(const double &other, ::ad::physics::RatioValue const &value)
     469                 :            : {
     470                 :          1 :   return value.operator*(other);
     471                 :            : }
     472                 :            : 
     473                 :            : /*!
     474                 :            :  * \brief namespace std
     475                 :            :  */
     476                 :            : namespace std {
     477                 :            : 
     478                 :            : /*!
     479                 :            :  * \brief overload of the std::fabs for RatioValue
     480                 :            :  */
     481                 :          7 : inline ::ad::physics::RatioValue fabs(const ::ad::physics::RatioValue other)
     482                 :            : {
     483                 :          7 :   ::ad::physics::RatioValue const result(std::fabs(static_cast<double>(other)));
     484                 :          7 :   return result;
     485                 :            : }
     486                 :            : 
     487                 :            : /*!
     488                 :            :  * \brief specialization of the std::numeric_limits for RatioValue
     489                 :            :  *
     490                 :            :  * Derived from std::numeric_limits<double> with overloaded functions:
     491                 :            :  * std::numeric_limits<RatioValue>::lowest()  (\see RatioValue::getMin())
     492                 :            :  * std::numeric_limits<RatioValue>::max()  (\see RatioValue::getMax())
     493                 :            :  * std::numeric_limits<RatioValue>::epsilon()  (\see RatioValue::getPrecision())
     494                 :            :  */
     495                 :            : template <> class numeric_limits<::ad::physics::RatioValue> : public numeric_limits<double>
     496                 :            : {
     497                 :            : public:
     498                 :            :   /*!
     499                 :            :    * \see std::numeric_limits::lowest()
     500                 :            :    */
     501                 :          4 :   static inline ::ad::physics::RatioValue lowest()
     502                 :            :   {
     503                 :          4 :     return ::ad::physics::RatioValue::getMin();
     504                 :            :   }
     505                 :            :   /*!
     506                 :            :    * \see std::numeric_limits::max()
     507                 :            :    */
     508                 :          3 :   static inline ::ad::physics::RatioValue max()
     509                 :            :   {
     510                 :          3 :     return ::ad::physics::RatioValue::getMax();
     511                 :            :   }
     512                 :            : 
     513                 :            :   /*!
     514                 :            :    * \see std::numeric_limits::epsilon()
     515                 :            :    */
     516                 :          1 :   static inline ::ad::physics::RatioValue epsilon()
     517                 :            :   {
     518                 :          1 :     return ::ad::physics::RatioValue::getPrecision();
     519                 :            :   }
     520                 :            : };
     521                 :            : 
     522                 :            : } // namespace std
     523                 :            : 
     524                 :            : /*!
     525                 :            :  * \brief protect the definition of functions from duplicates by typedef usage within other data types
     526                 :            :  */
     527                 :            : #ifndef GEN_GUARD_AD_PHYSICS_RATIOVALUE
     528                 :            : #define GEN_GUARD_AD_PHYSICS_RATIOVALUE
     529                 :            : /*!
     530                 :            :  * @brief namespace ad
     531                 :            :  */
     532                 :            : namespace ad {
     533                 :            : /*!
     534                 :            :  * @brief namespace physics
     535                 :            :  */
     536                 :            : namespace physics {
     537                 :            : 
     538                 :            : /**
     539                 :            :  * \brief standard ostream operator
     540                 :            :  *
     541                 :            :  * \param[in] os The output stream to write to
     542                 :            :  * \param[in] _value RatioValue value
     543                 :            :  *
     544                 :            :  * \returns The stream object.
     545                 :            :  *
     546                 :            :  */
     547                 :         41 : inline std::ostream &operator<<(std::ostream &os, RatioValue const &_value)
     548                 :            : {
     549                 :         41 :   return os << double(_value);
     550                 :            : }
     551                 :            : 
     552                 :            : } // namespace physics
     553                 :            : } // namespace ad
     554                 :            : 
     555                 :            : namespace std {
     556                 :            : /*!
     557                 :            :  * \brief overload of the std::to_string for RatioValue
     558                 :            :  */
     559                 :            : inline std::string to_string(::ad::physics::RatioValue const &value)
     560                 :            : {
     561                 :            :   return to_string(static_cast<double>(value));
     562                 :            : }
     563                 :            : } // namespace std
     564                 :            : #endif // GEN_GUARD_AD_PHYSICS_RATIOVALUE

Generated by: LCOV version 1.14