Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
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(void);
00030
00036 CLBPPyrDotFeatures(CSimpleFeatures<uint32_t>* images, uint16_t num_pyramids);
00037
00038 virtual ~CLBPPyrDotFeatures();
00039
00046 CLBPPyrDotFeatures(const CLBPPyrDotFeatures & orig){
00047 SG_PRINT("CLBPPyrDotFeatures:\n");
00048 SG_NOTIMPLEMENTED;};
00049
00054 inline virtual int32_t get_dim_feature_space() const
00055 {
00056 return vec_nDim;
00057 }
00058
00064 virtual inline int32_t get_nnz_features_for_vector(int32_t num)
00065 {
00066 return vec_nDim;
00067 }
00068
00073 inline virtual EFeatureType get_feature_type()
00074 {
00075 return F_UNKNOWN;
00076 }
00077
00082 inline virtual EFeatureClass get_feature_class()
00083 {
00084 return C_POLY;
00085 }
00086
00091 inline virtual int32_t get_num_vectors() const
00092 {
00093 if (m_feat)
00094 return m_feat->get_num_vectors();
00095 else
00096 return 0;
00097
00098 }
00099
00107 virtual float64_t dot(int32_t vec_idx1, CDotFeatures* df, int32_t vec_idx2);
00108
00113 inline virtual int32_t get_size()
00114 {
00115 return sizeof(float64_t);
00116 }
00117
00127 virtual void* get_feature_iterator(int32_t vector_index)
00128 {
00129 SG_NOTIMPLEMENTED;
00130 return NULL;
00131 }
00132
00143 virtual bool get_next_feature(int32_t& index, float64_t& value, void* iterator)
00144 {
00145 SG_NOTIMPLEMENTED;
00146 return NULL;
00147 }
00148
00154 virtual void free_feature_iterator(void* iterator)
00155 {
00156 SG_NOTIMPLEMENTED;
00157 }
00158
00163 CFeatures* duplicate() const;
00164
00169 inline virtual const char* get_name() const { return "LBPPyrDotFeatures"; }
00170
00178 virtual float64_t dense_dot(int32_t vec_idx1, const float64_t* vec2, int32_t vec2_len);
00179
00188 virtual void add_to_dense_vec(float64_t alpha, int32_t vec_idx1, float64_t* vec2, int32_t vec2_len, bool abs_val=false);
00189 protected:
00190
00194 uint32_t liblbp_pyr_get_dim(uint16_t nPyramids);
00195
00196 protected:
00198 CSimpleFeatures<uint32_t>* m_feat;
00199
00201 uint32_t* img;
00203 int32_t img_nRows;
00205 int32_t img_nCols;
00207 int32_t vec_nDim;
00208 };
00209 }
00210 #endif