48 for (int32_t i=0; i<node->
n_desc; i++)
60 for (int32_t t=0; t<tabs; t++)
63 for (int32_t i=0; i<node->
n_desc; i++)
70 G->push_back(node->
idx);
71 for (int32_t i=0; i<node->
n_desc; i++)
79 for (int32_t i=0; i<node->
n_desc; i++)
112 CIndexBlockTree::CIndexBlockTree() :
120 m_root_block(NULL), m_general(false)
127 m_root_block(NULL), m_general(true)
130 int32_t n_features = adjacency_matrix.
num_rows;
136 int32_t* nz_row = SG_CALLOC(int32_t, n_features);
137 for (int32_t i=0; i<n_features; i++)
142 for (int32_t j=i; j<n_features; j++)
144 if (adjacency_matrix(j,i)!=0.0)
149 for (int32_t j=0; j<c; j++)
151 nodes[i].
desc[j] = &nodes[nz_row[j]];
153 if (nz_row[c] == n_features)
159 vector<int32_t> ind_t;
160 int current_l_idx = 1;
161 for (int32_t i=1; i<n_features; i++)
163 if (nodes[i].n_desc > 0)
166 ind_t.push_back(current_l_idx);
167 ind_t.push_back(current_l_idx+sub_count-1);
168 ind_t.push_back(1.0);
169 current_l_idx += sub_count;
183 int32_t supernode_offset = include_supernode ? 3 : 0;
185 if (include_supernode)
191 for (int32_t i=0; i<(int32_t)ind_t.size(); i++)
194 for (int32_t i=0; i<(int32_t)G.size(); i++)
216 for (int32_t i=0; i<n_features; i++)
217 SG_FREE(nodes[i].desc);
223 m_root_block(NULL), m_general(true)
231 m_root_block(NULL), m_general(false)
280 vector<block_tree_node_t> tree_nodes = vector<block_tree_node_t>();
290 for (int32_t i=0; i<(int32_t)tree_nodes.size(); i++)
292 ind_t[3+i*3] = tree_nodes[i].t_min_index + 1;
293 ind_t[3+i*3+1] = tree_nodes[i].t_max_index;
294 ind_t[3+i*3+2] = tree_nodes[i].weight;
SGVector< float64_t > m_precomputed_ind_t
CSGObject * get_next_element()
virtual SGVector< float64_t > get_SLEP_ind_t() const
virtual SGVector< index_t > get_SLEP_ind()
#define SG_SNOTIMPLEMENTED
virtual SGVector< float64_t > get_SLEP_G()
void collect_tree_nodes_recursive(CIndexBlock *subtree_root_block, vector< block_tree_node_t > *tree_nodes)
int count_sub_nodes_recursive(tree_node_t *node, int32_t self)
CIndexBlock * m_root_block
void set_root_block(CIndexBlock *root_block)
int32_t get_num_sub_blocks()
CSGObject * get_first_element()
SGVector< float64_t > m_precomputed_G
class IndexBlock used to represent contiguous indices of one group (e.g. block of related features) ...
CIndexBlock * get_root_block() const
int32_t get_num_elements()
index_t get_min_index() const
int32_t fill_G_recursive(tree_node_t *node, vector< int32_t > *G)
void fill_ind_recursive(tree_node_t *node, vector< block_tree_node_t > *tree_nodes, int32_t lower)
all of classes and functions are contained in the shogun namespace
virtual ~CIndexBlockTree()
block_tree_node_t(int32_t min, int32_t max, float64_t w)
void print_tree(tree_node_t *node, int tabs)
Matrix::Scalar max(Matrix m)
float64_t get_weight() const
index_t get_max_index() const
Class List implements a doubly connected list for low-level-objects.