14 using namespace shogun;
45 for (int32_t i=0; i<node->
n_desc; i++)
57 for (int32_t t=0; t<tabs; t++)
60 for (int32_t i=0; i<node->
n_desc; i++)
67 G->push_back(node->
idx);
68 for (int32_t i=0; i<node->
n_desc; i++)
76 for (int32_t i=0; i<node->
n_desc; i++)
109 CIndexBlockTree::CIndexBlockTree() :
117 m_root_block(NULL), m_general(false)
124 m_root_block(NULL), m_general(true)
127 int32_t n_features = adjacency_matrix.
num_rows;
133 int32_t* nz_row =
SG_CALLOC(int32_t, n_features);
134 for (int32_t i=0; i<n_features; i++)
139 for (int32_t j=i; j<n_features; j++)
141 if (adjacency_matrix(j,i)!=0.0)
146 for (int32_t j=0; j<c; j++)
148 nodes[i].
desc[j] = &nodes[nz_row[j]];
150 if (nz_row[c] == n_features)
156 vector<int32_t> ind_t;
157 int current_l_idx = 1;
158 for (int32_t i=1; i<n_features; i++)
160 if (nodes[i].n_desc > 0)
163 ind_t.push_back(current_l_idx);
164 ind_t.push_back(current_l_idx+sub_count-1);
165 ind_t.push_back(1.0);
166 current_l_idx += sub_count;
180 int32_t supernode_offset = include_supernode ? 3 : 0;
182 if (include_supernode)
188 for (int32_t i=0; i<(int32_t)ind_t.size(); i++)
191 for (int32_t i=0; i<(int32_t)G.size(); i++)
213 for (int32_t i=0; i<n_features; i++)
220 m_root_block(NULL), m_general(true)
228 m_root_block(NULL), m_general(false)
277 vector<block_tree_node_t> tree_nodes = vector<block_tree_node_t>();
287 for (int32_t i=0; i<(int32_t)tree_nodes.size(); i++)
289 ind_t[3+i*3] = tree_nodes[i].t_min_index + 1;
290 ind_t[3+i*3+1] = tree_nodes[i].t_max_index;
291 ind_t[3+i*3+2] = tree_nodes[i].weight;