C++ API Reference for Intel® Data Analytics Acceleration Library 2020 Update 1

kernel_function.h
1 /* file: kernel_function.h */
2 /*******************************************************************************
3 * Copyright 2014-2020 Intel Corporation
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *******************************************************************************/
17 
18 /*
19 //++
20 // Implementation of the kernel function interface.
21 //--
22 */
23 
24 #ifndef __KERNEL_FUNCTION_H__
25 #define __KERNEL_FUNCTION_H__
26 
27 #include "algorithms/algorithm.h"
28 #include "data_management/data/numeric_table.h"
29 #include "algorithms/kernel_function/kernel_function_types.h"
30 
31 namespace daal
32 {
33 namespace algorithms
34 {
35 namespace kernel_function
36 {
37 
38 namespace interface1
39 {
49 class KernelIface : public daal::algorithms::Analysis<batch>
50 {
51 public:
52  typedef algorithms::kernel_function::Input InputType;
53  typedef algorithms::kernel_function::ParameterBase ParameterType;
54  typedef algorithms::kernel_function::Result ResultType;
55 
56  KernelIface()
57  {
58  initialize();
59  }
60 
67  KernelIface(const KernelIface &other)
68  {
69  initialize();
70  }
71 
76  virtual Input * getInput() = 0;
77 
82  virtual ParameterBase * getParameter() = 0;
83 
84  virtual ~KernelIface() {}
85 
90  ResultPtr getResult()
91  {
92  return _result;
93  }
94 
99  services::Status setResult(const ResultPtr& res)
100  {
101  DAAL_CHECK(res, services::ErrorNullResult)
102  _result = res;
103  _res = _result.get();
104  return services::Status();
105  }
106 
112  services::SharedPtr<KernelIface> clone() const
113  {
114  return services::SharedPtr<KernelIface>(cloneImpl());
115  }
116 
117 protected:
118  void initialize()
119  {
120  _result = ResultPtr(new kernel_function::Result());
121  }
122  virtual KernelIface * cloneImpl() const DAAL_C11_OVERRIDE = 0;
123  ResultPtr _result;
124 };
125 typedef services::SharedPtr<KernelIface> KernelIfacePtr;
127 } // namespace interface1
128 using interface1::KernelIface;
129 using interface1::KernelIfacePtr;
130 
131 } // namespace kernel_function
132 } // namespace algorithm
133 } // namespace daal
134 #endif
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:49
daal::algorithms::kernel_function::interface1::KernelIface::getResult
ResultPtr getResult()
Definition: kernel_function.h:90
daal::services::ErrorNullResult
Definition: error_indexes.h:98
daal::algorithms::kernel_function::interface1::KernelIface::KernelIface
KernelIface(const KernelIface &other)
Definition: kernel_function.h:67
daal::algorithms::kernel_function::interface1::KernelIface::getInput
virtual Input * getInput()=0
daal::algorithms::kernel_function::interface1::Input
Input objects for the kernel function algorithm
Definition: kernel_function_types.h:103
daal::algorithms::kernel_function::interface1::ParameterBase
Optional input objects for the kernel function algorithm.
Definition: kernel_function_types.h:88
daal::algorithms::Analysis
Provides methods for execution of operations over data, such as computation of Summary Statistics est...
Definition: analysis.h:70
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:112
daal::algorithms::kernel_function::interface1::KernelIface::setResult
services::Status setResult(const ResultPtr &res)
Definition: kernel_function.h:99

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