CIndirectObject< T, P > Class Template Reference


Detailed Description

template<class T, class P>
class CIndirectObject< T, P >

an array class that accesses elements indirectly via an index array.

It does not store the objects itself, but only indices to objects. This conveniently allows e.g. sorting the array without changing the order of objects (but only the order of their indices).

Definition at line 21 of file IndirectObject.h.

List of all members.

Public Member Functions

 CIndirectObject ()
 CIndirectObject (int32_t idx)
CIndirectObject< T, P > & operator= (const CIndirectObject< T, P > &x)
operator| (const CIndirectObject< T, P > &x) const
const T operator& (const CIndirectObject< T, P > &x) const
operator<< (int shift)
operator>> (int shift)
operator^ (const CIndirectObject< T, P > &x) const
operator+ (const CIndirectObject< T, P > &x) const
operator- (const CIndirectObject< T, P > &x) const
operator/ (const CIndirectObject< T, P > &x) const
operator* (const CIndirectObject< T, P > &x) const
CIndirectObject< T, P > & operator+= (const CIndirectObject< T, P > &x)
CIndirectObject< T, P > & operator-= (const CIndirectObject< T, P > &x)
CIndirectObject< T, P > & operator*= (const CIndirectObject< T, P > &x)
CIndirectObject< T, P > & operator/= (const CIndirectObject< T, P > &x)
bool operator== (const CIndirectObject< T, P > &x) const
bool operator>= (const CIndirectObject< T, P > &x) const
bool operator<= (const CIndirectObject< T, P > &x) const
bool operator> (const CIndirectObject< T, P > &x) const
bool operator< (const CIndirectObject< T, P > &x) const
bool operator!= (const CIndirectObject< T, P > &x) const
CIndirectObject< T, P > & operator|= (const CIndirectObject< T, P > &x)
CIndirectObject< T, P > & operator&= (const CIndirectObject< T, P > &x)
CIndirectObject< T, P > & operator^= (const CIndirectObject< T, P > &x)
CIndirectObject< T, P > & operator<<= (int shift)
CIndirectObject< T, P > & operator>>= (int shift)
operator~ ()
 operator T () const
CIndirectObject< T, P > & operator-- ()
CIndirectObject< T, P > & operator++ ()

Static Public Member Functions

static void set_array (P a)
static P get_array ()
static void init_slice (CIndirectObject< T, P > *a, int32_t len, int32_t start=0, int32_t stop=-1)

Protected Attributes

int32_t index

Static Protected Attributes

static P array

Constructor & Destructor Documentation

template<class T, class P>
CIndirectObject< T, P >::CIndirectObject (  ) 

default constructor (initializes index with -1)

Definition at line 27 of file IndirectObject.h.

template<class T, class P>
CIndirectObject< T, P >::CIndirectObject ( int32_t  idx  ) 

constructor

Parameters:
idx index

Definition at line 34 of file IndirectObject.h.


Member Function Documentation

template<class T, class P>
static P CIndirectObject< T, P >::get_array (  )  [static]

get array

Returns:
array

Definition at line 52 of file IndirectObject.h.

template<class T, class P>
static void CIndirectObject< T, P >::init_slice ( CIndirectObject< T, P > *  a,
int32_t  len,
int32_t  start = 0,
int32_t  stop = -1 
) [static]

initialize slice

Returns:
array

Definition at line 61 of file IndirectObject.h.

template<class T, class P>
CIndirectObject< T, P >::operator T (  )  const

return array element

Definition at line 325 of file IndirectObject.h.

template<class T, class P>
bool CIndirectObject< T, P >::operator!= ( const CIndirectObject< T, P > &  x  )  const

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

Parameters:
x x

Definition at line 253 of file IndirectObject.h.

template<class T, class P>
const T CIndirectObject< T, P >::operator& ( const CIndirectObject< T, P > &  x  )  const

overload & operator and return x & y

Parameters:
x x

Definition at line 92 of file IndirectObject.h.

template<class T, class P>
CIndirectObject<T,P>& CIndirectObject< T, P >::operator&= ( const CIndirectObject< T, P > &  x  ) 

overload &= operator

perform bitwise and with current element and x

Parameters:
x x

Definition at line 276 of file IndirectObject.h.

template<class T, class P>
T CIndirectObject< T, P >::operator* ( const CIndirectObject< T, P > &  x  )  const

overload * operator and return x * y

Parameters:
x x

Definition at line 159 of file IndirectObject.h.

template<class T, class P>
CIndirectObject<T,P>& CIndirectObject< T, P >::operator*= ( const CIndirectObject< T, P > &  x  ) 

overload *= operator; multiple x to with current element

Parameters:
x x

Definition at line 188 of file IndirectObject.h.

template<class T, class P>
T CIndirectObject< T, P >::operator+ ( const CIndirectObject< T, P > &  x  )  const

overload + operator and return x + y

Parameters:
x x

Definition at line 132 of file IndirectObject.h.

template<class T, class P>
CIndirectObject<T,P>& CIndirectObject< T, P >::operator++ (  ) 

increment element by one

Definition at line 335 of file IndirectObject.h.

template<class T, class P>
CIndirectObject<T,P>& CIndirectObject< T, P >::operator+= ( const CIndirectObject< T, P > &  x  ) 

overload += operator; add x to current element

Parameters:
x x

Definition at line 168 of file IndirectObject.h.

template<class T, class P>
T CIndirectObject< T, P >::operator- ( const CIndirectObject< T, P > &  x  )  const

overload - operator and return x - y

Parameters:
x x

Definition at line 141 of file IndirectObject.h.

template<class T, class P>
CIndirectObject<T,P>& CIndirectObject< T, P >::operator-- (  ) 

decrement element by one

Definition at line 328 of file IndirectObject.h.

template<class T, class P>
CIndirectObject<T,P>& CIndirectObject< T, P >::operator-= ( const CIndirectObject< T, P > &  x  ) 

overload -= operator; substract x from current element

Parameters:
x x

Definition at line 178 of file IndirectObject.h.

template<class T, class P>
T CIndirectObject< T, P >::operator/ ( const CIndirectObject< T, P > &  x  )  const

overload / operator and return x / y

Parameters:
x x

Definition at line 150 of file IndirectObject.h.

template<class T, class P>
CIndirectObject<T,P>& CIndirectObject< T, P >::operator/= ( const CIndirectObject< T, P > &  x  ) 

overload /= operator; divide current object by x

Parameters:
x x

Definition at line 198 of file IndirectObject.h.

template<class T, class P>
bool CIndirectObject< T, P >::operator< ( const CIndirectObject< T, P > &  x  )  const

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

Parameters:
x x

Definition at line 244 of file IndirectObject.h.

template<class T, class P>
T CIndirectObject< T, P >::operator<< ( int  shift  ) 

overload << operator

perform bit shift to the left

Parameters:
shift shift by this amount

Definition at line 103 of file IndirectObject.h.

template<class T, class P>
CIndirectObject<T,P>& CIndirectObject< T, P >::operator<<= ( int  shift  ) 

overload <<= operator

perform bit shift to the left

Parameters:
shift shift by this amount

Definition at line 300 of file IndirectObject.h.

template<class T, class P>
bool CIndirectObject< T, P >::operator<= ( const CIndirectObject< T, P > &  x  )  const

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

Parameters:
x x

Definition at line 226 of file IndirectObject.h.

template<class T, class P>
CIndirectObject<T,P>& CIndirectObject< T, P >::operator= ( const CIndirectObject< T, P > &  x  ) 

overload = operator

Parameters:
x assign elements from x

Definition at line 73 of file IndirectObject.h.

template<class T, class P>
bool CIndirectObject< T, P >::operator== ( const CIndirectObject< T, P > &  x  )  const

overload == operator; test if current object equals x

Parameters:
x x

Definition at line 208 of file IndirectObject.h.

template<class T, class P>
bool CIndirectObject< T, P >::operator> ( const CIndirectObject< T, P > &  x  )  const

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

Parameters:
x x

Definition at line 235 of file IndirectObject.h.

template<class T, class P>
bool CIndirectObject< T, P >::operator>= ( const CIndirectObject< T, P > &  x  )  const

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

Parameters:
x x

Definition at line 217 of file IndirectObject.h.

template<class T, class P>
T CIndirectObject< T, P >::operator>> ( int  shift  ) 

overload >> operator

perform bit shift to the right

Parameters:
shift shift by this amount

Definition at line 114 of file IndirectObject.h.

template<class T, class P>
CIndirectObject<T,P>& CIndirectObject< T, P >::operator>>= ( int  shift  ) 

overload >>= operator

perform bit shift to the right

Parameters:
shift shift by this amount

Definition at line 312 of file IndirectObject.h.

template<class T, class P>
T CIndirectObject< T, P >::operator^ ( const CIndirectObject< T, P > &  x  )  const

overload ^ operator and return x ^ y

Parameters:
x x

Definition at line 123 of file IndirectObject.h.

template<class T, class P>
CIndirectObject<T,P>& CIndirectObject< T, P >::operator^= ( const CIndirectObject< T, P > &  x  ) 

overload ^= operator

perform bitwise xor with current element and x

Parameters:
x x

Definition at line 288 of file IndirectObject.h.

template<class T, class P>
T CIndirectObject< T, P >::operator| ( const CIndirectObject< T, P > &  x  )  const

overload | operator and return x | y

Parameters:
x x

Definition at line 83 of file IndirectObject.h.

template<class T, class P>
CIndirectObject<T,P>& CIndirectObject< T, P >::operator|= ( const CIndirectObject< T, P > &  x  ) 

overload |= operator

perform bitwise or with current element and x

Parameters:
x x

Definition at line 264 of file IndirectObject.h.

template<class T, class P>
T CIndirectObject< T, P >::operator~ (  ) 

negate element

Definition at line 319 of file IndirectObject.h.

template<class T, class P>
static void CIndirectObject< T, P >::set_array ( a  )  [static]

set array

Parameters:
a array

Definition at line 43 of file IndirectObject.h.


Member Data Documentation

template<class T, class P>
P CIndirectObject< T, P >::array [static, protected]

array

Definition at line 343 of file IndirectObject.h.

template<class T, class P>
int32_t CIndirectObject< T, P >::index [protected]

index into array

Definition at line 346 of file IndirectObject.h.


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

SHOGUN Machine Learning Toolbox - Documentation