公有成员

CDynInt< T, sz >模板类参考


详细描述

template<class T, int sz>
class shogun::CDynInt< T, sz >

integer type of dynamic size

This object can be used to create huge integers. These integers can be used directly instead of the usual int32_t etc types since operators are properly overloaded.

An exampe use would be 512 wide unsigned ints consisting of four uint64's:

CDynInt<uint64_t, 4> int512;

This data type is mostly used as a (efficient) storage container for bit-mapped strings. Therefore, currently only comparison, assignment and bit operations are implemented.

TODO: implement add,mul,div

在文件DynInt.h36行定义。

所有成员的列表。

公有成员

 CDynInt ()
 CDynInt (uint8_t x)
 CDynInt (uint16_t x)
 CDynInt (uint32_t x)
 CDynInt (int32_t x)
 CDynInt (int64_t x)
 CDynInt (uint64_t x)
 CDynInt (const T x[sz])
 CDynInt (const CDynInt< T, sz > &x)
 ~CDynInt ()
CDynInt< T, sz > & operator= (const CDynInt< T, sz > &x)
const CDynInt< T, sz > operator| (const CDynInt< T, sz > &x) const
const CDynInt< T, sz > operator& (const CDynInt< T, sz > &x) const
CDynInt< T, sz > operator<< (int shift)
CDynInt< T, sz > operator>> (int shift)
const CDynInt< T, sz > operator^ (const CDynInt< T, sz > &x) const
const CDynInt< T, sz > operator+ (const CDynInt< T, sz > &x) const
const CDynInt< T, sz > operator- (const CDynInt< T, sz > &x) const
const CDynInt< T, sz > operator/ (const CDynInt< T, sz > &x) const
const CDynInt< T, sz > operator* (const CDynInt< T, sz > &x) const
CDynInt< T, sz > & operator+= (const CDynInt< T, sz > &x)
CDynInt< T, sz > & operator-= (const CDynInt< T, sz > &x)
CDynInt< T, sz > & operator*= (const CDynInt< T, sz > &x)
CDynInt< T, sz > & operator/= (const CDynInt< T, sz > &x)
bool operator== (const CDynInt< T, sz > &x) const
bool operator>= (const CDynInt< T, sz > &x) const
bool operator<= (const CDynInt< T, sz > &x) const
bool operator> (const CDynInt< T, sz > &x) const
bool operator< (const CDynInt< T, sz > &x) const
bool operator!= (const CDynInt< T, sz > &x) const
CDynInt< T, sz > & operator|= (const CDynInt< T, sz > &x)
CDynInt< T, sz > & operator&= (const CDynInt< T, sz > &x)
CDynInt< T, sz > & operator^= (const CDynInt< T, sz > &x)
CDynInt< T, sz > & operator<<= (int shift)
CDynInt< T, sz > & operator>>= (int shift)
CDynInt< T, sz > & operator~ ()
 operator T ()
CDynInt< T, sz > & operator-- ()
CDynInt< T, sz > & operator++ ()
void print_hex () const
void print_bits () const

构造及析构函数文档

CDynInt (  ) 

default constructor

creates a DynInt that is all zero.

在文件DynInt.h43行定义。

CDynInt ( uint8_t  x  ) 

constructor (set least significant ``word'')

The least significant word is set, the rest filled with zeros.

参数:
x least significant word

在文件DynInt.h55行定义。

CDynInt ( uint16_t  x  ) 

constructor (set least significant ``word'')

The least significant word is set, the rest filled with zeros.

参数:
x least significant word

在文件DynInt.h68行定义。

CDynInt ( uint32_t  x  ) 

constructor (set least significant ``word'')

The least significant word is set, the rest filled with zeros.

参数:
x least significant word

在文件DynInt.h81行定义。

CDynInt ( int32_t  x  ) 

constructor (set least significant ``word'')

The least significant word is set, the rest filled with zeros.

参数:
x least significant word

在文件DynInt.h94行定义。

CDynInt ( int64_t  x  ) 

constructor (set least significant ``word'')

The least significant word is set, the rest filled with zeros.

参数:
x least significant word

在文件DynInt.h107行定义。

CDynInt ( uint64_t  x  ) 

constructor (set least significant ``word'')

The least significant word is set, the rest filled with zeros.

参数:
x least significant word

在文件DynInt.h120行定义。

CDynInt ( const T  x[sz]  ) 

constructor (set whole array)

Initialize the DynInt based on an array, which is passed as an argument.

参数:
x array of size sz

在文件DynInt.h133行定义。

CDynInt ( const CDynInt< T, sz > &  x  ) 

copy constructor

在文件DynInt.h140行定义。

~CDynInt (  ) 

destructor

在文件DynInt.h147行定义。


成员函数文档

operator T (  ) 

cast to least significant word *dangerous*

在文件DynInt.h511行定义。

bool operator!= ( const CDynInt< T, sz > &  x  )  const

overload ! operator; test if current object is not equal to x

参数:
x x

在文件DynInt.h426行定义。

const CDynInt<T,sz> operator& ( const CDynInt< T, sz > &  x  )  const

overload & operator and return x & y

参数:
x x

在文件DynInt.h179行定义。

CDynInt<T,sz>& operator&= ( const CDynInt< T, sz > &  x  ) 

overload &= operator

perform bitwise and with current DynInt and x

参数:
x x

在文件DynInt.h456行定义。

const CDynInt<T,sz> operator* ( const CDynInt< T, sz > &  x  )  const

overload * operator and return x * y

参数:
x x

在文件DynInt.h302行定义。

CDynInt<T,sz>& operator*= ( const CDynInt< T, sz > &  x  ) 

overload *= operator; multiple x to with current DynInt

参数:
x x

在文件DynInt.h329行定义。

const CDynInt<T,sz> operator+ ( const CDynInt< T, sz > &  x  )  const

overload + operator and return x + y

参数:
x x

在文件DynInt.h263行定义。

CDynInt<T,sz>& operator++ (  ) 

increment DynInt by one

在文件DynInt.h529行定义。

CDynInt<T,sz>& operator+= ( const CDynInt< T, sz > &  x  ) 

overload += operator; add x to current DynInt

参数:
x x

在文件DynInt.h311行定义。

const CDynInt<T,sz> operator- ( const CDynInt< T, sz > &  x  )  const

overload - operator and return x - y

参数:
x x

在文件DynInt.h284行定义。

CDynInt<T,sz>& operator-- (  ) 

decrement DynInt by one

在文件DynInt.h514行定义。

CDynInt<T,sz>& operator-= ( const CDynInt< T, sz > &  x  ) 

overload -= operator; substract x from current DynInt

参数:
x x

在文件DynInt.h320行定义。

const CDynInt<T,sz> operator/ ( const CDynInt< T, sz > &  x  )  const

overload / operator and return x / y

参数:
x x

在文件DynInt.h293行定义。

CDynInt<T,sz>& operator/= ( const CDynInt< T, sz > &  x  ) 

overload /= operator; divide current object by x

参数:
x x

在文件DynInt.h338行定义。

bool operator< ( const CDynInt< T, sz > &  x  )  const

overload < operator; test if current object is smaller than x

参数:
x x

在文件DynInt.h410行定义。

CDynInt<T,sz> operator<< ( int  shift  ) 

overload << operator

perform bit shift to the left

参数:
shift shift by this amount

在文件DynInt.h195行定义。

CDynInt<T,sz>& operator<<= ( int  shift  ) 

overload <<= operator

perform bit shift to the left

参数:
shift shift by this amount

在文件DynInt.h484行定义。

bool operator<= ( const CDynInt< T, sz > &  x  )  const

overload <= operator; test if current object lower equal x

参数:
x x

在文件DynInt.h378行定义。

CDynInt<T,sz>& operator= ( const CDynInt< T, sz > &  x  ) 

overload = operator

参数:
x assign elements from x

在文件DynInt.h154行定义。

bool operator== ( const CDynInt< T, sz > &  x  )  const

overload == operator; test if current object equals x

参数:
x x

在文件DynInt.h347行定义。

bool operator> ( const CDynInt< T, sz > &  x  )  const

overload > operator; test if current object is bigger than x

参数:
x x

在文件DynInt.h394行定义。

bool operator>= ( const CDynInt< T, sz > &  x  )  const

overload >= operator; test if current object greater equal x

参数:
x x

在文件DynInt.h362行定义。

CDynInt<T,sz> operator>> ( int  shift  ) 

overload >> operator

perform bit shift to the right

参数:
shift shift by this amount

在文件DynInt.h223行定义。

CDynInt<T,sz>& operator>>= ( int  shift  ) 

overload >>= operator

perform bit shift to the right

参数:
shift shift by this amount

在文件DynInt.h496行定义。

const CDynInt<T,sz> operator^ ( const CDynInt< T, sz > &  x  )  const

overload ^ operator and return x ^ y

参数:
x x

在文件DynInt.h249行定义。

CDynInt<T,sz>& operator^= ( const CDynInt< T, sz > &  x  ) 

overload ^= operator

perform bitwise xor with current DynInt and x

参数:
x x

在文件DynInt.h470行定义。

const CDynInt<T,sz> operator| ( const CDynInt< T, sz > &  x  )  const

overload | operator and return x | y

参数:
x x

在文件DynInt.h165行定义。

CDynInt<T,sz>& operator|= ( const CDynInt< T, sz > &  x  ) 

overload |= operator

perform bitwise or with current DynInt and x

参数:
x x

在文件DynInt.h442行定义。

CDynInt<T,sz>& operator~ (  ) 

negate DynInt

在文件DynInt.h503行定义。

void print_bits (  )  const

print the current long integer in bits (without carriage return

在文件DynInt.h551行定义。

void print_hex (  )  const

print the current long integer in hex (without carriage return

在文件DynInt.h544行定义。


该类的文档由以下文件生成:

SHOGUN Machine Learning Toolbox - Documentation