SHOGUN  4.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Subset.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  * Written (W) 2011-2012 Heiko Strathmann
8  * Copyright (C) 2011 Berlin Institute of Technology and Max-Planck-Society
9  */
10 
11 #ifndef __SUBSET_H_
12 #define __SUBSET_H_
13 
14 #include <shogun/lib/config.h>
15 
16 #include <shogun/lib/common.h>
17 #include <shogun/base/SGObject.h>
19 #include <shogun/lib/SGVector.h>
20 
21 namespace shogun
22 {
24 class CSubset: public CSGObject
25 {
26  friend class CSubsetStack;
27 
28 public:
30  CSubset();
31 
36  CSubset(SGVector<index_t> subset_idx);
37 
39  virtual ~CSubset();
40 
42  index_t get_size() const { return m_subset_idx.vlen; }
43 
45  inline const char* get_name() const { return "Subset"; }
46 
48  SGVector<index_t> get_subset_idx() const { return m_subset_idx; }
49 
50 private:
51  void init();
52 
53 private:
54  SGVector<index_t> m_subset_idx;
55 };
56 
57 }
58 #endif /* __SUBSET_H_ */
Wrapper class for an index subset which is used by SubsetStack.
Definition: Subset.h:24
SGVector< index_t > get_subset_idx() const
Definition: Subset.h:48
int32_t index_t
Definition: common.h:62
const char * get_name() const
Definition: Subset.h:45
virtual ~CSubset()
Definition: Subset.cpp:28
class to add subset support to another class. A CSubsetStackStack instance should be added and wrappe...
Definition: SubsetStack.h:37
index_t vlen
Definition: SGVector.h:494
Class SGObject is the base class of all shogun objects.
Definition: SGObject.h:112
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
index_t get_size() const
Definition: Subset.h:42

SHOGUN Machine Learning Toolbox - Documentation