Open C++ Libraries.org develop
Loading...
Searching...
No Matches
scientific_fwd.hpp
1// SPDX-License-Identifier: BSL-1.0
2// Copyright 2026, Amlal El Mahrouss (amlal@nekernel.org)
3// Distributed under the Boost Software License, Version 1.0. (See accompanying
4// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5// Official repository: https://github.com/open-cpp-libraries/core
6
7#pragma once
8
9#include <ocl/detail/math/config.hpp>
10
12
13#ifndef zeta_apery
14#define zeta_apery zeta_three
15#endif
16
17namespace ocl::scientific
18{
19
22 using quaternionf = ::boost::math::quaternion<float>;
23 using quaterniond = ::boost::math::quaternion<double>;
24
26 inline auto zeta_apery_f = ::boost::math::zeta<float>(3.0f);
27 inline auto zeta_apery_d = ::boost::math::zeta<double>(3.0);
28
30 enum class space_type : int32_t
31 {
32 invalid = -1,
33 euclidean,
34 minkowski,
35 count = 2,
36 };
37
43 template <typename T, space_type S>
44 inline T norm(::boost::math::quaternion<T> const& q)
45 {
46 switch (S)
47 {
48 case space_type::euclidean:
49 return ::boost::math::abs(q);
50 case space_type::minkowski:
51 return ::boost::math::norm(q);
52 }
53
54 ::boost::throw_exception(std::runtime_error("Invalid space type"), BOOST_CURRENT_LOCATION);
55 }
56
57} // namespace ocl::scientific