SHOGUN  6.1.3
WrappedSGMatrix.h
Go to the documentation of this file.
1 /*
2  * -*- coding: utf-8 -*-
3  * vim: set fileencoding=utf-8
4  *
5  * Copyright (c) 2016, Shogun-Toolbox e.V. <shogun-team@shogun-toolbox.org>
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions are met:
10  *
11  * 1. Redistributions of source code must retain the above copyright notice,
12  * this list of conditions and the following disclaimer.
13  *
14  * 2. Redistributions in binary form must reproduce the above copyright
15  * notice, this list of conditions and the following disclaimer in the
16  * documentation and/or other materials provided with the distribution.
17  *
18  * 3. Neither the name of the copyright holder nor the names of its
19  * contributors may be used to endorse or promote products derived from
20  * this software without specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
26  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32  * POSSIBILITY OF SUCH DAMAGE.
33  *
34  * Authors: Heiko Strathmann
35  */
36 #ifdef USE_META_INTEGRATION_TESTS
37 #ifndef WRAPPED_SGMATRIX_H__
38 #define WRAPPED_SGMATRIX_H__
39 
40 #include <shogun/base/SGObject.h>
41 #include <shogun/lib/SGString.h>
42 #include <shogun/lib/SGMatrix.h>
43 
44 
45 namespace shogun
46 {
47 
53 template<class T> class CWrappedSGMatrix: public CSGObject
54 {
55 public:
57  CWrappedSGMatrix() : CSGObject()
58  {
59  set_generic<T>();
60  register_params();
61  }
62 
67  CWrappedSGMatrix(SGMatrix<T> value, const char* value_name="")
68  {
69  set_generic<T>();
70  register_params();
71  m_value = value;
72  m_value_name = value_name;
73  }
74 
76  virtual const char* get_name() const { return "WrappedSGMatrix"; }
77 
78 private:
79  void register_params()
80  {
81  m_value_name = "Unnamed";
82  m_value = SGMatrix<T>();
83 
84  SG_ADD(&m_value, "value", "Wrapped value", MS_NOT_AVAILABLE);
85  }
86 
87 protected:
89  SGMatrix<T> m_value;
90 
92  const char* m_value_name;
93 };
94 
95 template class CWrappedSGMatrix<bool>;
96 template class CWrappedSGMatrix<char>;
97 template class CWrappedSGMatrix<int8_t>;
98 template class CWrappedSGMatrix<uint8_t>;
99 template class CWrappedSGMatrix<int16_t>;
100 template class CWrappedSGMatrix<uint16_t>;
101 template class CWrappedSGMatrix<int32_t>;
102 template class CWrappedSGMatrix<uint32_t>;
103 template class CWrappedSGMatrix<int64_t>;
104 template class CWrappedSGMatrix<uint64_t>;
105 template class CWrappedSGMatrix<float32_t>;
106 template class CWrappedSGMatrix<float64_t>;
107 template class CWrappedSGMatrix<floatmax_t>;
108 
109 };
110 #endif // WRAPPED_SGMATRIX_H__
111 #endif // USE_META_INTEGRATION_TESTS
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
#define SG_ADD(...)
Definition: SGObject.h:93

SHOGUN Machine Learning Toolbox - Documentation