SHOGUN  v3.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
IndexBlockGroup.cpp
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 3 of the License, or
5  * (at your option) any later version.
6  *
7  * Copyright (C) 2012 Sergey Lisitsyn
8  */
9 
11 
12 using namespace shogun;
13 
15 {
16  m_blocks = new CList(true);
17 }
18 
20 {
22 }
23 
25 {
26  m_blocks->push(block);
27 }
28 
30 {
32 }
33 
35 {
37  int32_t n_sub_blocks = m_blocks->get_num_elements();
38  SG_DEBUG("Number of sub-blocks = %d\n", n_sub_blocks)
39  SGVector<index_t> ind(n_sub_blocks+1);
40 
42  ind[0] = 0;
43  int32_t i = 0;
44  do
45  {
46  ind[i+1] = iterator->get_max_index();
47  SG_UNREF(iterator);
48  i++;
49  }
50  while ((iterator = (CIndexBlock*)m_blocks->get_next_element()) != NULL);
51  //ind.display_vector("ind");
52 
53  return ind;
54 }

SHOGUN Machine Learning Toolbox - Documentation