DummyFeatures.h

Go to the documentation of this file.
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) 2009 Soeren Sonnenburg
00008  * Copyright (C) 2009 Fraunhofer Institute FIRST and Max-Planck-Society
00009  */
00010 
00011 #ifndef _DUMMYFEATURES__H__
00012 #define _DUMMYFEATURES__H__
00013 
00014 #include "lib/common.h"
00015 #include "features/Features.h"
00016 #include "base/Parameter.h"
00017 
00018 namespace shogun
00019 {
00024 class CDummyFeatures : public CFeatures
00025 {
00026     void init(void) {
00027         m_parameters->add(&num_vectors, "num_vectors",
00028                           "Number of feature vectors.");
00029     }
00030 
00031     public:
00033         CDummyFeatures(void) {
00034             init();
00035 
00036             num_vectors = 0;
00037         }
00038 
00043         CDummyFeatures(int32_t num) : CFeatures(0), num_vectors(num)
00044         {
00045             init();
00046         }
00047 
00049         CDummyFeatures(const CDummyFeatures &orig) : CFeatures(0),
00050             num_vectors(orig.num_vectors)
00051         {
00052             init();
00053         }
00054 
00056         virtual ~CDummyFeatures()
00057         {
00058         }
00059 
00061         virtual int32_t get_num_vectors()
00062         {
00063             return num_vectors;
00064         }
00065 
00067         virtual int32_t get_size()
00068         {
00069             return 1;
00070         }
00071 
00073         virtual CFeatures* duplicate() const
00074         {
00075             return new CDummyFeatures(*this);
00076         }
00077 
00079         inline EFeatureType get_feature_type()
00080         {
00081             return F_ANY;
00082         }
00083 
00085         inline virtual EFeatureClass get_feature_class()
00086         {
00087             return C_ANY;
00088         }
00089 
00091         inline virtual const char* get_name() const { return "DummyFeatures"; }
00092 
00093     protected:
00095         int32_t num_vectors;
00096 };
00097 }
00098 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

SHOGUN Machine Learning Toolbox - Documentation