Provides utilities for converting an integer to the corresponding expression in the positional notation with given base and number of digits.
More...
|
__host__ __device__ | BaseConverter () |
|
__host__ __device__ | BaseConverter (Integer Base, Integer Length) |
| Construct a new BaseConverter object.
|
|
__host__ __device__ | BaseConverter (BaseConverter< Integer > const &other) |
|
__host__ void | status (void) const |
| Show the status of the instance.
|
|
__host__ __device__ Integer | base () const |
|
__host__ __device__ Integer | length () const |
|
__host__ __device__ Integer | maxVal () const |
|
__host__ __device__ Integer | value () const |
|
template<typename Input , typename std::enable_if_t< !std::is_integral_v< Input > > * = nullptr> |
__host__ __device__ BaseConverter const & | set (Input config) const |
|
template<typename Input > |
__host__ __device__ BaseConverter const & | set (Input num) const |
|
__host__ __device__ BaseConverter & | setParam (Integer Base, Integer Length) |
| Set the base and the length of the positional notation to which the input number will converted.
|
|
__host__ __device__ Integer | digit (Integer const num, Integer const pos, Integer const base, Integer const length) const |
| Returns the (pos)-th digit of the input (num) in given base and length.
|
|
__host__ __device__ Integer | digit (Integer const num, Integer const pos) const |
|
__host__ __device__ Integer | digit (Integer const pos) const |
|
__host__ __device__ Integer | shiftDigits (Integer const num, Integer const trans, Integer const base, Integer const length) const |
| Shifts a number (num) to right by (trans) in terms of the positional notation with given base and length under the periodic boundary condition.
|
|
__host__ __device__ Integer | shiftDigits (Integer const num, Integer const trans) const |
|
__host__ __device__ BaseConverter const & | shiftDigits (Integer const trans) const |
|
template<typename Input > |
__host__ __device__ Integer | digitsToNumber (Input const &digits, Integer const base, Integer const length) const |
| Converts an array of integers to the corresponding integer in terms of the positional notation with given (base) and (length)
|
|
template<typename Input > |
__host__ __device__ Integer | digitsToNumber (Input const &digits) const |
|
template<typename Output > |
__host__ __device__ auto | printInDigits (Output &output, Integer const num, Integer const base, Integer const length) const -> typename std::enable_if< std::is_integral< Output >::value==false, BaseConverter const & >::type |
| Expresses an integer (num) in the positional notation with given (base) and (length)
|
|
template<typename Output > |
__host__ __device__ auto | printInDigits (Output &output, Integer const num) const -> typename std::enable_if< std::is_integral< Output >::value==false, BaseConverter const & >::type |
|
template<typename Output , typename std::enable_if_t< !std::is_integral_v< Output > > * = nullptr> |
__host__ __device__ BaseConverter const & | printInDigits (Output &output) const |
|
__host__ BaseConverter const & | printInDigits (Integer const num, Integer const base, Integer const length) const |
|
__host__ BaseConverter const & | printInDigits (Integer const num) const |
|
__host__ BaseConverter const & | printInDigits () const |
|
template<typename Integer = int>
class BaseConverter< Integer >
Provides utilities for converting an integer to the corresponding expression in the positional notation with given base and number of digits.
- Template Parameters
-