DGtal  0.9.4beta
Public Types | Static Public Member Functions | Static Public Attributes
DGtal::NumberTraits< uint64_t > Struct Template Reference

#include <DGtal/kernel/NumberTraits.h>

Public Types

typedef TagTrue IsIntegral
 
typedef TagTrue IsBounded
 
typedef TagTrue IsUnsigned
 
typedef TagFalse IsSigned
 
typedef TagTrue IsSpecialized
 
typedef int64_t SignedVersion
 
typedef uint64_t UnsignedVersion
 
typedef uint64_t ReturnType
 
typedef boost::call_traits< uint64_t >::param_type ParamType
 

Static Public Member Functions

static ReturnType zero ()
 
static ReturnType one ()
 
static ReturnType min ()
 
static ReturnType max ()
 
static unsigned int digits ()
 
static BoundEnum isBounded ()
 
static SignEnum isSigned ()
 
static DGtal::int64_t castToInt64_t (const uint64_t &aT)
 
static double castToDouble (const uint64_t &aT)
 
static bool even (ParamType aT)
 
static bool odd (ParamType aT)
 

Static Public Attributes

static const uint64_t ZERO = 0
 
static const uint64_t ONE = 1
 

Detailed Description

template<>
struct DGtal::NumberTraits< uint64_t >

Specialization for DGtal::uint64_t.

Definition at line 630 of file NumberTraits.h.

Member Typedef Documentation

Definition at line 633 of file NumberTraits.h.

Definition at line 632 of file NumberTraits.h.

Definition at line 635 of file NumberTraits.h.

Definition at line 636 of file NumberTraits.h.

Definition at line 634 of file NumberTraits.h.

typedef boost::call_traits<uint64_t>::param_type DGtal::NumberTraits< uint64_t >::ParamType

Definition at line 640 of file NumberTraits.h.

Definition at line 639 of file NumberTraits.h.

Definition at line 637 of file NumberTraits.h.

Definition at line 638 of file NumberTraits.h.

Member Function Documentation

static double DGtal::NumberTraits< uint64_t >::castToDouble ( const uint64_t aT)
inlinestatic

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

Definition at line 679 of file NumberTraits.h.

680  {
681  return static_cast<double>(aT);
682  }
static DGtal::int64_t DGtal::NumberTraits< uint64_t >::castToInt64_t ( const uint64_t aT)
inlinestatic

Definition at line 671 of file NumberTraits.h.

672  {
673  return static_cast<DGtal::int64_t>(aT);
674  }
boost::int64_t int64_t
signed 94-bit integer.
Definition: BasicTypes.h:74
static unsigned int DGtal::NumberTraits< uint64_t >::digits ( )
inlinestatic

Definition at line 659 of file NumberTraits.h.

660  {
661  return boost::integer_traits<uint64_t>::digits;
662  }
static bool DGtal::NumberTraits< uint64_t >::even ( ParamType  aT)
inlinestatic
Parameters
aTany number.
Returns
'true' iff the number is even.

Definition at line 687 of file NumberTraits.h.

688  {
689  return ( aT & 1 ) == 0;
690  }
static BoundEnum DGtal::NumberTraits< uint64_t >::isBounded ( )
inlinestatic

Definition at line 663 of file NumberTraits.h.

References DGtal::BOUNDED.

664  {
665  return BOUNDED;
666  }
static SignEnum DGtal::NumberTraits< uint64_t >::isSigned ( )
inlinestatic

Definition at line 667 of file NumberTraits.h.

References DGtal::UNSIGNED.

668  {
669  return UNSIGNED;
670  }
static ReturnType DGtal::NumberTraits< uint64_t >::max ( )
inlinestatic

Definition at line 655 of file NumberTraits.h.

656  {
657  return boost::integer_traits<uint64_t>::const_max;
658  }
static ReturnType DGtal::NumberTraits< uint64_t >::min ( )
inlinestatic

Definition at line 651 of file NumberTraits.h.

652  {
653  return boost::integer_traits<uint64_t>::const_min;
654  }
static bool DGtal::NumberTraits< uint64_t >::odd ( ParamType  aT)
inlinestatic
Parameters
aTany number.
Returns
'true' iff the number is odd.

Definition at line 695 of file NumberTraits.h.

696  {
697  return ( aT & 1 ) != 0;
698  }
static ReturnType DGtal::NumberTraits< uint64_t >::one ( )
inlinestatic

Definition at line 647 of file NumberTraits.h.

648  {
649  return 1;
650  }
static ReturnType DGtal::NumberTraits< uint64_t >::zero ( )
inlinestatic

Definition at line 643 of file NumberTraits.h.

644  {
645  return 0;
646  }

Field Documentation

const uint64_t DGtal::NumberTraits< uint64_t >::ONE = 1
static

Definition at line 642 of file NumberTraits.h.

const uint64_t DGtal::NumberTraits< uint64_t >::ZERO = 0
static

Definition at line 641 of file NumberTraits.h.


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