ShortRealFeatures.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) 2008 Soeren Sonnenburg
00008  * Copyright (C) 2008 Fraunhofer Institute FIRST and Max-Planck-Society
00009  */
00010 
00011 #ifndef _SHORTREALFEATURES__H__
00012 #define _SHORTREALFEATURES__H__
00013 
00014 #include "features/SimpleFeatures.h"
00015 #include "lib/common.h"
00016 
00021 class CShortRealFeatures: public CSimpleFeatures<float32_t>
00022 {
00023     public:
00028         CShortRealFeatures(int32_t size=0) : CSimpleFeatures<float32_t>(size) {}
00029 
00031         CShortRealFeatures(const CShortRealFeatures & orig) :
00032             CSimpleFeatures<float32_t>(orig) {}
00033 
00041         inline CShortRealFeatures(float32_t* src, int32_t num_feat, int32_t num_vec) :
00042             CSimpleFeatures<float32_t>(0)
00043         {
00044             CSimpleFeatures<float32_t>::copy_feature_matrix(src, num_feat, num_vec);
00045         }
00046 
00051         CShortRealFeatures(char* fname) : CSimpleFeatures<float32_t>(fname)
00052         {
00053             load(fname);
00054         }
00055 
00062         inline virtual void get_fm(float32_t** dst, int32_t* d1, int32_t* d2)
00063         {
00064             CSimpleFeatures<float32_t>::get_fm(dst, d1, d2);
00065         }
00066 
00075         inline virtual void copy_feature_matrix(float32_t* src, int32_t num_feat, int32_t num_vec)
00076         {
00077             CSimpleFeatures<float32_t>::copy_feature_matrix(src, num_feat, num_vec);
00078         }
00079 
00085         virtual bool load(char* fname);
00086 
00092         virtual bool save(char* fname);
00093 };
00094 #endif

SHOGUN Machine Learning Toolbox - Documentation