SHOGUN  3.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
StreamingDotFeatures.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) 2011 Shashwat Lal Das
8  * Copyright (C) 2011 Berlin Institute of Technology and Max-Planck-Society
9  */
10 #ifndef _STREAMING_DOTFEATURES__H__
11 #define _STREAMING_DOTFEATURES__H__
12 
13 #include <shogun/lib/config.h>
14 
15 #include <shogun/lib/common.h>
19 
20 namespace shogun
21 {
22 class CDotFeatures;
23 class CStreamingFile;
24 
48 {
49 
50 public:
53 
61  CStreamingDotFeatures(CStreamingFile* file, bool is_labelled, int32_t size);
62 
75  CStreamingDotFeatures(CDotFeatures* dot_features, float64_t* lab=NULL);
76 
77  virtual ~CStreamingDotFeatures();
78 
85  virtual float32_t dot(CStreamingDotFeatures* df)=0;
86 
92  virtual float32_t dense_dot(const float32_t* vec2, int32_t vec2_len)=0;
93 
111  virtual void dense_dot_range(float32_t* output, float32_t* alphas,
112  float32_t* vec, int32_t dim, float32_t b, int32_t num_vec=0);
113 
121  virtual void add_to_dense_vec(float32_t alpha, float32_t* vec2,
122  int32_t vec2_len, bool abs_val=false)=0;
123 
132  virtual void expand_if_required(float32_t*& vec, int32_t &len);
133 
142  virtual void expand_if_required(float64_t*& vec, int32_t &len);
143 
151  virtual int32_t get_dim_feature_space() const=0;
152 
159  virtual void* get_feature_iterator();
160 
167  virtual int32_t get_nnz_features_for_vector();
168 
179  virtual bool get_next_feature(int32_t& index, float32_t& value, void* iterator);
180 
186  virtual void free_feature_iterator(void* iterator);
187 
188 };
189 }
190 #endif // _STREAMING_DOTFEATURES__H__

SHOGUN Machine Learning Toolbox - Documentation