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

kernel_function.h
1 /* file: kernel_function.h */
2 /*******************************************************************************
3 * Copyright 2014-2017 Intel Corporation
4 * All Rights Reserved.
5 *
6 * If this software was obtained under the Intel Simplified Software License,
7 * the following terms apply:
8 *
9 * The source code, information and material ("Material") contained herein is
10 * owned by Intel Corporation or its suppliers or licensors, and title to such
11 * Material remains with Intel Corporation or its suppliers or licensors. The
12 * Material contains proprietary information of Intel or its suppliers and
13 * licensors. The Material is protected by worldwide copyright laws and treaty
14 * provisions. No part of the Material may be used, copied, reproduced,
15 * modified, published, uploaded, posted, transmitted, distributed or disclosed
16 * in any way without Intel's prior express written permission. No license under
17 * any patent, copyright or other intellectual property rights in the Material
18 * is granted to or conferred upon you, either expressly, by implication,
19 * inducement, estoppel or otherwise. Any license under such intellectual
20 * property rights must be express and approved by Intel in writing.
21 *
22 * Unless otherwise agreed by Intel in writing, you may not remove or alter this
23 * notice or any other notice embedded in Materials by Intel or Intel's
24 * suppliers or licensors in any way.
25 *
26 *
27 * If this software was obtained under the Apache License, Version 2.0 (the
28 * "License"), the following terms apply:
29 *
30 * You may not use this file except in compliance with the License. You may
31 * obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
32 *
33 *
34 * Unless required by applicable law or agreed to in writing, software
35 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
36 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
37 *
38 * See the License for the specific language governing permissions and
39 * limitations under the License.
40 *******************************************************************************/
41 
42 /*
43 //++
44 // Implementation of the kernel function interface.
45 //--
46 */
47 
48 #ifndef __KERNEL_FUNCTION_H__
49 #define __KERNEL_FUNCTION_H__
50 
51 #include "algorithms/algorithm.h"
52 #include "data_management/data/numeric_table.h"
53 #include "algorithms/kernel_function/kernel_function_types.h"
54 
55 namespace daal
56 {
57 namespace algorithms
58 {
59 namespace kernel_function
60 {
61 
62 namespace interface1
63 {
73 class KernelIface : public daal::algorithms::Analysis<batch>
74 {
75 public:
76  KernelIface()
77  {
78  initialize();
79  }
80 
87  KernelIface(const KernelIface &other)
88  {
89  initialize();
90  }
91 
96  virtual Input * getInput() = 0;
97 
102  virtual ParameterBase * getParameter() = 0;
103 
104  virtual ~KernelIface() {}
105 
110  ResultPtr getResult()
111  {
112  return _result;
113  }
114 
119  services::Status setResult(const ResultPtr& res)
120  {
121  DAAL_CHECK(res, services::ErrorNullResult)
122  _result = res;
123  _res = _result.get();
124  return services::Status();
125  }
126 
132  services::SharedPtr<KernelIface> clone() const
133  {
134  return services::SharedPtr<KernelIface>(cloneImpl());
135  }
136 
137 protected:
138  void initialize()
139  {
140  _result = ResultPtr(new kernel_function::Result());
141  }
142  virtual KernelIface * cloneImpl() const DAAL_C11_OVERRIDE = 0;
143  ResultPtr _result;
144 };
145 typedef services::SharedPtr<KernelIface> KernelIfacePtr;
147 } // namespace interface1
148 using interface1::KernelIface;
149 using interface1::KernelIfacePtr;
150 
151 } // namespace kernel_function
152 } // namespace algorithm
153 } // namespace daal
154 #endif
daal
Definition: algorithm_base_common.h:57
daal::algorithms::kernel_function::interface1::ParameterBase
Optional input objects for the kernel function algorithm.
Definition: kernel_function_types.h:112
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:73
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:132
daal::algorithms::kernel_function::interface1::KernelIface::setResult
services::Status setResult(const ResultPtr &res)
Definition: kernel_function.h:119
daal::algorithms::Analysis
Provides methods for execution of operations over data, such as computation of Summary Statistics est...
Definition: analysis.h:94
daal::algorithms::kernel_function::interface1::Input
Input objects for the kernel function algorithm
Definition: kernel_function_types.h:127
daal::services::ErrorNullResult
Definition: error_indexes.h:122
daal::algorithms::kernel_function::interface1::KernelIface::KernelIface
KernelIface(const KernelIface &other)
Definition: kernel_function.h:87
daal::algorithms::kernel_function::interface1::KernelIface::getResult
ResultPtr getResult()
Definition: kernel_function.h:110

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