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

#include <DGtal/kernel/NumberTraits.h>

Public Types

typedef TagTrue IsIntegral
 
typedef TagTrue IsBounded
 
typedef TagFalse IsUnsigned
 
typedef TagTrue IsSigned
 
typedef TagTrue IsSpecialized
 
typedef int64_t SignedVersion
 
typedef uint64_t UnsignedVersion
 
typedef int64_t ReturnType
 
typedef boost::call_traits< int64_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 int64_t &aT)
 
static double castToDouble (const int64_t &aT)
 
static bool even (ParamType aT)
 
static bool odd (ParamType aT)
 

Static Public Attributes

static const int64_t ZERO = 0
 
static const int64_t ONE = 1
 

Detailed Description

template<>
struct DGtal::NumberTraits< int64_t >

Specialization for DGtal::int64_t.

Definition at line 705 of file NumberTraits.h.

Member Typedef Documentation

Definition at line 708 of file NumberTraits.h.

Definition at line 707 of file NumberTraits.h.

Definition at line 710 of file NumberTraits.h.

Definition at line 711 of file NumberTraits.h.

Definition at line 709 of file NumberTraits.h.

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

Definition at line 715 of file NumberTraits.h.

Definition at line 714 of file NumberTraits.h.

Definition at line 712 of file NumberTraits.h.

Definition at line 713 of file NumberTraits.h.

Member Function Documentation

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

Definition at line 750 of file NumberTraits.h.

751  {
752  return static_cast<double>(aT);
753  }
static DGtal::int64_t DGtal::NumberTraits< int64_t >::castToInt64_t ( const int64_t aT)
inlinestatic

Definition at line 746 of file NumberTraits.h.

747  {
748  return aT;
749  }
static unsigned int DGtal::NumberTraits< int64_t >::digits ( )
inlinestatic

Definition at line 734 of file NumberTraits.h.

735  {
736  return boost::integer_traits<int64_t>::digits;
737  }
static bool DGtal::NumberTraits< int64_t >::even ( ParamType  aT)
inlinestatic
Parameters
aTany number.
Returns
'true' iff the number is even.

Definition at line 758 of file NumberTraits.h.

759  {
760  return ( aT & 1 ) == 0;
761  }
static BoundEnum DGtal::NumberTraits< int64_t >::isBounded ( )
inlinestatic

Definition at line 738 of file NumberTraits.h.

References DGtal::BOUNDED.

739  {
740  return BOUNDED;
741  }
static SignEnum DGtal::NumberTraits< int64_t >::isSigned ( )
inlinestatic

Definition at line 742 of file NumberTraits.h.

References DGtal::SIGNED.

743  {
744  return SIGNED;
745  }
static ReturnType DGtal::NumberTraits< int64_t >::max ( )
inlinestatic

Definition at line 730 of file NumberTraits.h.

731  {
732  return boost::integer_traits<int64_t>::const_max;
733  }
static ReturnType DGtal::NumberTraits< int64_t >::min ( )
inlinestatic

Definition at line 726 of file NumberTraits.h.

727  {
728  return boost::integer_traits<int64_t>::const_min;
729  }
static bool DGtal::NumberTraits< int64_t >::odd ( ParamType  aT)
inlinestatic
Parameters
aTany number.
Returns
'true' iff the number is odd.

Definition at line 766 of file NumberTraits.h.

767  {
768  return ( aT & 1 ) != 0;
769  }
static ReturnType DGtal::NumberTraits< int64_t >::one ( )
inlinestatic

Definition at line 722 of file NumberTraits.h.

723  {
724  return 1;
725  }
static ReturnType DGtal::NumberTraits< int64_t >::zero ( )
inlinestatic

Definition at line 718 of file NumberTraits.h.

719  {
720  return 0;
721  }

Field Documentation

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

Definition at line 717 of file NumberTraits.h.

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

Definition at line 716 of file NumberTraits.h.


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