Public Member Functions | Protected Attributes

ParameterMap Class Reference


Detailed Description

Implements a map of ParameterMapElement instances.

Implementation is done via an array. Via the call finalize_map(), it is sorted. Then, get() may be called. If it is called before, an error is thrown.

In finalize_map() the array is sorted. So inserting n elements is n*O(1) + O(n*log n) = O(n*log n). Getting an element is then possible in O(log n) by binary search

Definition at line 130 of file ParameterMap.h.

List of all members.

Public Member Functions

 ParameterMap ()
virtual ~ParameterMap ()
void put (SGParamInfo *key, SGParamInfo *value)
SGParamInfoget (SGParamInfo *key) const
void finalize_map ()
void print_map ()

Protected Attributes

DynArray< ParameterMapElement * > m_map_elements
bool m_finalized

Constructor & Destructor Documentation

ParameterMap (  ) 

constructor

Definition at line 130 of file ParameterMap.cpp.

~ParameterMap (  )  [virtual]

destructor

Definition at line 140 of file ParameterMap.cpp.


Member Function Documentation

void finalize_map (  ) 

Finalizes the map. Has to be called before get may be called if more than one element in map

Definition at line 179 of file ParameterMap.cpp.

SGParamInfo * get ( SGParamInfo key  )  const

Gets a specific element of the map. Note that it is SG_REF'ed finalize_map() has to be called first if more than one elements are in map

Parameters:
key key of the element to get
Returns:
value of the key element

Definition at line 152 of file ParameterMap.cpp.

void print_map (  ) 

prints all elements of this map

Definition at line 190 of file ParameterMap.cpp.

void put ( SGParamInfo key,
SGParamInfo value 
)

Puts an newly allocated element into the map

Parameters:
key key of the element
value value of the lement

Definition at line 146 of file ParameterMap.cpp.


Member Data Documentation

bool m_finalized [protected]

variable that indicates if underlying array is sorted (and thus get may safely be called)

Definition at line 171 of file ParameterMap.h.

list of CLinearMap elements, this is always kept sorted

Definition at line 167 of file ParameterMap.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

SHOGUN Machine Learning Toolbox - Documentation