SHOGUN  4.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
StoreVectorAggregator.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) 2013 Soumyajit De
8  */
9 
10 #include <shogun/lib/SGVector.h>
14 
15 namespace shogun
16 {
17 template<class T>
20  {
21  init();
22  SG_GCDEBUG("%s created (%p)\n", this->get_name(), this)
23  }
24 
25 template<class T>
28  {
29  init();
30 
31  m_aggregate=SGVector<T>(dimension);
32  m_aggregate.set_const(static_cast<T>(0));
33  }
34 
35 template<class T>
37  {
38  SG_ADD(&m_aggregate, "current_aggregate",
39  "Aggregation of computation job results", MS_NOT_AVAILABLE);
40  }
41 
42 template<class T>
44  {
45  }
46 
47 template<class T>
49  {
50  SG_GCDEBUG("Entering\n")
51 
52  // check for proper typecast
53  CVectorResult<T>* new_result=dynamic_cast<CVectorResult<T>*>(result);
54  if (!new_result)
55  SG_ERROR("result is not of CVectorResult type!\n");
56  // aggregate it with previous
57  m_aggregate+=new_result->get_result();
58 
59  SG_GCDEBUG("Leaving\n")
60  }
61 
62 template<>
64  {
66  }
67 
68 template<>
70  {
72  }
73 
74 template class CStoreVectorAggregator<bool>;
75 template class CStoreVectorAggregator<char>;
76 template class CStoreVectorAggregator<int8_t>;
77 template class CStoreVectorAggregator<uint8_t>;
78 template class CStoreVectorAggregator<int16_t>;
80 template class CStoreVectorAggregator<int32_t>;
82 template class CStoreVectorAggregator<int64_t>;
88 }
int32_t index_t
Definition: common.h:62
Abstract template class that aggregates vector job results in each submit_result call, finalize is abstract.
Base class that stores the result of an independent job.
Definition: JobResult.h:21
#define SG_ERROR(...)
Definition: SGIO.h:129
#define SG_NOTIMPLEMENTED
Definition: SGIO.h:139
virtual void submit_result(CJobResult *result)
#define SG_GCDEBUG(...)
Definition: SGIO.h:102
shogun vector
SGVector< T > get_result() const
Definition: VectorResult.h:60
Abstract base class that provides an interface for computing an aggeregation of the job results of in...
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
virtual const char * get_name() const
#define SG_ADD(...)
Definition: SGObject.h:84
Base class that stores the result of an independent job when the result is a vector.

SHOGUN Machine Learning Toolbox - Documentation