SHOGUN  v2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DirectorDotFeatures.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  * Copyright (C) 2012 Soeren Sonnenburg
8  */
9 
10 #ifndef _DIRECTORDOTFEATURES_H___
11 #define _DIRECTORDOTFEATURES_H___
12 
13 #include <shogun/lib/config.h>
14 
15 #ifdef USE_SWIG_DIRECTORS
16 #include <shogun/lib/common.h>
19 
20 namespace shogun
21 {
24 #define IGNORE_IN_CLASSLIST
25 IGNORE_IN_CLASSLIST class CDirectorDotFeatures : public CDotFeatures
26 {
27  public:
28 
33  CDirectorDotFeatures(int32_t size=0) : CDotFeatures(size)
34  {
35  }
36 
37  virtual ~CDirectorDotFeatures() { }
38 
45  virtual int32_t get_num_vectors() const
46  {
48  return 0;
49  }
50 
51 
59  virtual int32_t get_dim_feature_space() const
60  {
62  return 0;
63  }
64 
72  virtual float64_t dot(int32_t vec_idx1, CDotFeatures* df, int32_t vec_idx2)
73  {
75  return 0;
76  }
77 
83  virtual float64_t dense_dot_sgvec(int32_t vec_idx1, const SGVector<float64_t> vec2)
84  {
86  return 0;
87  }
88 
97  virtual void add_to_dense_sgvec(float64_t alpha, int32_t vec_idx1, SGVector<float64_t> vec2, bool abs_val=false)
98  {
100  }
101 
108  virtual float64_t dense_dot(int32_t vec_idx1, const float64_t* vec2, int32_t vec2_len)
109  {
110  return dense_dot_sgvec(vec_idx1, SGVector<float64_t>((float64_t*) vec2, vec2_len, false));
111  }
112 
121  virtual void add_to_dense_vec(float64_t alpha, int32_t vec_idx1, float64_t* vec2, int32_t vec2_len, bool abs_val=false)
122  {
123  add_to_dense_sgvec(alpha, vec_idx1, SGVector<float64_t>(vec2, vec2_len, false), abs_val);
124  }
125 
139  virtual void dense_dot_range(float64_t* output, int32_t start, int32_t stop, float64_t* alphas, float64_t* vec, int32_t dim, float64_t b)
140  {
141  CDotFeatures::dense_dot_range(output, start, stop, alphas, vec, dim, b);
142  }
143 
155  virtual void dense_dot_range_subset(int32_t* sub_index, int32_t num,
156  float64_t* output, float64_t* alphas, float64_t* vec, int32_t dim, float64_t b)
157  {
158  CDotFeatures::dense_dot_range_subset(sub_index, num, output, alphas, vec, dim, b);
159  }
160 
168  virtual int32_t get_nnz_features_for_vector(int32_t num)
169  {
171  return 0;
172  }
173 
183  virtual void* get_feature_iterator(int32_t vector_index)
184  {
186  return NULL;
187  }
188 
199  virtual bool get_next_feature(int32_t& index, float64_t& value, void* iterator)
200  {
202  return false;
203  }
204 
210  virtual void free_feature_iterator(void* iterator)
211  {
213  }
214 
219  virtual SGVector<float64_t> get_mean()
220  {
221  return CDotFeatures::get_mean();
222  }
223 
228  virtual SGMatrix<float64_t> get_cov()
229  {
230  return CDotFeatures::get_cov();
231  }
232 
239  virtual EFeatureType get_feature_type() const
240  {
241  return F_ANY;
242  }
243 
250  virtual CFeatures* duplicate() const
251  {
253  return NULL;
254  }
255 
262  virtual EFeatureClass get_feature_class() const
263  {
264  return C_DIRECTOR_DOT;
265  }
266 
272  virtual int32_t add_preprocessor(CPreprocessor* p)
273  {
274  return CFeatures::add_preprocessor(p);
275  }
276 
282  virtual CPreprocessor* del_preprocessor(int32_t num)
283  {
284  return CFeatures::del_preprocessor(num);
285  }
286 
295  virtual bool reshape(int32_t num_features, int32_t num_vectors)
296  {
298  return false;
299  }
300 
307  virtual int32_t get_size() const
308  {
310  return 0;
311  }
312 
317  virtual void load(CFile* loader)
318  {
319  CFeatures::load(loader);
320  }
321 
326  virtual void save(CFile* writer)
327  {
328  CFeatures::save(writer);
329  }
330 
336  virtual void add_subset(SGVector<index_t> subset)
337  {
338  CFeatures::add_subset(subset);
339  }
340 
343  virtual void remove_subset()
344  {
346  }
347 
350  virtual void remove_all_subsets()
351  {
353  }
354 
356  virtual void subset_changed_post()
357  {
359  }
360 
370  virtual CFeatures* copy_subset(SGVector<index_t> indices)
371  {
372  return CFeatures::copy_subset(indices);
373  }
374 
376  inline virtual const char* get_name() const { return "DirectorDotFeatures"; }
377 };
378 }
379 #endif // USE_SWIG_DIRECTORS
380 #endif // _DIRECTORDOTFEATURES_H___

SHOGUN Machine Learning Toolbox - Documentation