C++ API Reference for Intel® Data Analytics Acceleration Library 2019 Update 4

kernel_function_rbf.h
1 /* file: kernel_function_rbf.h */
2 /*******************************************************************************
3 * Copyright 2014-2019 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 interface for the radial basis function (RBF) kernel algorithm
19 //--
20 */
21 
22 #ifndef __KERNEL_FUNCTION_RBF_H__
23 #define __KERNEL_FUNCTION_RBF_H__
24 
25 #include "algorithms/algorithm.h"
26 #include "data_management/data/numeric_table.h"
27 #include "algorithms/kernel_function/kernel_function_types_rbf.h"
28 #include "algorithms/kernel_function/kernel_function.h"
29 
30 namespace daal
31 {
32 namespace algorithms
33 {
34 namespace kernel_function
35 {
36 namespace rbf
37 {
38 
39 namespace interface1
40 {
55 template<typename algorithmFPType, Method method, CpuType cpu>
56 class DAAL_EXPORT BatchContainer : public daal::algorithms::AnalysisContainerIface<batch>
57 {
58 public:
64  BatchContainer(daal::services::Environment::env *daalEnv);
66  ~BatchContainer();
70  virtual services::Status compute() DAAL_C11_OVERRIDE;
71 };
72 
89 template<typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
90 class DAAL_EXPORT Batch : public KernelIface
91 {
92 public:
93  typedef KernelIface super;
94 
95  typedef algorithms::kernel_function::rbf::Input InputType;
96  typedef algorithms::kernel_function::rbf::Parameter ParameterType;
97  typedef typename super::ResultType ResultType;
98 
99  ParameterType parameter;
100  InputType input;
103  Batch()
104  {
105  initialize();
106  }
107 
114  Batch(const Batch<algorithmFPType, method> &other) : KernelIface(other), parameter(other.parameter), input(other.input)
115  {
116  initialize();
117  }
118 
123  virtual int getMethod() const DAAL_C11_OVERRIDE { return(int) method; }
124 
129  virtual InputType * getInput() DAAL_C11_OVERRIDE { return &input; }
130 
135  virtual ParameterBase * getParameter() DAAL_C11_OVERRIDE { return &parameter; }
136 
142  services::SharedPtr<Batch<algorithmFPType, method> > clone() const
143  {
144  return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
145  }
146 
147 protected:
148  void initialize()
149  {
150  Analysis<batch>::_ac = new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
151  _in = &input;
152  _par = &parameter;
153  }
154  virtual Batch<algorithmFPType, method> * cloneImpl() const DAAL_C11_OVERRIDE
155  {
156  return new Batch<algorithmFPType, method>(*this);
157  }
158 
159  virtual services::Status allocateResult() DAAL_C11_OVERRIDE
160  {
161  services::Status s = _result->allocate<algorithmFPType>(&input, &parameter, (int) method);
162  _res = _result.get();
163  return s;
164  }
165 };
167 } // namespace interface1
168 using interface1::BatchContainer;
169 using interface1::Batch;
170 
171 } // rbf
172 } // namespace kernel_function
173 } // namespace algorithm
174 } // namespace daal
175 #endif
daal::algorithms::kernel_function::rbf::interface1::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: kernel_function_rbf.h:123
daal::algorithms::kernel_function::rbf::interface1::Batch::Batch
Batch(const Batch< algorithmFPType, method > &other)
Definition: kernel_function_rbf.h:114
daal::algorithms::kernel_function::rbf::interface1::Batch::input
InputType input
Definition: kernel_function_rbf.h:100
daal
Definition: algorithm_base_common.h:31
daal::algorithms::AnalysisContainerIface
Abstract interface class that provides virtual methods to access and run implementations of the analy...
Definition: analysis.h:53
daal::algorithms::kernel_function::rbf::interface1::Batch
Computes the RBF kernel function in the batch processing mode.
Definition: kernel_function_rbf.h:90
daal::algorithms::kernel_function::rbf::interface1::Batch::parameter
ParameterType parameter
Definition: kernel_function_rbf.h:99
daal::batch
Definition: daal_defines.h:110
daal::algorithms::kernel_function::rbf::interface1::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: kernel_function_rbf.h:142
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::rbf::interface1::Batch::getInput
virtual InputType * getInput() DAAL_C11_OVERRIDE
Definition: kernel_function_rbf.h:129
daal::algorithms::kernel_function::rbf::interface1::Batch::getParameter
virtual ParameterBase * getParameter() DAAL_C11_OVERRIDE
Definition: kernel_function_rbf.h:135
daal::algorithms::kernel_function::rbf::interface1::BatchContainer
Provides methods to run implementations of the RBF kernel algorithm. This class is associated with th...
Definition: kernel_function_rbf.h:56
daal::algorithms::kernel_function::rbf::interface1::Batch::Batch
Batch()
Definition: kernel_function_rbf.h:103

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