SHOGUN
v1.1.0
Main Page
Related Pages
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
src
shogun
base
ParameterMap.h
Go to the documentation of this file.
1
/*
2
* This program is free software; you can redistribute it and/or modify
3
* it under the terms of the GNU General Public License as published by
4
* the Free Software Foundation; either version 3 of the License, or
5
* (at your option) any later version.
6
*
7
* Written (W) 2011 Heiko Strathmann
8
* Copyright (C) 2011 Berlin Institute of Technology and Max-Planck-Society
9
*/
10
11
#ifndef __PARAMETERMAP_
12
#define __PARAMETERMAP_
13
14
#include <
shogun/base/DynArray.h
>
15
16
namespace
shogun
17
{
18
26
class
SGParamInfo
27
{
28
public
:
30
SGParamInfo
();
31
39
SGParamInfo
(
const
char
* name, EContainerType ctype, EStructType stype,
40
EPrimitiveType ptype);
41
43
virtual
~SGParamInfo
();
44
46
void
print_param_info
();
47
49
SGParamInfo
*
duplicate
()
const
;
50
52
bool
operator==
(
const
SGParamInfo
& other)
const
;
53
55
bool
operator<
(
const
SGParamInfo
& other)
const
;
56
58
bool
operator>
(
const
SGParamInfo
& other)
const
;
59
60
private
:
61
void
init();
62
63
public
:
65
char
*
m_name
;
67
EContainerType
m_ctype
;
69
EStructType
m_stype
;
71
EPrimitiveType
m_ptype
;
72
};
73
78
class
ParameterMapElement
79
{
80
public
:
82
ParameterMapElement
();
83
89
ParameterMapElement
(
SGParamInfo
* key,
SGParamInfo
* value);
90
92
virtual
~ParameterMapElement
();
93
95
bool
operator==
(
const
ParameterMapElement
& other)
const
;
96
98
bool
operator<
(
const
ParameterMapElement
& other)
const
;
99
101
bool
operator>
(
const
ParameterMapElement
& other)
const
;
102
104
inline
virtual
const
char
*
get_name
()
const
105
{
106
return
"ParameterMapElement"
;
107
}
108
109
private
:
110
void
init();
111
112
public
:
114
SGParamInfo
*
m_key
;
116
SGParamInfo
*
m_value
;
117
118
};
119
130
class
ParameterMap
131
{
132
public
:
134
ParameterMap
();
135
137
virtual
~ParameterMap
();
138
144
void
put
(
SGParamInfo
* key,
SGParamInfo
* value);
145
153
SGParamInfo
*
get
(
SGParamInfo
* key)
const
;
154
157
void
finalize_map
();
158
160
void
print_map
();
161
162
private
:
163
void
init();
164
165
protected
:
167
DynArray<ParameterMapElement*>
m_map_elements
;
168
171
bool
m_finalized
;
172
};
173
174
}
175
176
#endif
/* __PARAMETERMAP_ */
SHOGUN
Machine Learning Toolbox - Documentation