Compute Library
18.05
|
Constant expressions. More...
#include <FixedPoint.h>
Static Public Member Functions | |
static constexpr T | fixed_one (uint8_t p) |
Calculate representation of 1 in fixed point given a fixed point precision. More... | |
static constexpr float | fixed_step (uint8_t p) |
Calculate fixed point precision step given a fixed point precision. More... | |
static constexpr float | to_float (T val, uint8_t p) |
Convert a fixed point value to float given its precision. More... | |
static constexpr T | to_int (T val, uint8_t p) |
Convert a fixed point value to integer given its precision. More... | |
static constexpr T | to_fixed (float val, uint8_t p) |
Convert a single precision floating point value to a fixed point representation given its precision. More... | |
static constexpr T | clamp (T val, T min, T max) |
Clamp value between two ranges. More... | |
template<typename U > | |
static constexpr T | saturate_cast (U val) |
Saturate given number. More... | |
Constant expressions.
Definition at line 48 of file FixedPoint.h.
|
inlinestatic |
Clamp value between two ranges.
[in] | val | Value to clamp |
[in] | min | Minimum value to clamp to |
[in] | max | Maximum value to clamp to |
Definition at line 361 of file FixedPoint.h.
References arm_compute::test::fixed_point_arithmetic::detail::max(), and arm_compute::test::fixed_point_arithmetic::detail::min().
Referenced by functions::clamp().
|
inlinestatic |
Calculate representation of 1 in fixed point given a fixed point precision.
[in] | p | Fixed point precision |
Definition at line 305 of file FixedPoint.h.
|
inlinestatic |
Calculate fixed point precision step given a fixed point precision.
[in] | p | Fixed point precision |
Definition at line 315 of file FixedPoint.h.
|
inlinestatic |
Saturate given number.
[in] | val | Value to saturate |
Definition at line 372 of file FixedPoint.h.
References arm_compute::test::fixed_point_arithmetic::detail::max(), arm_compute::test::fixed_point_arithmetic::detail::min(), and arm_compute::U.
Referenced by functions::add(), functions::div(), fixed_point< T >::fixed_point(), functions::mul(), functions::negate(), fixed_point< T >::operator fixed_point< U >(), fixed_point< T >::rescale(), functions::shift_left(), and functions::sub().
|
inlinestatic |
Convert a single precision floating point value to a fixed point representation given its precision.
[in] | val | Floating point value |
[in] | p | Fixed point precision |
Definition at line 349 of file FixedPoint.h.
References arm_compute::test::saturate_cast().
|
inlinestatic |
Convert a fixed point value to float given its precision.
[in] | val | Fixed point value |
[in] | p | Fixed point precision |
Definition at line 327 of file FixedPoint.h.
Referenced by fixed_point< T >::operator float().
|
inlinestatic |
Convert a fixed point value to integer given its precision.
[in] | val | Fixed point value |
[in] | p | Fixed point precision |
Definition at line 338 of file FixedPoint.h.
Referenced by functions::exp(), and fixed_point< T >::operator U().