SHOGUN  v1.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
List of all members | Public Member Functions | Protected Attributes
CSet< T > Class Template Reference

Detailed Description

template<class T>
class shogun::CSet< T >

Template Set class.

Lazy implementation of a set. Set grows and shrinks dynamically and can be conveniently iterated through via the [] operator.

Definition at line 26 of file Set.h.

Inheritance diagram for CSet< T >:
Inheritance graph
[legend]

Public Member Functions

 CSet (bool traceable=true)
 ~CSet ()
void add (T e)
void remove (T e)
bool contains (T e)
int32_t index_of (T e)
int32_t get_num_elements () const
get_element (int32_t index) const
T * get_element_ptr (int32_t index)
operator[] (int32_t index) const
T * get_array ()
virtual const char * get_name () const
- Public Member Functions inherited from CSGObject
 CSGObject ()
 CSGObject (const CSGObject &orig)
virtual ~CSGObject ()
virtual bool is_generic (EPrimitiveType *generic) const
template<class T >
void set_generic ()
void unset_generic ()
virtual void print_serializable (const char *prefix="")
virtual bool save_serializable (CSerializableFile *file, const char *prefix="")
virtual bool load_serializable (CSerializableFile *file, const char *prefix="")
void set_global_io (SGIO *io)
SGIOget_global_io ()
void set_global_parallel (Parallel *parallel)
Parallelget_global_parallel ()
void set_global_version (Version *version)
Versionget_global_version ()
SGVector< char * > get_modelsel_names ()
char * get_modsel_param_descr (const char *param_name)
index_t get_modsel_param_index (const char *param_name)

Protected Attributes

DynArray< T > * array

Additional Inherited Members

- Public Attributes inherited from CSGObject
SGIOio
Parallelparallel
Versionversion
Parameterm_parameters
Parameterm_model_selection_parameters
- Protected Member Functions inherited from CSGObject
virtual void load_serializable_pre () throw (ShogunException)
virtual void load_serializable_post () throw (ShogunException)
virtual void save_serializable_pre () throw (ShogunException)
virtual void save_serializable_post () throw (ShogunException)

Constructor & Destructor Documentation

CSet ( bool  traceable = true)

Default constructor

Definition at line 30 of file Set.h.

~CSet ( )

Default destructor

Definition at line 36 of file Set.h.

Member Function Documentation

void add ( e)

Add an element to the set

Parameters
eelemet to be added

Definition at line 45 of file Set.h.

bool contains ( e)

Remove an element from the set

Parameters
eelement to be looked for

Definition at line 66 of file Set.h.

T* get_array ( )
Returns
underlying array in memory

Definition at line 129 of file Set.h.

T get_element ( int32_t  index) const

get set element at index

(does NOT do bounds checking)

Parameters
indexindex
Returns
array element at index

Definition at line 98 of file Set.h.

T* get_element_ptr ( int32_t  index)

get set element at index as reference

(does NOT do bounds checking)

Parameters
indexindex
Returns
array element at index

Definition at line 110 of file Set.h.

virtual const char* get_name ( ) const
virtual
Returns
object name

Implements CSGObject.

Definition at line 135 of file Set.h.

int32_t get_num_elements ( ) const

get number of elements

Returns
number of elements

Definition at line 86 of file Set.h.

int32_t index_of ( e)

Index of element in the set

Parameters
eelement to be removed
Returns
index of the element or -1 if not found

Definition at line 77 of file Set.h.

T operator[] ( int32_t  index) const

operator overload for set read only access use add() for write access

DOES NOT DO ANY BOUNDS CHECKING

Parameters
indexindex
Returns
element at index

Definition at line 123 of file Set.h.

void remove ( e)

Remove an element from the set

Parameters
eelement to be removed

Definition at line 55 of file Set.h.

Member Data Documentation

DynArray<T>* array
protected

dynamic array the set is based on

Definition at line 139 of file Set.h.


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

SHOGUN Machine Learning Toolbox - Documentation