SHOGUN  3.2.1
 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 #include <shogun/lib/IndexBlock.h>
12 #include <shogun/lib/List.h>
13 
14 using namespace shogun;
15 
17 {
18  m_blocks = new CList(true);
19 }
20 
22 {
24 }
25 
27 {
28  m_blocks->push(block);
29 }
30 
32 {
34 }
35 
37 {
39  int32_t n_sub_blocks = m_blocks->get_num_elements();
40  SG_DEBUG("Number of sub-blocks = %d\n", n_sub_blocks)
41  SGVector<index_t> ind(n_sub_blocks+1);
42 
44  ind[0] = 0;
45  int32_t i = 0;
46  do
47  {
48  ind[i+1] = iterator->get_max_index();
49  SG_UNREF(iterator);
50  i++;
51  }
52  while ((iterator = (CIndexBlock*)m_blocks->get_next_element()) != NULL);
53  //ind.display_vector("ind");
54 
55  return ind;
56 }

SHOGUN Machine Learning Toolbox - Documentation