SHOGUN  5.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules
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
int32_t index_t
Definition: common.h:62
void set_max_index(index_t max_index)
Definition: IndexBlock.h:51
int32_t get_num_sub_blocks()
Definition: IndexBlock.cpp:50
void set_weight(float64_t weight)
Definition: IndexBlock.h:55
Class SGObject is the base class of all shogun objects.
Definition: SGObject.h:115
double float64_t
Definition: common.h:50
class IndexBlock used to represent contiguous indices of one group (e.g. block of related features) ...
Definition: IndexBlock.h:25
void set_min_index(index_t min_index)
Definition: IndexBlock.h:47
virtual const char * get_name() const
Definition: IndexBlock.h:58
CList * get_sub_blocks()
Definition: IndexBlock.cpp:44
index_t get_min_index() const
Definition: IndexBlock.h:45
void add_sub_block(CIndexBlock *sub_block)
Definition: IndexBlock.cpp:37
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
float64_t get_weight() const
Definition: IndexBlock.h:53
index_t get_max_index() const
Definition: IndexBlock.h:49
Class List implements a doubly connected list for low-level-objects.
Definition: List.h:84

SHOGUN Machine Learning Toolbox - Documentation