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 
00021 class CDummyFeatures : public CFeatures
00022 {
00023     public:
00028         CDummyFeatures(int32_t num) : CFeatures(0), num_vectors(num)
00029         {
00030         }
00031 
00033         CDummyFeatures(const CDummyFeatures &orig) : CFeatures(0),
00034             num_vectors(orig.num_vectors)
00035         {
00036         }
00037 
00039         virtual ~CDummyFeatures()
00040         {
00041         }
00042 
00044         virtual int32_t get_num_vectors()
00045         {
00046             return num_vectors;
00047         }
00048 
00050         virtual int32_t get_size()
00051         {
00052             return 1;
00053         }
00054 
00056         virtual CFeatures* duplicate() const
00057         {
00058             return new CDummyFeatures(*this);
00059         }
00060 
00062         inline EFeatureType get_feature_type()
00063         {
00064             return F_ANY;
00065         }
00066 
00068         inline virtual EFeatureClass get_feature_class()
00069         {
00070             return C_ANY;
00071         }
00072 
00074         inline virtual const char* get_name() const { return "DummyFeatures"; }
00075 
00076     protected:
00078         int32_t num_vectors;
00079 };
00080 #endif

SHOGUN Machine Learning Toolbox - Documentation