SHOGUN  v2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
StreamingDotFeatures.cpp
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  */
11 
12 using namespace shogun;
13 
15 {
16  init();
18 }
19 
21  int32_t size) : CStreamingFeatures()
22 {
23  init(file, is_labelled, size);
25 }
26 
28  float64_t* lab)
29 {
31  return;
32 }
33 
35 {
36 }
37 
39  float32_t* vec, int32_t dim, float32_t b, int32_t num_vec)
40 {
41  ASSERT(num_vec>=0);
42 
43  int32_t counter=0;
44  start_parser();
45  while (get_next_example())
46  {
47  if (alphas)
48  output[counter]=alphas[counter]*dense_dot(vec, dim)+b;
49  else
50  output[counter]=dense_dot(vec, dim)+b;
51 
53 
54  counter++;
55  if ((counter>=num_vec) && (num_vec>0))
56  break;
57  }
58  end_parser();
59 }
60 
62 {
63  int32_t dim = get_dim_feature_space();
64  if (dim > len)
65  {
66  vec = SG_REALLOC(float32_t, vec, dim);
67  memset(&vec[len], 0, (dim-len) * sizeof(float32_t));
68  len = dim;
69  }
70 }
71 
73 {
74  int32_t dim = get_dim_feature_space();
75  if (dim > len)
76  {
77  vec = SG_REALLOC(float64_t, vec, dim);
78  memset(&vec[len], 0, (dim-len) * sizeof(float64_t));
79  len = dim;
80  }
81 }
82 
84 {
86  return NULL;
87 }
88 
90 {
92  return -1;
93 }
94 
95 bool CStreamingDotFeatures::get_next_feature(int32_t& index, float32_t& value, void* iterator)
96 {
98  return false;
99 }
100 
102 {
104  return;
105 }
106 
107 void CStreamingDotFeatures::init()
108 {
109 }
110 
111 void CStreamingDotFeatures::init(CStreamingFile *file, bool is_labelled, int32_t size)
112 {
113 }

SHOGUN Machine Learning Toolbox - Documentation