SHOGUN  v3.2.0
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
IndexBlock.h
浏览该文件的文档.
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/SGVector.h>
14 #include <shogun/lib/List.h>
15 
16 namespace shogun
17 {
18 
22 class CIndexBlock : public CSGObject
23 {
24 public:
25 
27  CIndexBlock();
28 
35  CIndexBlock(index_t min_index, index_t max_index,
36  float64_t weight=1.0, const char* name="task");
37 
39  ~CIndexBlock();
40 
42  index_t get_min_index() const { return m_min_index; }
44  void set_min_index(index_t min_index) { m_min_index = min_index; }
46  index_t get_max_index() const { return m_max_index; }
48  void set_max_index(index_t max_index) { m_max_index = max_index; }
50  float64_t get_weight() const { return m_weight; }
52  void set_weight(float64_t weight) { m_weight = weight; }
53 
55  virtual const char* get_name() const { return "IndexBlock"; };
56 
59 
61  int32_t get_num_sub_blocks();
62 
66  void add_sub_block(CIndexBlock* sub_block);
67 
68 private:
70  index_t m_min_index;
71 
73  index_t m_max_index;
74 
76  float64_t m_weight;
77 
79  CList* m_sub_blocks;
80 
81 };
82 
83 }
84 #endif
int32_t index_t
Definition: common.h:60
void set_max_index(index_t max_index)
Definition: IndexBlock.h:48
int32_t get_num_sub_blocks()
Definition: IndexBlock.cpp:49
void set_weight(float64_t weight)
Definition: IndexBlock.h:52
Class SGObject is the base class of all shogun objects.
Definition: SGObject.h:102
double float64_t
Definition: common.h:48
class IndexBlock used to represent contiguous indices of one group (e.g. block of related features) ...
Definition: IndexBlock.h:22
void set_min_index(index_t min_index)
Definition: IndexBlock.h:44
virtual const char * get_name() const
Definition: IndexBlock.h:55
CList * get_sub_blocks()
Definition: IndexBlock.cpp:43
index_t get_min_index() const
Definition: IndexBlock.h:42
void add_sub_block(CIndexBlock *sub_block)
Definition: IndexBlock.cpp:36
float64_t get_weight() const
Definition: IndexBlock.h:50
index_t get_max_index() const
Definition: IndexBlock.h:46
Class List implements a doubly connected list for low-level-objects.
Definition: List.h:82

SHOGUN Machine Learning Toolbox - Documentation