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) 2012 Viktor Gal 00008 * Copyright (C) 2012 Viktor Gal 00009 */ 00010 00011 #ifndef __LATENTLABELS_H__ 00012 #define __LATENTLABELS_H__ 00013 00014 #include <shogun/labels/Labels.h> 00015 #include <shogun/lib/Data.h> 00016 #include <shogun/lib/DynamicObjectArray.h> 00017 00018 namespace shogun 00019 { 00024 class CLatentLabels : public CLabels 00025 { 00026 public: 00028 CLatentLabels(); 00029 00034 CLatentLabels(int32_t num_samples); 00035 00040 CLatentLabels(CLabels* labels); 00041 00043 virtual ~CLatentLabels(); 00044 00049 CDynamicObjectArray* get_latent_labels() const; 00050 00056 CData* get_latent_label(int32_t idx); 00057 00062 void add_latent_label(CData* label); 00063 00070 bool set_latent_label(int32_t idx, CData* label); 00071 00078 virtual void ensure_valid(const char* context=NULL); 00079 00084 virtual ELabelType get_label_type() const { return LT_LATENT; } 00085 00090 virtual const char* get_name() const { return "LatentLabels"; } 00091 00096 virtual int32_t get_num_labels() const; 00097 00102 void set_labels(CLabels* labels); 00103 00108 CLabels* get_labels() const; 00109 00110 protected: 00112 CDynamicObjectArray* m_latent_labels; 00114 CLabels* m_labels; 00115 00116 private: 00118 void init(); 00119 }; 00120 } 00121 00122 #endif /* __LATENTLABELS_H__ */ 00123