SHOGUN  3.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
IndexBlock.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 
10 #include <shogun/lib/IndexBlock.h>
11 #include <shogun/lib/List.h>
12 
13 using namespace shogun;
14 
16  m_min_index(0), m_max_index(0),
17  m_weight(1.0), m_sub_blocks(NULL)
18 {
19  m_sub_blocks = new CList(true);
20  SG_REF(m_sub_blocks);
21 }
22 
24  float64_t weight, const char* name) :
25  CSGObject(), m_min_index(min_index), m_max_index(max_index),
26  m_weight(weight), m_sub_blocks(NULL)
27 {
28  m_sub_blocks = new CList(true);
29  SG_REF(m_sub_blocks);
30 }
31 
33 {
34  SG_UNREF(m_sub_blocks);
35 }
36 
38 {
39  ASSERT(sub_block->get_min_index()>=m_min_index)
40  ASSERT(sub_block->get_max_index()<=m_max_index)
41  m_sub_blocks->append_element(sub_block);
42 }
43 
45 {
46  SG_REF(m_sub_blocks);
47  return m_sub_blocks;
48 }
49 
51 {
52  return m_sub_blocks->get_num_elements();
53 }

SHOGUN Machine Learning Toolbox - Documentation