SHOGUN  v2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
LBPPyrDotFeatures.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 3 of the License, or
5  * (at your option) any later version.
6  *
7  * Written (W) 2010 Vojtech Franc, Soeren Sonnenburg
8  * Copyright (C) 2010 Vojtech Franc, xfrancv@cmp.felk.cvut.cz
9  * Copyright (C) 2010 Berlin Institute of Technology
10  */
11 #ifndef _LBP_PYR_DOTFEATURES__H__
12 #define _LBP_PYR_DOTFEATURES__H__
13 
14 #include <shogun/lib/common.h>
17 
18 namespace shogun
19 {
26 {
27  public:
30 
36  CLBPPyrDotFeatures(CDenseFeatures<uint32_t>* images, uint16_t num_pyramids);
37 
38  virtual ~CLBPPyrDotFeatures();
39 
47 
52  virtual int32_t get_dim_feature_space() const;
53 
59  virtual int32_t get_nnz_features_for_vector(int32_t num);
60 
65  virtual EFeatureType get_feature_type() const;
66 
71  virtual EFeatureClass get_feature_class() const;
72 
77  virtual int32_t get_num_vectors() const;
78 
86  virtual float64_t dot(int32_t vec_idx1, CDotFeatures* df, int32_t vec_idx2);
87 
92  virtual int32_t get_size() const;
93 
103  virtual void* get_feature_iterator(int32_t vector_index);
104 
115  virtual bool get_next_feature(int32_t& index, float64_t& value, void* iterator);
116 
122  virtual void free_feature_iterator(void* iterator);
123 
128  CFeatures* duplicate() const;
129 
134  virtual const char* get_name() const { return "LBPPyrDotFeatures"; }
135 
143  virtual float64_t dense_dot(int32_t vec_idx1, const float64_t* vec2, int32_t vec2_len);
144 
153  virtual void add_to_dense_vec(float64_t alpha, int32_t vec_idx1,
154  float64_t* vec2, int32_t vec2_len, bool abs_val=false);
155 
156  protected:
157 
161  uint32_t liblbp_pyr_get_dim(uint16_t nPyramids);
162 
163  protected:
166 
168  uint32_t* img;
170  int32_t img_nRows;
172  int32_t img_nCols;
174  int32_t vec_nDim;
175 };
176 }
177 #endif /* _LBP_PYR_DOTFEATURES__H__ */

SHOGUN Machine Learning Toolbox - Documentation