LCOV - code coverage report
Current view: top level - core/include/scipp/core/element - hyperbolic.h (source / functions) Hit Total Coverage
Test: coverage.info Lines: 12 12 100.0 %
Date: 2024-04-28 01:25:40 Functions: 12 18 66.7 %

          Line data    Source code
       1             : // SPDX-License-Identifier: BSD-3-Clause
       2             : // Copyright (c) 2023 Scipp contributors (https://github.com/scipp)
       3             : #pragma once
       4             : 
       5             : #include <cmath>
       6             : 
       7             : #include "scipp/common/overloaded.h"
       8             : #include "scipp/core/element/arg_list.h"
       9             : #include "scipp/core/transform_common.h"
      10             : 
      11             : namespace scipp::core::element {
      12             : constexpr auto hyperbolic = overloaded{
      13             :     arg_list<double, float>, transform_flags::expect_no_variance_arg<0>,
      14             :     transform_flags::expect_no_variance_arg<1>};
      15             : 
      16          10 : constexpr auto sinh = overloaded{hyperbolic, [](const auto &x) {
      17             :                                    using std::sinh;
      18          10 :                                    return sinh(x);
      19             :                                  }};
      20             : 
      21           2 : constexpr auto cosh = overloaded{hyperbolic, [](const auto &x) {
      22             :                                    using std::cosh;
      23           2 :                                    return cosh(x);
      24             :                                  }};
      25             : 
      26           2 : constexpr auto tanh = overloaded{hyperbolic, [](const auto &x) {
      27             :                                    using std::tanh;
      28           2 :                                    return tanh(x);
      29             :                                  }};
      30             : 
      31           2 : constexpr auto asinh = overloaded{hyperbolic, [](const auto x) {
      32             :                                     using std::asinh;
      33           2 :                                     return asinh(x);
      34             :                                   }};
      35             : 
      36           6 : constexpr auto acosh = overloaded{hyperbolic, [](const auto x) {
      37             :                                     using std::acosh;
      38           6 :                                     return acosh(x);
      39             :                                   }};
      40             : 
      41           2 : constexpr auto atanh = overloaded{hyperbolic, [](const auto x) {
      42             :                                     using std::atanh;
      43           2 :                                     return atanh(x);
      44             :                                   }};
      45             : 
      46             : } // namespace scipp::core::element

Generated by: LCOV version 1.14