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

ps #1879

Merged
merged 3 commits into from
Jul 8, 2024
Merged

ps #1879

Show file tree
Hide file tree
Changes from 1 commit
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
23 changes: 5 additions & 18 deletions include/eve/module/combinatorial/regular/prime_ceil.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ namespace eve
//! @addtogroup combinatorial
//! @{
//! @var prime_ceil
//! @brief Returns the smallest prime greater or equal to the input.
//! @brief `strict_elementwise_callable` object computing the smallest prime greater or equal to the input.
//!
//! **Defined in Header**
//! @groupheader{Header file}
//!
//! @code
//! #include <eve/module/combinatorial.hpp>
Expand All @@ -54,8 +54,7 @@ namespace eve
//! @code
//! namespace eve
//! {
//! template< eve::unsigned_value N >
//! constexpr N prime_ceil(N n) noexcept;
//! constexpr auto prime_ceil(unsigned_value auto x) noexcept;
//! }
//! @endcode
//!
Expand All @@ -64,23 +63,11 @@ namespace eve
//! * `n` : unsigned argument. If `n` is greater than 104'729, behavior is undefined.
//!
//! **Return value**
//! The smallest prime greater or equal to `n`.
//! The result type is the same as the input one unless a converter is applied (see below).
//! The smallest prime greater or equal to `n`.
//! The result type is the same as the input one unless a converter is applied (see below).
//!
//! @groupheader{Example}
//!
//! @godbolt{doc/combinatorial/regular/prime_ceil.cpp}
//!
//! @groupheader{Semantic Modifiers}
//!
//! * Optimized Conversion Call
//!
//! The converters eve::float_, eve::double_, eve::floating_ can be applied to
//! produce a floating point output.
//!
//! **Example**
//!
//! @godbolt{doc/combinatorial/conversion/prime_ceil.cpp}
//! @}
//================================================================================================
inline constexpr auto prime_ceil = functor<prime_ceil_t>;
Expand Down
23 changes: 5 additions & 18 deletions include/eve/module/combinatorial/regular/prime_floor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ namespace eve
//! @addtogroup combinatorial
//! @{
//! @var prime_floor
//! @brief Returns the the greatest prime less or equal to the input.
//! @brief `strict_elementwise_callable` object computing the greatest prime less or equal to the input.
//!
//! **Defined in Header**
//! @groupheader{Header file}
//!
//! @code
//! #include <eve/module/combinatorial.hpp>
Expand All @@ -52,8 +52,7 @@ namespace eve
//! @code
//! namespace eve
//! {
//! template< eve::unsigned_value N >
//! constexpr N prime_floor(N n) noexcept ;
//! constexpr auto prime_floor(unsigned_value auto x) noexcept;
//! }
//! @endcode
//!
Expand All @@ -62,23 +61,11 @@ namespace eve
//! * `n` : unsigned argument. If `n` is greater than 104'729, behavior is undefined.
//!
//! **Return value**
//! The greatest prime less or equal to `n`.
//! The result type is the same as the input one unless a converter is applied (see below).
//! The greatest prime less or equal to `n`.
//! The result type is the same as the input one unless a converter is applied (see below).
//!
//! @groupheader{Example}
//!
//! @godbolt{doc/combinatorial/regular/prime_floor.cpp}
//!
//! @groupheader{Semantic Modifiers}
//!
//! * Optimized Conversion Call
//!
//! The converters eve::float_, eve::double_, eve::floating_ can be applied to
//! produce a floating point output.
//!
//! **Example**
//!
//! @godbolt{doc/combinatorial/conversion/prime_floor.cpp}
//! @}
//================================================================================================
inline constexpr auto prime_floor = functor<prime_floor_t>;
Expand Down
13 changes: 5 additions & 8 deletions include/eve/module/core/regular/popcount.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ namespace eve
//! @addtogroup core_bitops
//! @{
//! @var popcount
//! @brief Computes elementwise the number of bits set in the parameter.
//! @brief `elementwise_callable` object computing elementwise the number of bits set in the parameter.
//!
//! **Defined in Header**
//! @groupheader{Header file}
//!
//! @code
//! #include <eve/module/core.hpp>
Expand All @@ -42,22 +42,19 @@ namespace eve
//! @code
//! namespace eve
//! {
//! template< eve::unsigned_value T >
//! T popcount(T x) noexcept;
//! constexpr auto popcount(unsigned_value auto x) noexcept;
//! }
//! @endcode
//!
//! **Parameters**
//!
//! * `x` : [unsigned argument](@ref eve::unsigned_value).
//! * `x`: [unsigned argument](@ref eve::unsigned_value).
//!
//! **Return value**
//!
//! The value of number of bits set in the value `x`
//! is returned.
//! The value of number of bits set in the value `x` is returned.
//!
//! @groupheader{Example}
//!
//! @godbolt{doc/core/popcount.cpp}
//! @}
//================================================================================================
Expand Down
46 changes: 21 additions & 25 deletions include/eve/module/core/regular/prev.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,44 +60,40 @@ namespace eve
//! @code
//! namespace eve
//! {
//! template< eve::value T, eve::integral_value N >
//! eve::common_value_t<T, U> prev(T x, N n = 1) noexcept;
//! // Regular overloads
//! constexpr auto prev(value auto x) noexcept; // 1
//! constexpr auto prev(value auto x, integral_value auto n) noexcept; // 2
//!
//! // Lanes masking
//! constexpr auto prev[conditional_expr auto c](/* any of the above overloads */) noexcept; // 3
//! constexpr auto prev[logical_value auto m](/* any of the above overloads */) noexcept; // 3
//!
//! // Exclusive Semantic options - Only one of those can be set at once
//! constexpr auto prev[pedantic](/* any of the above overloads */) noexcept; // 5.1
//! constexpr auto prev[saturated ](/* any of the above overloads */) noexcept; // 5.2
//! }
//! @endcode
//!
//! **Parameters**
//!
//! * `x`: [floating argument](@ref eve::floating_value).
//!
//! * `n` : [integral value argument](@ref eve::integral_value).
//! * `x`: [floating argument](@ref eve::floating_value).
//! * `n`: [integral value argument](@ref eve::integral_value).
//! * `c`: [Conditional expression](@ref conditional_expr) masking the operation.
//! * `m`: [Logical value](@ref logical) masking the operation.
//!
//! **Return value**
//!
//! 1. the greatest representable value less than `x` is returned.
//! 2. the nth representable value less than `x` is returned. If `n` is zero returns `x`.
//! 3. [The operation is performed conditionnaly](@ref conditional)
//! 4. if `x` is floating zero and mzero are considered distinct.
//! 5. ensures that the input is never less than the result of the call.
//!
//! The value of the nth representable value less than `x` is returned.
//! If `n` is zero returns `x`.
//!
//! @groupheader{Example}
//!
//! @godbolt{doc/core/prev.cpp}
//!
//! @groupheader{Semantic Modifiers}
//!
//! * Masked Call
//!
//! The call `eve::prev[mask](x, ...)` provides a masked
//! version of `prev` which is
//! equivalent to `if_else(mask, prev(x, ...), x)`
//!
//! * eve::pedantic
//!
//! The call `eve::prev[eve::pedantic](x, ...)` provides a pedantic
//! version of `prev` which ensures that the predecessor of eve::zero is eve::mzero
//! for floating points entries
//!
//! * eve::saturated
//!
//! The call `eve::prev[eve::saturated](x, ...)` provides a saturated
//! version of `prev` which ensures that that x is never greater than the result of the call.
//!//! @}
//================================================================================================
inline constexpr auto prev = functor<prev_t>;
Expand Down
32 changes: 13 additions & 19 deletions include/eve/module/math/regular/pow.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ namespace eve
//!
//! @brief Callable object computing the pow operation \f$x^y\f$.
//!
//! **Defined in Header**
//! @groupheader{Header file}
//!
//! @code
//! #include <eve/module/math.hpp>
Expand All @@ -68,8 +68,15 @@ namespace eve
//! @code
//! namespace eve
//! {
//! template< eve::floating_value T, eve::floating_value U >
//! auto pow(T x, U y) noexcept;
//! // Regular overload
//! constexpr auto pow(value auto x, value auto y) noexcept; // 1
//!
//! // Lanes masking
//! constexpr auto pow[conditional_expr auto c](value auto x, value auto y) noexcept; // 2
//! constexpr auto pow[logical_value auto m](value auto x, value auto y) noexcept; // 2
//!
//! // Semantic options
//! constexpr auto pow[raw](value auto x, value auto y) noexcept; // 3
//! }
//! @endcode
//!
Expand All @@ -78,10 +85,7 @@ namespace eve
//!
//! **Return value**
//!
//! Returns [elementwise](@ref glossary_elementwise) \f$x^y\f$.
//!
//! * The result type is the [common value type](@ref common_value_t) of the two parameters.
//! In particular we have (IEC 60559):
//! 1. Returns [elementwise](@ref glossary_elementwise) \f$x^y\f$. In particular we have (IEC 60559):
//!
//! * pow(+0, y), where y is a negative odd integer, returns \f$+\infty\f$
//! * pow(-0, y), where y is a negative odd integer, returns \f$-\infty\f$
Expand All @@ -106,21 +110,11 @@ namespace eve
//! * pow(\f$+\infty\f$, y) returns +0 for any y less than 0
//! * pow(\f$+\infty\f$, y) returns \f$+\infty\f$ for any y greater than 0
//! * except where specified above, if any argument is NaN, NaN is returned
//! 2. [The operation is performed conditionnaly](@ref conditional)
//! 3. speedier must less accurate call
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Faster is the correct word

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

//!
//! @groupheader{Example}
//!
//! @godbolt{doc/math/regular/pow.cpp}
//!
//! @groupheader{Semantic Modifiers}
//!
//! * Masked Call
//!
//! The call `eve::pow[mask](x, y)` provides a masked version of `eve::pow` which is
//! equivalent to `if_else (mask, pow(x, y), x)`.
//!
//! **Example**
//!
//! @godbolt{doc/math/masked/pow.cpp}
//! @}
//================================================================================================
inline constexpr auto pow = functor<pow_t>;
Expand Down
35 changes: 17 additions & 18 deletions include/eve/module/math/regular/pow1p.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,45 +38,44 @@ namespace eve
//!
//! @brief Callable object computing pow1p: \f$(1+x)^y\f$.
//!
//! **Defined in Header**
//! @groupheader{Header file}
//!
//! @code
//! #include <eve/module/math.hpp>
//! @endcode
//!
//! @groupheader{Callable Signatures}
//!
//!
//! @code
//! namespace eve
//! {
//! template< eve::floating_value T, eve::floating_value U >
//! auto pow1p(T x, U y) noexcept;
//! // Regular overload
//! constexpr auto pow1p(value auto x, value auto y) noexcept; // 1
//!
//! // Lanes masking
//! constexpr auto pow1p[conditional_expr auto c](value auto x, value auto y) noexcept; // 2
//! constexpr auto pow1p[logical_value auto m](value auto x, value auto y) noexcept; // 2
//!
//! // Semantic options
//! constexpr auto pow1p[raw](value auto x, value auto y) noexcept; // 3
//! }
//! @endcode
//!
//! **Parameters**
//!
//! * `x`, `y`: [integral value](@ref integral_value) arguments.
//! * `c`: [Conditional expression](@ref conditional_expr) masking the operation.
//! * `m`: [Logical value](@ref logical) masking the operation.
//!
//! **Return value**
//!
//! Returns the [elementwise](@ref glossary_elementwise) \f$(1+x)^y\f$, with good accuracy,
//! even when `x` is small.
//! 1. Returns the [elementwise](@ref glossary_elementwise) \f$(1+x)^y\f$, with good accuracy,
//! even when `x` is small.
//! 2. [The operation is performed conditionnaly](@ref conditional)
//! 3. speedier must less accurate call.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Faster

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

//!
//! @groupheader{Example}
//!
//! @godbolt{doc/math/regular/pow1p.cpp}
//!
//! @groupheader{Semantic Modifiers}
//!
//! * Masked Call
//!
//! The call `eve::pow1p[mask](x, y)` provides a masked version of `eve::pow1p` which is
//! equivalent to `if_else (mask, pow1p(x, y), x)`.
//!
//! **Example**
//!
//! @godbolt{doc/math/masked/pow1p.cpp}
//! @}
//================================================================================================
inline constexpr auto pow1p = functor<pow1p_t>;
Expand Down
Loading
Loading