Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:11:11

0001 // This file is part of the ACTS project.
0002 //
0003 // Copyright (C) 2016 CERN for the benefit of the ACTS project
0004 //
0005 // This Source Code Form is subject to the terms of the Mozilla Public
0006 // License, v. 2.0. If a copy of the MPL was not distributed with this
0007 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
0008 
0009 #pragma once
0010 
0011 #include <cmath>
0012 
0013 namespace Acts {
0014 
0015 template <typename T>
0016 constexpr auto square(T x) {
0017   return x * x;
0018 }
0019 
0020 template <typename... T>
0021 constexpr auto hypotSquare(T... args) {
0022   return (square(args) + ...);
0023 }
0024 
0025 template <typename... T>
0026 constexpr auto fastHypot(T... args) {
0027   return std::sqrt(hypotSquare(args...));
0028 }
0029 
0030 }  // namespace Acts