SHOGUN
v1.1.0
|
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) 2010 Vojtech Franc, Soeren Sonnenburg 00008 * Copyright (C) 2010 Vojtech Franc, xfrancv@cmp.felk.cvut.cz 00009 * Copyright (C) 2010 Berlin Institute of Technology 00010 */ 00011 #ifndef _LBP_PYR_DOTFEATURES__H__ 00012 #define _LBP_PYR_DOTFEATURES__H__ 00013 00014 #include <shogun/lib/common.h> 00015 #include <shogun/features/DotFeatures.h> 00016 #include <shogun/features/SimpleFeatures.h> 00017 00018 namespace shogun 00019 { 00025 class CLBPPyrDotFeatures : public CDotFeatures 00026 { 00027 public: 00029 CLBPPyrDotFeatures(); 00030 00036 CLBPPyrDotFeatures(CSimpleFeatures<uint32_t>* images, uint16_t num_pyramids); 00037 00038 virtual ~CLBPPyrDotFeatures(); 00039 00046 CLBPPyrDotFeatures(const CLBPPyrDotFeatures & orig); 00047 00052 virtual int32_t get_dim_feature_space() const; 00053 00059 virtual int32_t get_nnz_features_for_vector(int32_t num); 00060 00065 virtual EFeatureType get_feature_type(); 00066 00071 virtual EFeatureClass get_feature_class(); 00072 00077 virtual int32_t get_num_vectors() const; 00078 00086 virtual float64_t dot(int32_t vec_idx1, CDotFeatures* df, int32_t vec_idx2); 00087 00092 virtual int32_t get_size(); 00093 00103 virtual void* get_feature_iterator(int32_t vector_index); 00104 00115 virtual bool get_next_feature(int32_t& index, float64_t& value, void* iterator); 00116 00122 virtual void free_feature_iterator(void* iterator); 00123 00128 CFeatures* duplicate() const; 00129 00134 virtual const char* get_name() const { return "LBPPyrDotFeatures"; } 00135 00143 virtual float64_t dense_dot(int32_t vec_idx1, const float64_t* vec2, int32_t vec2_len); 00144 00153 virtual void add_to_dense_vec(float64_t alpha, int32_t vec_idx1, 00154 float64_t* vec2, int32_t vec2_len, bool abs_val=false); 00155 00156 protected: 00157 00161 uint32_t liblbp_pyr_get_dim(uint16_t nPyramids); 00162 00163 protected: 00165 CSimpleFeatures<uint32_t>* m_feat; 00166 00168 uint32_t* img; 00170 int32_t img_nRows; 00172 int32_t img_nCols; 00174 int32_t vec_nDim; 00175 }; 00176 } 00177 #endif /* _LBP_PYR_DOTFEATURES__H__ */