11 #ifndef _MULTITASKKERNELTREENORMALIZER_H___
12 #define _MULTITASKKERNELTREENORMALIZER_H___
43 for (
size_t i = 0; i <
children.size(); i++)
52 std::set<CNode*> nodes_on_path = std::set<CNode*>();
54 while (node != NULL) {
55 nodes_on_path.insert(node);
67 std::vector<int32_t> task_ids;
68 std::deque<CNode*> grey_nodes;
69 grey_nodes.push_back(
this);
71 while(grey_nodes.size() > 0)
74 CNode *current_node = grey_nodes.front();
75 grey_nodes.pop_front();
77 for(int32_t i = 0; i!=int32_t(current_node->
children.size()); i++){
78 grey_nodes.push_back(current_node->
children[i]);
82 task_ids.push_back(current_node->
getNode_id());
156 name2id = std::map<std::string, int32_t>();
162 for (
size_t i = 0; i <
nodes.size(); i++)
174 return nodes[task_id];
182 nodes[0]->beta = beta;
192 if (child_name==
"")
SG_ERROR(
"child_name empty")
193 if (parent_name==
"")
SG_ERROR(
"parent_name empty")
198 child_node->
beta = beta;
200 nodes.push_back(child_node);
201 int32_t
id =
nodes.size()-1;
235 std::set<CNode*> intersection;
237 std::set_intersection(root_path_lhs.begin(), root_path_lhs.end(),
238 root_path_rhs.begin(), root_path_rhs.end(),
239 std::inserter(intersection, intersection.end()));
261 for (std::set<CNode*>::const_iterator p = intersection.begin(); p != intersection.end(); ++p) {
280 for (std::vector<int32_t>::const_iterator it=task_vector_lhs.begin(); it!=task_vector_lhs.end(); it++)
286 for (std::vector<int32_t>::const_iterator it=task_vector_lhs.begin(); it!=task_vector_lhs.end(); it++)
302 return (int32_t)(
nodes.size());
308 int32_t num_leaves = 0;
394 std::vector<std::string> task_rhs,
464 SG_ERROR(
"normalize_lhs not implemented")
474 SG_ERROR(
"normalize_rhs not implemented")
485 for (int32_t i = 0; i != (int32_t)(vec.size()); ++i)
501 for (int32_t i = 0; i != (int32_t)(vec.size()); ++i)
554 ASSERT(node_lhs < num_nodes && node_lhs >= 0)
555 ASSERT(node_rhs < num_nodes && node_rhs >= 0)
570 ASSERT(node_lhs < num_nodes && node_lhs >= 0)
571 ASSERT(node_rhs < num_nodes && node_rhs >= 0)
580 return "MultitaskKernelTreeNormalizer";