13 using namespace shogun;
15 #define LIBLBP_INDEX(ROW,COL,NUM_ROWS) ((COL)*(NUM_ROWS)+(ROW))
129 SG_UNSTABLE(
"CLBPPyrDotFeatures::CLBPPyrDotFeatures()",
"\n");
221 SG_ERROR(
"Dimensions don't match, vec2_dim=%d, vec_nDim=%d\n", vec2_len,
vec_nDim);
231 int32_t ww,
hh, x, y, j;
241 for(x=1; x < ww-1; x++)
243 for(y=1; y< hh-1; y++)
256 dot_prod += vec2[offset+pattern];
266 if(ww % 2 == 1) ww--;
267 if(hh % 2 == 1) hh--;
270 for(x=0; x < ww; x++)
271 for(j=0; j <
hh; j++)
276 for(y=0; y <
hh; y++)
277 for(j=0; j < ww; j++)
289 SG_ERROR(
"Dimensions don't match, vec2_dim=%d, vec_nDim=%d\n", vec2_len,
vec_nDim);
298 int32_t offset, ww,
hh, x, y, j;
309 for(x=1; x < ww-1; x++)
311 for(y=1; y< hh-1; y++)
324 vec2[offset+pattern]+=alpha;
332 if(ww % 2 == 1) ww--;
333 if(hh % 2 == 1) hh--;
336 for(x=0; x < ww; x++)
337 for(j=0; j <
hh; j++)
342 for(y=0; y <
hh; y++)
343 for(j=0; j < ww; j++)
#define LIBLBP_INDEX(ROW, COL, NUM_ROWS)
virtual float64_t dot(int32_t vec_idx1, CDotFeatures *df, int32_t vec_idx2)
virtual int32_t get_num_vectors() const
void get_feature_matrix(ST **dst, int32_t *num_feat, int32_t *num_vec)
virtual int32_t get_num_vectors() const
#define SG_NOTIMPLEMENTED
CSimpleFeatures< uint32_t > * m_feat
virtual void free_feature_iterator(void *iterator)
Features that support dot products among other operations.
EFeatureClass
shogun feature class
virtual bool get_next_feature(int32_t &index, float64_t &value, void *iterator)
virtual EFeatureType get_feature_type()
virtual int32_t get_dim_feature_space() const
CFeatures * duplicate() const
virtual EFeatureClass get_feature_class()
virtual void add_to_dense_vec(float64_t alpha, int32_t vec_idx1, float64_t *vec2, int32_t vec2_len, bool abs_val=false)
EFeatureType
shogun feature type
virtual int32_t get_size()
virtual void * get_feature_iterator(int32_t vector_index)
virtual ~CLBPPyrDotFeatures()
The class Features is the base class of all feature objects.
virtual float64_t dense_dot(int32_t vec_idx1, const float64_t *vec2, int32_t vec2_len)
uint32_t liblbp_pyr_get_dim(uint16_t nPyramids)
implement DotFeatures for the polynomial kernel
virtual int32_t get_nnz_features_for_vector(int32_t num)
#define SG_UNSTABLE(func,...)