SHOGUN  4.1.0
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
所有成员列表 | Public 成员函数
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.h38 行定义.

Public 成员函数

 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.h45 行定义.

CDynInt ( uint8_t  x)

constructor (set least significant ``word'')

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

参数
xleast significant word

在文件 DynInt.h57 行定义.

CDynInt ( uint16_t  x)

constructor (set least significant ``word'')

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

参数
xleast significant word

在文件 DynInt.h70 行定义.

CDynInt ( uint32_t  x)

constructor (set least significant ``word'')

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

参数
xleast significant word

在文件 DynInt.h83 行定义.

CDynInt ( int32_t  x)

constructor (set least significant ``word'')

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

参数
xleast significant word

在文件 DynInt.h96 行定义.

CDynInt ( int64_t  x)

constructor (set least significant ``word'')

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

参数
xleast significant word

在文件 DynInt.h109 行定义.

CDynInt ( uint64_t  x)

constructor (set least significant ``word'')

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

参数
xleast significant word

在文件 DynInt.h122 行定义.

CDynInt ( const T  x[sz])

constructor (set whole array)

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

参数
xarray of size sz

在文件 DynInt.h135 行定义.

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

copy constructor

在文件 DynInt.h142 行定义.

~CDynInt ( )

destructor

在文件 DynInt.h149 行定义.

成员函数说明

operator T ( )

cast to least significant word dangerous

在文件 DynInt.h513 行定义.

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

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

参数
xx

在文件 DynInt.h428 行定义.

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

overload & operator and return x & y

参数
xx

在文件 DynInt.h181 行定义.

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

overload &= operator

perform bitwise and with current DynInt and x

参数
xx

在文件 DynInt.h458 行定义.

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

overload * operator and return x * y

参数
xx

在文件 DynInt.h304 行定义.

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

overload *= operator; multiple x to with current DynInt

参数
xx

在文件 DynInt.h331 行定义.

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

overload + operator and return x + y

参数
xx

在文件 DynInt.h265 行定义.

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

increment DynInt by one

在文件 DynInt.h531 行定义.

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

overload += operator; add x to current DynInt

参数
xx

在文件 DynInt.h313 行定义.

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

overload - operator and return x - y

参数
xx

在文件 DynInt.h286 行定义.

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

decrement DynInt by one

在文件 DynInt.h516 行定义.

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

overload -= operator; substract x from current DynInt

参数
xx

在文件 DynInt.h322 行定义.

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

overload / operator and return x / y

参数
xx

在文件 DynInt.h295 行定义.

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

overload /= operator; divide current object by x

参数
xx

在文件 DynInt.h340 行定义.

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

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

参数
xx

在文件 DynInt.h412 行定义.

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

overload << operator

perform bit shift to the left

参数
shiftshift by this amount

在文件 DynInt.h197 行定义.

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

overload <<= operator

perform bit shift to the left

参数
shiftshift by this amount

在文件 DynInt.h486 行定义.

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

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

参数
xx

在文件 DynInt.h380 行定义.

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

overload = operator

参数
xassign elements from x

在文件 DynInt.h156 行定义.

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

overload == operator; test if current object equals x

参数
xx

在文件 DynInt.h349 行定义.

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

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

参数
xx

在文件 DynInt.h396 行定义.

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

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

参数
xx

在文件 DynInt.h364 行定义.

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

overload >> operator

perform bit shift to the right

参数
shiftshift by this amount

在文件 DynInt.h225 行定义.

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

overload >>= operator

perform bit shift to the right

参数
shiftshift by this amount

在文件 DynInt.h498 行定义.

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

overload ^ operator and return x ^ y

参数
xx

在文件 DynInt.h251 行定义.

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

overload ^= operator

perform bitwise xor with current DynInt and x

参数
xx

在文件 DynInt.h472 行定义.

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

overload | operator and return x | y

参数
xx

在文件 DynInt.h167 行定义.

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

overload |= operator

perform bitwise or with current DynInt and x

参数
xx

在文件 DynInt.h444 行定义.

CDynInt<T,sz>& operator~ ( )

negate DynInt

在文件 DynInt.h505 行定义.

void print_bits ( ) const

print the current long integer in bits (without carriage return

在文件 DynInt.h553 行定义.

void print_hex ( ) const

print the current long integer in hex (without carriage return

在文件 DynInt.h546 行定义.


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

SHOGUN 机器学习工具包 - 项目文档