11 #ifndef _MULTITASKKERNELTREENORMALIZER_H___
12 #define _MULTITASKKERNELTREENORMALIZER_H___
46 std::set<CNode*> nodes_on_path = std::set<CNode*>();
48 while (node != NULL) {
49 nodes_on_path.insert(node);
61 std::vector<int32_t> task_ids;
62 std::deque<CNode*> grey_nodes;
63 grey_nodes.push_back(
this);
65 while(grey_nodes.size() > 0)
68 CNode *current_node = grey_nodes.front();
69 grey_nodes.pop_front();
71 for(int32_t i = 0; i!=int32_t(current_node->
children.size()); i++){
72 grey_nodes.push_back(current_node->
children[i]);
76 task_ids.push_back(current_node->
getNode_id());
150 name2id = std::map<std::string, int32_t>();
159 return nodes[task_id];
167 nodes[0]->beta = beta;
177 if (child_name==
"")
SG_ERROR(
"child_name empty");
178 if (parent_name==
"")
SG_ERROR(
"parent_name empty");
183 child_node->
beta = beta;
185 nodes.push_back(child_node);
186 int32_t
id =
nodes.size()-1;
220 std::set<CNode*> intersection;
222 std::set_intersection(root_path_lhs.begin(), root_path_lhs.end(),
223 root_path_rhs.begin(), root_path_rhs.end(),
224 std::inserter(intersection, intersection.end()));
246 for (std::set<CNode*>::const_iterator p = intersection.begin(); p != intersection.end(); ++p) {
265 for (std::vector<int32_t>::const_iterator it=task_vector_lhs.begin(); it!=task_vector_lhs.end(); it++)
271 for (std::vector<int32_t>::const_iterator it=task_vector_lhs.begin(); it!=task_vector_lhs.end(); it++)
287 return (int32_t)(
nodes.size());
293 int32_t num_leaves = 0;
379 std::vector<std::string> task_rhs,
449 SG_ERROR(
"normalize_lhs not implemented");
459 SG_ERROR(
"normalize_rhs not implemented");
470 for (int32_t i = 0; i != (int32_t)(vec.size()); ++i)
486 for (int32_t i = 0; i != (int32_t)(vec.size()); ++i)
539 ASSERT(node_lhs < num_nodes && node_lhs >= 0);
540 ASSERT(node_rhs < num_nodes && node_rhs >= 0);
555 ASSERT(node_lhs < num_nodes && node_lhs >= 0);
556 ASSERT(node_rhs < num_nodes && node_rhs >= 0);
565 return "MultitaskKernelTreeNormalizer";