C++ API Reference for Intel® Data Analytics Acceleration Library 2018 Update 3

kernel_function.h
1 /* file: kernel_function.h */
2 /*******************************************************************************
3 * Copyright 2014-2018 Intel Corporation.
4 *
5 * This software and the related documents are Intel copyrighted materials, and
6 * your use of them is governed by the express license under which they were
7 * provided to you (License). Unless the License provides otherwise, you may not
8 * use, modify, copy, publish, distribute, disclose or transmit this software or
9 * the related documents without Intel's prior written permission.
10 *
11 * This software and the related documents are provided as is, with no express
12 * or implied warranties, other than those that are expressly stated in the
13 * License.
14 *******************************************************************************/
15 
16 /*
17 //++
18 // Implementation of the kernel function interface.
19 //--
20 */
21 
22 #ifndef __KERNEL_FUNCTION_H__
23 #define __KERNEL_FUNCTION_H__
24 
25 #include "algorithms/algorithm.h"
26 #include "data_management/data/numeric_table.h"
27 #include "algorithms/kernel_function/kernel_function_types.h"
28 
29 namespace daal
30 {
31 namespace algorithms
32 {
33 namespace kernel_function
34 {
35 
36 namespace interface1
37 {
47 class KernelIface : public daal::algorithms::Analysis<batch>
48 {
49 public:
50  typedef algorithms::kernel_function::Input InputType;
51  typedef algorithms::kernel_function::ParameterBase ParameterType;
52  typedef algorithms::kernel_function::Result ResultType;
53 
54  KernelIface()
55  {
56  initialize();
57  }
58 
65  KernelIface(const KernelIface &other)
66  {
67  initialize();
68  }
69 
74  virtual Input * getInput() = 0;
75 
80  virtual ParameterBase * getParameter() = 0;
81 
82  virtual ~KernelIface() {}
83 
88  ResultPtr getResult()
89  {
90  return _result;
91  }
92 
97  services::Status setResult(const ResultPtr& res)
98  {
99  DAAL_CHECK(res, services::ErrorNullResult)
100  _result = res;
101  _res = _result.get();
102  return services::Status();
103  }
104 
110  services::SharedPtr<KernelIface> clone() const
111  {
112  return services::SharedPtr<KernelIface>(cloneImpl());
113  }
114 
115 protected:
116  void initialize()
117  {
118  _result = ResultPtr(new kernel_function::Result());
119  }
120  virtual KernelIface * cloneImpl() const DAAL_C11_OVERRIDE = 0;
121  ResultPtr _result;
122 };
123 typedef services::SharedPtr<KernelIface> KernelIfacePtr;
125 } // namespace interface1
126 using interface1::KernelIface;
127 using interface1::KernelIfacePtr;
128 
129 } // namespace kernel_function
130 } // namespace algorithm
131 } // namespace daal
132 #endif
daal
Definition: algorithm_base_common.h:31
daal::algorithms::kernel_function::interface1::ParameterBase
Optional input objects for the kernel function algorithm.
Definition: kernel_function_types.h:86
daal::algorithms::kernel_function::interface1::KernelIface::getInput
virtual Input * getInput()=0
daal::algorithms::kernel_function::interface1::KernelIface
Abstract class that specifies the interface of the algorithms for computing kernel functions in the b...
Definition: kernel_function.h:47
daal::algorithms::kernel_function::interface1::KernelIface::getParameter
virtual ParameterBase * getParameter()=0
daal::algorithms::kernel_function::interface1::KernelIface::clone
services::SharedPtr< KernelIface > clone() const
Definition: kernel_function.h:110
daal::algorithms::kernel_function::interface1::KernelIface::setResult
services::Status setResult(const ResultPtr &res)
Definition: kernel_function.h:97
daal::algorithms::Analysis
Provides methods for execution of operations over data, such as computation of Summary Statistics est...
Definition: analysis.h:68
daal::algorithms::kernel_function::interface1::Input
Input objects for the kernel function algorithm
Definition: kernel_function_types.h:101
daal::services::ErrorNullResult
Definition: error_indexes.h:96
daal::algorithms::kernel_function::interface1::KernelIface::KernelIface
KernelIface(const KernelIface &other)
Definition: kernel_function.h:65
daal::algorithms::kernel_function::interface1::KernelIface::getResult
ResultPtr getResult()
Definition: kernel_function.h:88

For more complete information about compiler optimizations, see our Optimization Notice.