15 using namespace shogun;
29 void CParameterCombination::init()
36 "children of this node");
47 m_child_nodes->append_element(child);
53 char* prefix=
SG_MALLOC(
char, prefix_num+1);
54 for (
index_t i=0; i<prefix_num; ++i)
57 prefix[prefix_num]=
'\0';
75 current_sgobject->
get_name(), current_sgobject);
87 SG_SPRINT(
"%s ", *((
bool*)param ?
"true" :
"false"));
100 for (
index_t i=0; i<m_child_nodes->get_num_elements(); ++i)
137 if (sets.get_num_elements()==1)
144 *result=*current_set;
158 else if (sets.get_num_elements()>1)
165 for (
index_t set_nr=0; set_nr<sets.get_num_elements(); ++set_nr)
176 if (current_node->m_child_nodes->get_num_elements())
178 SG_SERROR(
"leaf sets multiplication only possible if all "
182 Parameter* current_param=current_node->m_param;
188 SG_SERROR(
"leaf sets multiplication only possible if all "
189 "leafs have non-NULL Parameter instances\n");
200 *param_sets[0], *param_sets[1]);
202 delete param_sets[0];
203 delete param_sets[1];
218 delete old_temp_result;
219 delete param_sets[i];
244 delete param_product;
265 for (
index_t i=0; i<m_child_nodes->get_num_elements(); ++i)
268 copy->m_child_nodes->append_element(child->
copy_tree());
289 for (
index_t i=0; i<m_child_nodes->get_num_elements(); ++i)
310 SG_SERROR(
"invalid CParameterCombination node type, has children"
311 " and more than one parameter or is not a "
321 for (
index_t i=0; i<m_child_nodes->get_num_elements(); ++i)
331 SG_SERROR(
"CParameterCombination node has illegal type.\n");
virtual const char * get_name() const =0
bool set_element(T *element, int32_t index)
T get_element(int32_t index) const
T * get_element(int32_t index) const
bool append_element(T element)
virtual int32_t get_num_parameters()
void apply_to_modsel_parameter(Parameter *parameter) const
bool has_children() const
TParameter * get_parameter(int32_t idx)
#define SG_NOTIMPLEMENTED
int32_t get_num_elements() const
void print_tree(int prefix_num=0) const
int32_t get_num_elements() const
CParameterCombination * copy_tree() const
A generic learning machine interface.
void add(bool *param, const char *name, const char *description="")
Class SGObject is the base class of all shogun objects.
Template Dynamic array class that creates an array that can be used like a list or an array...
void append_child(CParameterCombination *child)
Template Dynamic array class that creates an array that can be used like a list or an array...
class that holds ONE combination of parameters for a learning machine. The structure is organized as ...
Parameter * m_model_selection_parameters
void set_from_parameters(Parameter *params)
void add_parameters(Parameter *params)
virtual ~CParameterCombination()
bool append_element(T *element)
static CDynamicObjectArray< CParameterCombination > * leaf_sets_multiplication(const CDynamicObjectArray< CDynamicObjectArray< CParameterCombination > > &sets, const CParameterCombination *new_root)
void apply_to_machine(CMachine *machine) const
#define SG_MALLOC(type, len)
static DynArray< Parameter * > * parameter_set_multiplication(const DynArray< Parameter * > &set_1, const DynArray< Parameter * > &set_2)