RealFeatures.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  * Written (W) 1999-2008 Gunnar Raetsch
00009  * Written (W) 1999-2007 Fabio De Bona
00010  * Copyright (C) 1999-2008 Fraunhofer Institute FIRST and Max-Planck-Society
00011  */
00012 
00013 #ifndef _DREALFEATURES__H__
00014 #define _DREALFEATURES__H__
00015 
00016 #include "features/SimpleFeatures.h"
00017 #include "features/CharFeatures.h"
00018 #include "lib/common.h"
00019 
00024 class CRealFeatures : public CSimpleFeatures<float64_t>
00025 {
00026     public:
00031         CRealFeatures(int32_t size=0) : CSimpleFeatures<float64_t>(size) {}
00032 
00034         CRealFeatures(const CRealFeatures & orig) :
00035             CSimpleFeatures<float64_t>(orig) {}
00036 
00044         inline CRealFeatures(
00045             float64_t* src, int32_t num_feat, int32_t num_vec)
00046         : CSimpleFeatures<float64_t>(0)
00047         {
00048             CSimpleFeatures<float64_t>::copy_feature_matrix(
00049                 src, num_feat, num_vec);
00050         }
00051 
00056         CRealFeatures(char* fname) : CSimpleFeatures<float64_t>(fname)
00057         {
00058             load(fname);
00059         }
00060 
00068         bool Align_char_features(
00069             CCharFeatures* cf, CCharFeatures* Ref, float64_t gapCost);
00070 
00077         inline virtual void get_fm(float64_t** dst, int32_t* d1, int32_t* d2)
00078         {
00079             CSimpleFeatures<float64_t>::get_fm(dst, d1, d2);
00080         }
00081 
00090         inline virtual void copy_feature_matrix(
00091             float64_t* src, int32_t num_feat, int32_t num_vec)
00092         {
00093             CSimpleFeatures<float64_t>::copy_feature_matrix(
00094                 src, num_feat, num_vec);
00095         }
00096 
00102         virtual bool load(char* fname);
00103 
00109         virtual bool save(char* fname);
00110 };
00111 #endif

SHOGUN Machine Learning Toolbox - Documentation