IntFeatures.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 _INTFEATURES__H__
00012 #define _INTFEATURES__H__
00013 
00014 #include "features/SimpleFeatures.h"
00015 #include "lib/common.h"
00016 
00021 class CIntFeatures: public CSimpleFeatures<int32_t>
00022 {
00023     public:
00028         CIntFeatures(int32_t size=0) : CSimpleFeatures<int32_t>(size) {}
00029 
00031         CIntFeatures(const CIntFeatures & orig) :
00032             CSimpleFeatures<int32_t>(orig) {}
00033 
00041         inline CIntFeatures(int32_t* src, int32_t num_feat, int32_t num_vec): CSimpleFeatures<int32_t>(0)
00042         {
00043             CSimpleFeatures<int32_t>::copy_feature_matrix(src, num_feat, num_vec);
00044         }
00045 
00050         CIntFeatures(char* fname) : CSimpleFeatures<int32_t>(fname)
00051         {
00052             load(fname);
00053         }
00054 
00061         inline virtual void get_fm(int32_t** dst, int32_t* d1, int32_t* d2)
00062         {
00063             CSimpleFeatures<int32_t>::get_fm(dst, d1, d2);
00064         }
00065 
00074         inline virtual void copy_feature_matrix(int32_t* src, int32_t num_feat, int32_t num_vec)
00075         {
00076             CSimpleFeatures<int32_t>::copy_feature_matrix(src, num_feat, num_vec);
00077         }
00078 
00084         virtual bool load(char* fname);
00085 
00091         virtual bool save(char* fname);
00092 };
00093 #endif

SHOGUN Machine Learning Toolbox - Documentation