SHOGUN  4.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
CombinedFeatures.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) 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 
16 #include <shogun/lib/config.h>
17 
20 
21 namespace shogun
22 {
23 class CFeatures;
24 class CDynamicObjectArray;
25 
39 {
40  public:
45 
50  virtual CFeatures* duplicate() const;
51 
53  virtual ~CCombinedFeatures();
54 
60  {
61  return F_UNKNOWN;
62  }
63 
69  {
70  return C_COMBINED;
71  }
72 
77  virtual int32_t get_num_vectors() const
78  {
79  return m_subset_stack->has_subsets()
81  }
82 
84  void list_feature_objs();
85 
92 
98 
104  CFeatures* get_feature_obj(int32_t idx);
105 
111 
119  bool insert_feature_obj(CFeatures* obj, int32_t idx);
120 
126  bool append_feature_obj(CFeatures* obj);
127 
133  bool delete_feature_obj(int32_t idx);
134 
139  int32_t get_num_feature_obj();
140 
152 
159  virtual void add_subset(SGVector<index_t> subset);
160 
166  virtual void remove_subset();
167 
173  virtual void remove_all_subsets();
174 
183  virtual CFeatures* copy_subset(SGVector<index_t> indices);
184 
186  virtual const char* get_name() const { return "CombinedFeatures"; }
187 
188  private:
189  void init();
190 
191  protected:
194 
198  int32_t num_vec;
199 };
200 }
201 #endif
CSubsetStack * m_subset_stack
Definition: Features.h:352
virtual EFeatureType get_feature_type() const
virtual void add_subset(SGVector< index_t > subset)
index_t get_size() const
Definition: SubsetStack.h:80
CDynamicObjectArray * feature_array
EFeatureClass
shogun feature class
Definition: FeatureTypes.h:38
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:19
bool check_feature_obj_compatibility(CCombinedFeatures *comb_feat)
bool insert_feature_obj(CFeatures *obj, int32_t idx)
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
The class Features is the base class of all feature objects.
Definition: Features.h:68
virtual bool has_subsets() const
Definition: SubsetStack.h:89
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