SHOGUN  3.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
IndexBlock.h
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 #ifndef INDEXBLOCK_H_
11 #define INDEXBLOCK_H_
12 
13 #include <shogun/lib/config.h>
14 
15 #include <shogun/base/SGObject.h>
16 
17 namespace shogun
18 {
19 
20 class CList;
21 
25 class CIndexBlock : public CSGObject
26 {
27 public:
28 
30  CIndexBlock();
31 
38  CIndexBlock(index_t min_index, index_t max_index,
39  float64_t weight=1.0, const char* name="task");
40 
42  ~CIndexBlock();
43 
45  index_t get_min_index() const { return m_min_index; }
47  void set_min_index(index_t min_index) { m_min_index = min_index; }
49  index_t get_max_index() const { return m_max_index; }
51  void set_max_index(index_t max_index) { m_max_index = max_index; }
53  float64_t get_weight() const { return m_weight; }
55  void set_weight(float64_t weight) { m_weight = weight; }
56 
58  virtual const char* get_name() const { return "IndexBlock"; };
59 
62 
64  int32_t get_num_sub_blocks();
65 
69  void add_sub_block(CIndexBlock* sub_block);
70 
71 private:
73  index_t m_min_index;
74 
76  index_t m_max_index;
77 
79  float64_t m_weight;
80 
82  CList* m_sub_blocks;
83 
84 };
85 
86 }
87 #endif

SHOGUN Machine Learning Toolbox - Documentation