SHOGUN  v3.2.0
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
CombinedFeatures.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  * Written (W) 1999-2009 Soeren Sonnenburg
8  * Written (W) 1999-2008 Gunnar Raetsch
9  * Written (W) 2012 Heiko Strathmann
10  * Copyright (C) 1999-2009 Fraunhofer Institute FIRST and Max-Planck-Society
11  */
12 
13 #ifndef _CCOMBINEDFEATURES__H__
14 #define _CCOMBINEDFEATURES__H__
15 
18 
19 namespace shogun
20 {
21 class CFeatures;
22 class CDynamicObjectArray;
23 
37 {
38  public:
43 
48  virtual CFeatures* duplicate() const;
49 
51  virtual ~CCombinedFeatures();
52 
58  {
59  return F_UNKNOWN;
60  }
61 
67  {
68  return C_COMBINED;
69  }
70 
75  virtual int32_t get_num_vectors() const
76  {
77  return m_subset_stack->has_subsets()
79  }
80 
82  void list_feature_objs();
83 
90 
96 
102  CFeatures* get_feature_obj(int32_t idx);
103 
109 
117  bool insert_feature_obj(CFeatures* obj, int32_t idx);
118 
124  bool append_feature_obj(CFeatures* obj);
125 
131  bool delete_feature_obj(int32_t idx);
132 
137  int32_t get_num_feature_obj();
138 
150 
157  virtual void add_subset(SGVector<index_t> subset);
158 
164  virtual void remove_subset();
165 
171  virtual void remove_all_subsets();
172 
181  virtual CFeatures* copy_subset(SGVector<index_t> indices);
182 
184  virtual const char* get_name() const { return "CombinedFeatures"; }
185 
186  private:
187  void init();
188 
189  protected:
192 
196  int32_t num_vec;
197 };
198 }
199 #endif
CSubsetStack * m_subset_stack
Definition: Features.h:302
virtual EFeatureType get_feature_type() const
virtual void add_subset(SGVector< index_t > subset)
index_t get_size() const
Definition: SubsetStack.h:64
CDynamicObjectArray * feature_array
EFeatureClass
shogun feature class
Definition: FeatureTypes.h:35
virtual CFeatures * copy_subset(SGVector< index_t > indices)
virtual int32_t get_num_vectors() const
virtual EFeatureClass get_feature_class() const
virtual CFeatures * duplicate() const
CFeatures * get_feature_obj(int32_t idx)
Dynamic array class for CSGObject pointers that creates an array that can be used like a list or an a...
CFeatures * create_merged_copy(CFeatures *other)
EFeatureType
shogun feature type
Definition: FeatureTypes.h:16
bool check_feature_obj_compatibility(CCombinedFeatures *comb_feat)
bool insert_feature_obj(CFeatures *obj, int32_t idx)
The class Features is the base class of all feature objects.
Definition: Features.h:62
virtual bool has_subsets() const
Definition: SubsetStack.h:73
virtual const char * get_name() const
The class CombinedFeatures is used to combine a number of of feature objects into a single CombinedFe...
bool delete_feature_obj(int32_t idx)
bool append_feature_obj(CFeatures *obj)

SHOGUN Machine Learning Toolbox - Documentation