SHOGUN  4.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules 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__
virtual float32_t dense_dot(const float32_t *vec2, int32_t vec2_len)=0
virtual void free_feature_iterator(void *iterator)
virtual void dense_dot_range(float32_t *output, float32_t *alphas, float32_t *vec, int32_t dim, float32_t b, int32_t num_vec=0)
virtual float32_t dot(CStreamingDotFeatures *df)=0
Features that support dot products among other operations.
Definition: DotFeatures.h:44
virtual bool get_next_feature(int32_t &index, float32_t &value, void *iterator)
A Streaming File access class.
Definition: StreamingFile.h:34
virtual int32_t get_dim_feature_space() const =0
double float64_t
Definition: common.h:50
virtual void expand_if_required(float32_t *&vec, int32_t &len)
Streaming features that support dot products among other operations.
float float32_t
Definition: common.h:49
virtual void add_to_dense_vec(float32_t alpha, float32_t *vec2, int32_t vec2_len, bool abs_val=false)=0
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
Streaming features are features which are used for online algorithms.
virtual int32_t get_nnz_features_for_vector()

SHOGUN Machine Learning Toolbox - Documentation