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) 2011-2012 Heiko Strathmann 00010 * Copyright (C) 1999-2009 Fraunhofer Institute FIRST and Max-Planck-Society 00011 */ 00012 00013 #ifndef _LABELS__H__ 00014 #define _LABELS__H__ 00015 00016 #include <shogun/lib/common.h> 00017 #include <shogun/base/SGObject.h> 00018 #include <shogun/labels/LabelTypes.h> 00019 #include <shogun/features/SubsetStack.h> 00020 00021 namespace shogun 00022 { 00034 class CLabels : public CSGObject 00035 { 00036 public: 00038 CLabels(); 00039 00041 virtual ~CLabels(); 00042 00049 virtual void ensure_valid(const char* context=NULL)=0; 00050 00055 virtual int32_t get_num_labels()=0; 00056 00061 virtual ELabelType get_label_type()=0; 00062 00068 virtual void add_subset(SGVector<index_t> subset); 00069 00072 virtual void remove_subset(); 00073 00076 virtual void remove_all_subsets(); 00077 00083 virtual void set_value(float64_t value, int32_t idx); 00084 00090 virtual float64_t get_value(int32_t idx); 00091 00097 virtual void set_values(SGVector<float64_t> values); 00098 00103 virtual SGVector<float64_t> get_values(); 00104 00105 private: 00106 void init(); 00107 00108 protected: 00109 00111 CSubsetStack* m_subset_stack; 00112 00114 SGVector<float64_t> m_current_values; 00115 }; 00116 } 00117 #endif