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() { return LT_LATENT; } 00085 00090 static CLatentLabels* obtain_from_generic(CLabels* base_labels); 00091 00096 virtual const char* get_name() const { return "LatentLabels"; } 00097 00102 virtual int32_t get_num_labels(); 00103 00108 void set_labels(CLabels* labels); 00109 00114 CLabels* get_labels() const; 00115 00116 protected: 00118 CDynamicObjectArray* m_latent_labels; 00120 CLabels* m_labels; 00121 00122 private: 00124 void init(); 00125 }; 00126 } 00127 00128 #endif /* __LATENTLABELS_H__ */ 00129