17 using namespace shogun;
28 m_node_name=node_name;
36 m_node_name=node_name;
41 void CModelSelectionParameters::init()
51 "CSGObject of this node");
53 "children of this node");
70 SG_ERROR(
"not possible to append child: there already is a range\n");
78 if (child->m_node_name)
82 SG_ERROR(
"Not possible to add child, node with CSGObject \"%s\""
83 " does not contain a parameter called \"%s\"\n",
84 m_sgobject->
get_name(), child->m_node_name);
89 SG_ERROR(
"Not possible to add child which has no name.\n");
112 ERangeType type, int32_t step, int32_t type_base)
119 void* max,
ERangeType type,
void* step,
void* type_base)
123 SG_ERROR(
"unable to set range for an CSGObject model selection "
131 m_value_type=value_type;
142 m_values.
vector=(
char*)values.vector;
143 m_values.
vlen=values.vlen;
152 *((int32_t*)type_base));
154 m_values.
vector=(
char*)values.vector;
155 m_values.
vlen=values.vlen;
159 SG_ERROR(
"Value node has no type!\n");
163 SG_ERROR(
"Unknown type for model selection parameter!\n");
183 switch (m_value_type)
189 p->
add(&((int32_t*)m_values.
vector)[i], m_node_name);;
192 SG_ERROR(
"Value node has no type!\n");
195 SG_ERROR(
"Unknown type for model selection parameter!\n");
212 if (!((m_sgobject && m_node_name) || (!m_node_name && !m_sgobject)))
213 SG_ERROR(
"Illegal CModelSelectionParameters node type.\n");
227 if (current->m_values.
vector)
253 p->
add(&m_sgobject, m_node_name);
269 *result=*value_combinations;
276 non_value_combinations;
375 p->
add(&m_sgobject, m_node_name);
386 char* prefix=
SG_MALLOC(
char, prefix_num+1);
387 for (
index_t i=0; i<prefix_num; ++i)
390 prefix[prefix_num]=
'\0';
397 SG_PRINT(
"%s%s with\n", prefix, m_node_name ? m_node_name :
"root");
422 SG_PRINT(
"%s%s with values: ", prefix, m_node_name);
424 switch (m_value_type)
433 SG_ERROR(
"Value node has no type!\n");
436 SG_ERROR(
"Unknown type for model selection parameter!\n");
448 void CModelSelectionParameters::delete_values()
452 switch (m_value_type)
461 SG_ERROR(
"Value node has no type!\n");
464 SG_ERROR(
"Unknown type for model selection parameter!\n");