Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef _STREAMING_DOTFEATURES__H__
00011 #define _STREAMING_DOTFEATURES__H__
00012
00013 #include <shogun/lib/common.h>
00014 #include <shogun/features/streaming/StreamingFeatures.h>
00015 #include <shogun/features/DotFeatures.h>
00016 #include <shogun/io/streaming/StreamingFile.h>
00017
00018 namespace shogun
00019 {
00042 class CStreamingDotFeatures : public CStreamingFeatures
00043 {
00044
00045 public:
00047 CStreamingDotFeatures();
00048
00056 CStreamingDotFeatures(CStreamingFile* file, bool is_labelled, int32_t size);
00057
00070 CStreamingDotFeatures(CDotFeatures* dot_features, float64_t* lab=NULL);
00071
00072 virtual ~CStreamingDotFeatures();
00073
00080 virtual float32_t dot(CStreamingDotFeatures* df)=0;
00081
00087 virtual float32_t dense_dot(const float32_t* vec2, int32_t vec2_len)=0;
00088
00106 virtual void dense_dot_range(float32_t* output, float32_t* alphas,
00107 float32_t* vec, int32_t dim, float32_t b, int32_t num_vec=0);
00108
00116 virtual void add_to_dense_vec(float32_t alpha, float32_t* vec2,
00117 int32_t vec2_len, bool abs_val=false)=0;
00118
00127 virtual void expand_if_required(float32_t*& vec, int32_t &len);
00128
00137 virtual void expand_if_required(float64_t*& vec, int32_t &len);
00138
00146 virtual int32_t get_dim_feature_space() const=0;
00147
00154 virtual void* get_feature_iterator();
00155
00162 virtual int32_t get_nnz_features_for_vector();
00163
00174 virtual bool get_next_feature(int32_t& index, float32_t& value, void* iterator);
00175
00181 virtual void free_feature_iterator(void* iterator);
00182
00183 protected:
00184
00186 float32_t combined_weight;
00187 };
00188 }
00189 #endif // _STREAMING_DOTFEATURES__H__