Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cayley/trigo just direct hyperbolic for this pr #13

Merged
merged 3 commits into from
Aug 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions include/kyosu/functions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#include <kyosu/functions/abs.hpp>
#include <kyosu/functions/ceil.hpp>
#include <kyosu/functions/conj.hpp>
#include <kyosu/functions/cosh.hpp>
#include <kyosu/functions/coth.hpp>
#include <kyosu/functions/dec.hpp>
#include <kyosu/functions/dist.hpp>
#include <kyosu/functions/exp.hpp>
Expand Down Expand Up @@ -52,7 +54,11 @@
#include <kyosu/functions/pure.hpp>
#include <kyosu/functions/purepart.hpp>
#include <kyosu/functions/real.hpp>
#include <kyosu/functions/rec.hpp>
#include <kyosu/functions/reldist.hpp>
#include <kyosu/functions/sinh.hpp>
#include <kyosu/functions/sinhcosh.hpp>
#include <kyosu/functions/sqr_abs.hpp>
#include <kyosu/functions/sqr.hpp>
#include <kyosu/functions/tanh.hpp>
#include <kyosu/functions/trunc.hpp>
74 changes: 74 additions & 0 deletions include/kyosu/functions/cosh.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
//======================================================================================================================
/*
Kyosu - Complex Without Complexes
Copyright : KYOSU Contributors & Maintainers
SPDX-License-Identifier: BSL-1.0
*/
//======================================================================================================================
#pragma once

#include <kyosu/details/invoke.hpp>
#include <eve/module/math.hpp>

namespace kyosu::tags
{
struct callable_cosh : eve::elementwise
{
using callable_tag_type = callable_cosh;

KYOSU_DEFERS_CALLABLE(cosh_);

template<eve::ordered_value T>
static KYOSU_FORCEINLINE auto deferred_call(auto, T const& v) noexcept { return eve::cosh(v); }

template<typename T>
KYOSU_FORCEINLINE auto operator()(T const& target) const noexcept -> decltype(eve::tag_invoke(*this, target))
{
return eve::tag_invoke(*this, target);
}

template<typename... T>
eve::unsupported_call<callable_cosh(T&&...)> operator()(T&&... x) const
requires(!requires { eve::tag_invoke(*this, KYOSU_FWD(x)...); }) = delete;
};
}

namespace kyosu
{
//======================================================================================================================
//! @addtogroup functions
//! @{
//! @var cosh
//! @brief Computes the hyperbolic cosine of the argument.
//!
//! **Defined in Header**
//!
//! @code
//! #include <kyosu/functions.hpp>
//! @endcode
//!
//! @groupheader{Callable Signatures}
//!
//! @code
//! namespace kyosu
//! {
//! template<kyosu::concepts::cayley_dickson T> constexpr T cosh(T z) noexcept;
//! template<eve::ordered_value T> constexpr T cosh(T z) noexcept;
//! }
//! @endcode
//!
//! **Parameters**
//!
//! * `z` : Value to process.
//!
//! **Return value**
//!
//! Returns the hyperbolic cosine of the argument.
//!
//! @groupheader{Example}
//!
//! @godbolt{doc/cosh.cpp}
//! @}
//======================================================================================================================
inline constexpr tags::callable_cosh cosh = {};
}
74 changes: 74 additions & 0 deletions include/kyosu/functions/coth.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
//======================================================================================================================
/*
Kyosu - Complex Without Complexes
Copyright : KYOSU Contributors & Maintainers
SPDX-License-Identifier: BSL-1.0
*/
//======================================================================================================================
#pragma once

#include <kyosu/details/invoke.hpp>
#include <eve/module/math.hpp>

namespace kyosu::tags
{
struct callable_coth : eve::elementwise
{
using callable_tag_type = callable_coth;

KYOSU_DEFERS_CALLABLE(coth_);

template<eve::ordered_value T>
static KYOSU_FORCEINLINE auto deferred_call(auto, T const& v) noexcept { return eve::coth(v); }

template<typename T>
KYOSU_FORCEINLINE auto operator()(T const& target) const noexcept -> decltype(eve::tag_invoke(*this, target))
{
return eve::tag_invoke(*this, target);
}

template<typename... T>
eve::unsupported_call<callable_coth(T&&...)> operator()(T&&... x) const
requires(!requires { eve::tag_invoke(*this, KYOSU_FWD(x)...); }) = delete;
};
}

namespace kyosu
{
//======================================================================================================================
//! @addtogroup functions
//! @{
//! @var coth
//! @brief Computes the hyperbolic cotangent of the argument.
//!
//! **Defined in Header**
//!
//! @code
//! #include <kyosu/functions.hpp>
//! @endcode
//!
//! @groupheader{Callable Signatures}
//!
//! @code
//! namespace kyosu
//! {
//! template<kyosu::concepts::cayley_dickson T> constexpr T coth(T z) noexcept;
//! template<eve::ordered_value T> constexpr T coth(T z) noexcept;
//! }
//! @endcode
//!
//! **Parameters**
//!
//! * `z` : Value to process.
//!
//! **Return value**
//!
//! Returns the hyperbolic cotangent of the argument.
//!
//! @groupheader{Example}
//!
//! @godbolt{doc/coth.cpp}
//! @}
//======================================================================================================================
inline constexpr tags::callable_coth coth = {};
}
74 changes: 74 additions & 0 deletions include/kyosu/functions/rec.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
//======================================================================================================================
/*
Kyosu - Complex Without Complexes
Copyright : KYOSU Contributors & Maintainers
SPDX-License-Identifier: BSL-1.0
*/
//======================================================================================================================
#pragma once

#include <kyosu/details/invoke.hpp>
#include <eve/module/math.hpp>

namespace kyosu::tags
{
struct callable_rec : eve::elementwise
{
using callable_tag_type = callable_rec;

KYOSU_DEFERS_CALLABLE(rec_);

template<eve::ordered_value T>
static KYOSU_FORCEINLINE auto deferred_call(auto, T const& v) noexcept { return eve::rec(v); }

template<typename T>
KYOSU_FORCEINLINE auto operator()(T const& target) const noexcept -> decltype(eve::tag_invoke(*this, target))
{
return eve::tag_invoke(*this, target);
}

template<typename... T>
eve::unsupported_call<callable_rec(T&&...)> operator()(T&&... x) const
requires(!requires { eve::tag_invoke(*this, KYOSU_FWD(x)...); }) = delete;
};
}

namespace kyosu
{
//======================================================================================================================
//! @addtogroup functions
//! @{
//! @var rec
//! @brief Computes the inverse of the argument.
//!
//! **Defined in Header**
//!
//! @code
//! #include <kyosu/functions.hpp>
//! @endcode
//!
//! @groupheader{Callable Signatures}
//!
//! @code
//! namespace kyosu
//! {
//! template<kyosu::concepts::cayley_dickson T> constexpr T rec(T z) noexcept;
//! template<eve::ordered_value T> constexpr T rec(T z) noexcept;
//! }
//! @endcode
//!
//! **Parameters**
//!
//! * `z` : Value to process.
//!
//! **Return value**
//!
//! Returns the inverse of the argument.
//!
//! @groupheader{Example}
//!
//! @godbolt{doc/rec.cpp}
//! @}
//======================================================================================================================
inline constexpr tags::callable_rec rec = {};
}
74 changes: 74 additions & 0 deletions include/kyosu/functions/sinh.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
//======================================================================================================================
/*
Kyosu - Complex Without Complexes
Copyright : KYOSU Contributors & Maintainers
SPDX-License-Identifier: BSL-1.0
*/
//======================================================================================================================
#pragma once

#include <kyosu/details/invoke.hpp>
#include <eve/module/math.hpp>

namespace kyosu::tags
{
struct callable_sinh : eve::elementwise
{
using callable_tag_type = callable_sinh;

KYOSU_DEFERS_CALLABLE(sinh_);

template<eve::ordered_value T>
static KYOSU_FORCEINLINE auto deferred_call(auto, T const& v) noexcept { return eve::sinh(v); }

template<typename T>
KYOSU_FORCEINLINE auto operator()(T const& target) const noexcept -> decltype(eve::tag_invoke(*this, target))
{
return eve::tag_invoke(*this, target);
}

template<typename... T>
eve::unsupported_call<callable_sinh(T&&...)> operator()(T&&... x) const
requires(!requires { eve::tag_invoke(*this, KYOSU_FWD(x)...); }) = delete;
};
}

namespace kyosu
{
//======================================================================================================================
//! @addtogroup functions
//! @{
//! @var sinh
//! @brief Computes the hyperbolic sine of the argument.
//!
//! **Defined in Header**
//!
//! @code
//! #include <kyosu/functions.hpp>
//! @endcode
//!
//! @groupheader{Callable Signatures}
//!
//! @code
//! namespace kyosu
//! {
//! template<kyosu::concepts::cayley_dickson T> constexpr T sinh(T z) noexcept;
//! template<eve::ordered_value T> constexpr T sinh(T z) noexcept;
//! }
//! @endcode
//!
//! **Parameters**
//!
//! * `z` : Value to process.
//!
//! **Return value**
//!
//! Returns the hyperbolic sine of the argument.
//!
//! @groupheader{Example}
//!
//! @godbolt{doc/sinh.cpp}
//! @}
//======================================================================================================================
inline constexpr tags::callable_sinh sinh = {};
}
74 changes: 74 additions & 0 deletions include/kyosu/functions/sinhcosh.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
//======================================================================================================================
/*
Kyosu - Complex Without Complexes
Copyright : KYOSU Contributors & Maintainers
SPDX-License-Identifier: BSL-1.0
*/
//======================================================================================================================
#pragma once

#include <kyosu/details/invoke.hpp>
#include <eve/module/math.hpp>

namespace kyosu::tags
{
struct callable_sinhcosh : eve::elementwise
{
using callable_tag_type = callable_sinhcosh;

KYOSU_DEFERS_CALLABLE(sinhcosh_);

template<eve::ordered_value T>
static KYOSU_FORCEINLINE auto deferred_call(auto, T const& v) noexcept { return eve::sinhcosh(v); }

template<typename T>
KYOSU_FORCEINLINE auto operator()(T const& target) const noexcept -> decltype(eve::tag_invoke(*this, target))
{
return eve::tag_invoke(*this, target);
}

template<typename... T>
eve::unsupported_call<callable_sinhcosh(T&&...)> operator()(T&&... x) const
requires(!requires { eve::tag_invoke(*this, KYOSU_FWD(x)...); }) = delete;
};
}

namespace kyosu
{
//======================================================================================================================
//! @addtogroup functions
//! @{
//! @var sinhcosh
//! @brief Computes simultaneously the hyperbolic sine and cosine of the argument.
//!
//! **Defined in Header**
//!
//! @code
//! #include <kyosu/functions.hpp>
//! @endcode
//!
//! @groupheader{Callable Signatures}
//!
//! @code
//! namespace kyosu
//! {
//! template<kyosu::concepts::cayley_dickson T> constexpr auto sinhcosh(T z) noexcept;
//! template<eve::ordered_value T> constexpr auto sinhcosh(T z) noexcept;
//! }
//! @endcode
//!
//! **Parameters**
//!
//! * `z` : Value to process.
//!
//! **Return value**
//!
//! Returns simultaneously the hyperbolic sine and cosine of the argument.
//!
//! @groupheader{Example}
//!
//! @godbolt{doc/sinhcosh.cpp}
//! @}
//======================================================================================================================
inline constexpr tags::callable_sinhcosh sinhcosh = {};
}
Loading