SHOGUN  v3.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 {
17 }
18 
20  float64_t* lab)
21 {
23  return;
24 }
25 
27 {
28 }
29 
31  float32_t* vec, int32_t dim, float32_t b, int32_t num_vec)
32 {
33  ASSERT(num_vec>=0)
34 
35  int32_t counter=0;
36  start_parser();
37  while (get_next_example())
38  {
39  if (alphas)
40  output[counter]=alphas[counter]*dense_dot(vec, dim)+b;
41  else
42  output[counter]=dense_dot(vec, dim)+b;
43 
45 
46  counter++;
47  if ((counter>=num_vec) && (num_vec>0))
48  break;
49  }
50  end_parser();
51 }
52 
54 {
55  int32_t dim = get_dim_feature_space();
56  if (dim > len)
57  {
58  vec = SG_REALLOC(float32_t, vec, len, dim);
59  memset(&vec[len], 0, (dim-len) * sizeof(float32_t));
60  len = dim;
61  }
62 }
63 
65 {
66  int32_t dim = get_dim_feature_space();
67  if (dim > len)
68  {
69  vec = SG_REALLOC(float64_t, vec, len, dim);
70  memset(&vec[len], 0, (dim-len) * sizeof(float64_t));
71  len = dim;
72  }
73 }
74 
76 {
78  return NULL;
79 }
80 
82 {
84  return -1;
85 }
86 
87 bool CStreamingDotFeatures::get_next_feature(int32_t& index, float32_t& value, void* iterator)
88 {
90  return false;
91 }
92 
94 {
96  return;
97 }

SHOGUN Machine Learning Toolbox - Documentation