SHOGUN
v3.2.0
|
00001 /* 00002 * This program is free software; you can redistribute it and/or modify 00003 * it under the terms of the GNU General Public License as published by 00004 * the Free Software Foundation; either version 3 of the License, or 00005 * (at your option) any later version. 00006 * 00007 * Written (W) 1999-2009 Soeren Sonnenburg 00008 * Written (W) 1999-2008 Gunnar Raetsch 00009 * Written (W) 2012 Heiko Strathmann 00010 * Copyright (C) 1999-2009 Fraunhofer Institute FIRST and Max-Planck-Society 00011 */ 00012 00013 #ifndef _CCOMBINEDFEATURES__H__ 00014 #define _CCOMBINEDFEATURES__H__ 00015 00016 #include <shogun/features/Features.h> 00017 #include <shogun/lib/DynamicObjectArray.h> 00018 00019 namespace shogun 00020 { 00021 class CFeatures; 00022 class CDynamicObjectArray; 00023 00036 class CCombinedFeatures : public CFeatures 00037 { 00038 public: 00040 CCombinedFeatures(); 00042 CCombinedFeatures(const CCombinedFeatures& orig); 00043 00048 virtual CFeatures* duplicate() const; 00049 00051 virtual ~CCombinedFeatures(); 00052 00057 virtual EFeatureType get_feature_type() const 00058 { 00059 return F_UNKNOWN; 00060 } 00061 00066 virtual EFeatureClass get_feature_class() const 00067 { 00068 return C_COMBINED; 00069 } 00070 00075 virtual int32_t get_num_vectors() const 00076 { 00077 return m_subset_stack->has_subsets() 00078 ? m_subset_stack->get_size() : num_vec; 00079 } 00080 00082 void list_feature_objs(); 00083 00089 bool check_feature_obj_compatibility(CCombinedFeatures* comb_feat); 00090 00095 CFeatures* get_first_feature_obj(); 00096 00102 CFeatures* get_feature_obj(int32_t idx); 00103 00108 CFeatures* get_last_feature_obj(); 00109 00117 bool insert_feature_obj(CFeatures* obj, int32_t idx); 00118 00124 bool append_feature_obj(CFeatures* obj); 00125 00131 bool delete_feature_obj(int32_t idx); 00132 00137 int32_t get_num_feature_obj(); 00138 00149 CFeatures* create_merged_copy(CFeatures* other); 00150 00157 virtual void add_subset(SGVector<index_t> subset); 00158 00164 virtual void remove_subset(); 00165 00171 virtual void remove_all_subsets(); 00172 00181 virtual CFeatures* copy_subset(SGVector<index_t> indices); 00182 00184 virtual const char* get_name() const { return "CombinedFeatures"; } 00185 00186 private: 00187 void init(); 00188 00189 protected: 00191 CDynamicObjectArray* feature_array; 00192 00196 int32_t num_vec; 00197 }; 00198 } 00199 #endif