SHOGUN  4.2.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  {
64  }
65 
78  CStreamingDotFeatures(CDotFeatures* dot_features, float64_t* lab=NULL);
79 
80  virtual ~CStreamingDotFeatures();
81 
88  virtual float32_t dot(CStreamingDotFeatures* df)=0;
89 
95  virtual float32_t dense_dot(const float32_t* vec2, int32_t vec2_len)=0;
96 
114  virtual void dense_dot_range(float32_t* output, float32_t* alphas,
115  float32_t* vec, int32_t dim, float32_t b, int32_t num_vec=0);
116 
124  virtual void add_to_dense_vec(float32_t alpha, float32_t* vec2,
125  int32_t vec2_len, bool abs_val=false)=0;
126 
135  virtual void expand_if_required(float32_t*& vec, int32_t &len);
136 
145  virtual void expand_if_required(float64_t*& vec, int32_t &len);
146 
154  virtual int32_t get_dim_feature_space() const=0;
155 
162  virtual void* get_feature_iterator();
163 
170  virtual int32_t get_nnz_features_for_vector();
171 
182  virtual bool get_next_feature(int32_t& index, float32_t& value, void* iterator);
183 
189  virtual void free_feature_iterator(void* iterator);
190 
191 };
192 }
193 #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)
#define SG_NOTIMPLEMENTED
Definition: SGIO.h:139
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
CStreamingDotFeatures(CStreamingFile *file, bool is_labelled, int32_t size)
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