File failed to load: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.3/config/TeX-MML-AM_CHTML/MathJax.js
DGtal 2.0.0
DGtal::NumberTraitsImpl< DGtal::BigInteger, Enable > Struct Template Reference

Specialization of NumberTraitsImpl for DGtal::BigInteger. More...

#include <DGtal/kernel/NumberTraits.h>

Inheritance diagram for DGtal::NumberTraitsImpl< DGtal::BigInteger, Enable >:
[legend]

Public Types

typedef TagTrue IsIntegral
 A BigInteger is of integral type.
typedef TagFalse IsBounded
 A BigInteger is not bounded.
typedef TagTrue IsUnsigned
 A BigInteger can be signed and unsigned.
typedef TagTrue IsSigned
 a BigInteger can be signed and unsigned.
typedef TagTrue IsSpecialized
 Is that a number type with specific traits.
typedef DGtal::BigInteger SignedVersion
 Alias to the signed version of a BigInteger (aka a BigInteger).
typedef DGtal::BigInteger UnsignedVersion
 Alias to the unsigned version of a BigInteger (aka a BigInteger).
typedef DGtal::BigInteger ReturnType
 Alias to the type that should be used as return type.
typedef boost::call_traits< BigInteger >::param_type ParamType
 Defines a type that represents the "best" way to pass a parameter of type T to a function.

Static Public Member Functions

static ReturnType zero () noexcept
 Return the zero of this integer.
static ReturnType one () noexcept
 Return the one of this integer.
static ReturnType min () noexcept
 Return the minimum possible value (trigger an error since BitInteger is unbounded).
static ReturnType max () noexcept
 Return the maximum possible value (trigger an error since BitInteger is unbounded).
static unsigned int digits () noexcept
 Return the number of significant binary digits (trigger an error since BitInteger is unbounded).
static BoundEnum isBounded () noexcept
 Return the bounding type of the number.
static SignEnum isSigned () noexcept
 Return the sign type of the number.
static DGtal::int64_t castToInt64_t (const DGtal::BigInteger &aT) noexcept
 Cast method to DGtal::int64_t (for I/O or board export uses only).
static DGtal::uint64_t castToUInt64_t (const DGtal::BigInteger &aT) noexcept
 Cast method to DGtal::uint64_t (for I/O or board export uses only).
static double castToDouble (const DGtal::BigInteger &aT) noexcept
 Cast method to double (for I/O or board export uses only).
static bool even (ParamType aT) noexcept
 Check the parity of a number.
static bool odd (ParamType aT) noexcept
 Check the parity of a number.

Static Public Attributes

static const DGtal::BigInteger ZERO
 Constant Zero.
static const DGtal::BigInteger ONE
 Constant One.

Detailed Description

template<typename Enable>
struct DGtal::NumberTraitsImpl< DGtal::BigInteger, Enable >

Specialization of NumberTraitsImpl for DGtal::BigInteger.

Note that DGtal::BigInteger represents signed and unsigned arbitrary-size integers. Therefore both IsUnsigned and IsSigned are TagTrue.

Definition at line 406 of file NumberTraits.h.

Member Typedef Documentation

◆ IsBounded

template<typename Enable>
typedef TagFalse DGtal::NumberTraitsImpl< DGtal::BigInteger, Enable >::IsBounded

A BigInteger is not bounded.

Definition at line 409 of file NumberTraits.h.

◆ IsIntegral

template<typename Enable>
typedef TagTrue DGtal::NumberTraitsImpl< DGtal::BigInteger, Enable >::IsIntegral

A BigInteger is of integral type.

Definition at line 408 of file NumberTraits.h.

◆ IsSigned

template<typename Enable>
typedef TagTrue DGtal::NumberTraitsImpl< DGtal::BigInteger, Enable >::IsSigned

a BigInteger can be signed and unsigned.

Definition at line 411 of file NumberTraits.h.

◆ IsSpecialized

template<typename Enable>
typedef TagTrue DGtal::NumberTraitsImpl< DGtal::BigInteger, Enable >::IsSpecialized

Is that a number type with specific traits.

Definition at line 412 of file NumberTraits.h.

◆ IsUnsigned

template<typename Enable>
typedef TagTrue DGtal::NumberTraitsImpl< DGtal::BigInteger, Enable >::IsUnsigned

A BigInteger can be signed and unsigned.

Definition at line 410 of file NumberTraits.h.

◆ ParamType

template<typename Enable>
typedef boost::call_traits<BigInteger>::param_type DGtal::NumberTraitsImpl< DGtal::BigInteger, Enable >::ParamType

Defines a type that represents the "best" way to pass a parameter of type T to a function.

Definition at line 421 of file NumberTraits.h.

◆ ReturnType

template<typename Enable>
typedef DGtal::BigInteger DGtal::NumberTraitsImpl< DGtal::BigInteger, Enable >::ReturnType

Alias to the type that should be used as return type.

Definition at line 416 of file NumberTraits.h.

◆ SignedVersion

template<typename Enable>
typedef DGtal::BigInteger DGtal::NumberTraitsImpl< DGtal::BigInteger, Enable >::SignedVersion

Alias to the signed version of a BigInteger (aka a BigInteger).

Definition at line 414 of file NumberTraits.h.

◆ UnsignedVersion

template<typename Enable>
typedef DGtal::BigInteger DGtal::NumberTraitsImpl< DGtal::BigInteger, Enable >::UnsignedVersion

Alias to the unsigned version of a BigInteger (aka a BigInteger).

Definition at line 415 of file NumberTraits.h.

Member Function Documentation

◆ castToDouble()

template<typename Enable>
double DGtal::NumberTraitsImpl< DGtal::BigInteger, Enable >::castToDouble ( const DGtal::BigInteger & aT)
inlinestaticnoexcept

Cast method to double (for I/O or board export uses only).

Definition at line 513 of file NumberTraits.h.

514 {
515 return static_cast<double>(aT);
516 }
Aim: The traits class for all models of Cinteger (implementation)

◆ castToInt64_t()

template<typename Enable>
DGtal::int64_t DGtal::NumberTraitsImpl< DGtal::BigInteger, Enable >::castToInt64_t ( const DGtal::BigInteger & aT)
inlinestaticnoexcept

Cast method to DGtal::int64_t (for I/O or board export uses only).

Definition at line 492 of file NumberTraits.h.

493 {
494 return static_cast<DGtal::int64_t>(aT);
495 }

◆ castToUInt64_t()

template<typename Enable>
DGtal::uint64_t DGtal::NumberTraitsImpl< DGtal::BigInteger, Enable >::castToUInt64_t ( const DGtal::BigInteger & aT)
inlinestaticnoexcept

Cast method to DGtal::uint64_t (for I/O or board export uses only).

Definition at line 502 of file NumberTraits.h.

503 {
504 return static_cast<DGtal::uint64_t>(aT);
505 }

◆ digits()

template<typename Enable>
unsigned int DGtal::NumberTraitsImpl< DGtal::BigInteger, Enable >::digits ( )
inlinestaticnoexcept

Return the number of significant binary digits (trigger an error since BitInteger is unbounded).

Definition at line 461 of file NumberTraits.h.

462 {
463 FATAL_ERROR_MSG(false, "UnBounded interger type does not support digits() function");
464 return 0;
465 }

◆ even()

template<typename Enable>
bool DGtal::NumberTraitsImpl< DGtal::BigInteger, Enable >::even ( ParamType aT)
inlinestaticnoexcept

Check the parity of a number.

Parameters
aTany number.
Returns
'true' iff the number is even.

Definition at line 524 of file NumberTraits.h.

525 {
527 }

◆ isBounded()

template<typename Enable>
BoundEnum DGtal::NumberTraitsImpl< DGtal::BigInteger, Enable >::isBounded ( )
inlinestaticnoexcept

Return the bounding type of the number.

Returns
BOUNDED, UNBOUNDED, or BOUND_UNKNOWN.

Definition at line 472 of file NumberTraits.h.

473 {
474 return UNBOUNDED;
475 }

References DGtal::UNBOUNDED.

◆ isSigned()

template<typename Enable>
SignEnum DGtal::NumberTraitsImpl< DGtal::BigInteger, Enable >::isSigned ( )
inlinestaticnoexcept

Return the sign type of the number.

Returns
SIGNED, UNSIGNED or SIGN_UNKNOWN.

Definition at line 482 of file NumberTraits.h.

483 {
484 return SIGNED;
485 }

References DGtal::SIGNED.

◆ max()

template<typename Enable>
ReturnType DGtal::NumberTraitsImpl< DGtal::BigInteger, Enable >::max ( )
inlinestaticnoexcept

Return the maximum possible value (trigger an error since BitInteger is unbounded).

Definition at line 453 of file NumberTraits.h.

454 {
455 FATAL_ERROR_MSG(false, "UnBounded interger type does not support max() function");
456 return zero();
457 }
static ReturnType zero() noexcept
Return the zero of this integer.

References DGtal::NumberTraitsImpl< T, Enable >::zero().

◆ min()

template<typename Enable>
ReturnType DGtal::NumberTraitsImpl< DGtal::BigInteger, Enable >::min ( )
inlinestaticnoexcept

Return the minimum possible value (trigger an error since BitInteger is unbounded).

Definition at line 445 of file NumberTraits.h.

446 {
447 FATAL_ERROR_MSG(false, "UnBounded interger type does not support min() function");
448 return zero();
449 }

References DGtal::NumberTraitsImpl< T, Enable >::zero().

◆ odd()

template<typename Enable>
bool DGtal::NumberTraitsImpl< DGtal::BigInteger, Enable >::odd ( ParamType aT)
inlinestaticnoexcept

Check the parity of a number.

Parameters
aTany number.
Returns
'true' iff the number is odd.

Definition at line 535 of file NumberTraits.h.

536 {
538 }

◆ one()

template<typename Enable>
ReturnType DGtal::NumberTraitsImpl< DGtal::BigInteger, Enable >::one ( )
inlinestaticnoexcept

Return the one of this integer.

Definition at line 438 of file NumberTraits.h.

439 {
440 return ONE;
441 }
static const DGtal::BigInteger ONE
Constant One.

References ONE.

◆ zero()

template<typename Enable>
ReturnType DGtal::NumberTraitsImpl< DGtal::BigInteger, Enable >::zero ( )
inlinestaticnoexcept

Return the zero of this integer.

Definition at line 431 of file NumberTraits.h.

432 {
433 return ZERO;
434 }
static const DGtal::BigInteger ZERO
Constant Zero.

References ZERO.

Field Documentation

◆ ONE

template<typename Enable>
const DGtal::BigInteger DGtal::NumberTraitsImpl< DGtal::BigInteger, Enable >::ONE
static

Constant One.

Definition at line 427 of file NumberTraits.h.

Referenced by one().

◆ ZERO

template<typename Enable>
const DGtal::BigInteger DGtal::NumberTraitsImpl< DGtal::BigInteger, Enable >::ZERO
static

Constant Zero.

Definition at line 424 of file NumberTraits.h.

Referenced by zero().


The documentation for this struct was generated from the following file: