ByteFeatures.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) 1999-2008 Soeren Sonnenburg
00008  * Copyright (C) 1999-2008 Fraunhofer Institute FIRST and Max-Planck-Society
00009  */
00010 
00011 #ifndef _BYTEFEATURES__H__
00012 #define _BYTEFEATURES__H__
00013 
00014 #include "features/SimpleFeatures.h"
00015 #include "features/CharFeatures.h"
00016 #include "features/Alphabet.h"
00017 #include "lib/common.h"
00018 
00023 class CByteFeatures : public CSimpleFeatures<uint8_t>
00024 {
00025     public:
00031         CByteFeatures(EAlphabet alpha, int32_t size=0);
00032 
00038         CByteFeatures(CAlphabet* alpha, int32_t size=0);
00039 
00041         CByteFeatures(const CByteFeatures & orig);
00042         
00050         CByteFeatures(EAlphabet alphabet, uint8_t* feature_matrix, int32_t num_feat, int32_t num_vec);
00051 
00057         CByteFeatures(EAlphabet alphabet, char* fname);
00058 
00059         ~CByteFeatures();
00060 
00065         inline CAlphabet* get_alphabet()
00066         {
00067             return alphabet;
00068         }
00069 
00078         inline virtual void copy_feature_matrix(uint8_t* src, int32_t num_feat, int32_t num_vec)
00079         {
00080             CSimpleFeatures<uint8_t>::copy_feature_matrix(src, num_feat, num_vec);
00081         }
00082 
00087         virtual EFeatureType get_feature_type() { return F_BYTE; }
00088 
00094         virtual bool load(char* fname);
00095 
00101         virtual bool save(char* fname);
00102 
00103     protected:
00105         CAlphabet* alphabet;
00106 };
00107 #endif

SHOGUN Machine Learning Toolbox - Documentation