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

kernel_function_rbf.h
1 /* file: kernel_function_rbf.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 interface for the radial basis function (RBF) kernel algorithm
21 //--
22 */
23 
24 #ifndef __KERNEL_FUNCTION_RBF_H__
25 #define __KERNEL_FUNCTION_RBF_H__
26 
27 #include "algorithms/algorithm.h"
28 #include "data_management/data/numeric_table.h"
29 #include "algorithms/kernel_function/kernel_function_types_rbf.h"
30 #include "algorithms/kernel_function/kernel_function.h"
31 
32 namespace daal
33 {
34 namespace algorithms
35 {
36 namespace kernel_function
37 {
38 namespace rbf
39 {
40 
41 namespace interface1
42 {
57 template<typename algorithmFPType, Method method, CpuType cpu>
58 class BatchContainer : public daal::algorithms::AnalysisContainerIface<batch>
59 {
60 public:
66  BatchContainer(daal::services::Environment::env *daalEnv);
68  ~BatchContainer();
72  virtual services::Status compute() DAAL_C11_OVERRIDE;
73 };
74 
91 template<typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
92 class DAAL_EXPORT Batch : public KernelIface
93 {
94 public:
95  typedef KernelIface super;
96 
97  typedef algorithms::kernel_function::rbf::Input InputType;
98  typedef algorithms::kernel_function::rbf::Parameter ParameterType;
99  typedef typename super::ResultType ResultType;
100 
101  ParameterType parameter;
102  InputType input;
105  Batch()
106  {
107  initialize();
108  }
109 
116  Batch(const Batch<algorithmFPType, method> &other) : KernelIface(other), parameter(other.parameter), input(other.input)
117  {
118  initialize();
119  }
120 
125  virtual int getMethod() const DAAL_C11_OVERRIDE { return(int) method; }
126 
131  virtual InputType * getInput() DAAL_C11_OVERRIDE { return &input; }
132 
137  virtual ParameterBase * getParameter() DAAL_C11_OVERRIDE { return &parameter; }
138 
144  services::SharedPtr<Batch<algorithmFPType, method> > clone() const
145  {
146  return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
147  }
148 
149 protected:
150  void initialize()
151  {
152  Analysis<batch>::_ac = new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
153  _in = &input;
154  _par = &parameter;
155  }
156  virtual Batch<algorithmFPType, method> * cloneImpl() const DAAL_C11_OVERRIDE
157  {
158  return new Batch<algorithmFPType, method>(*this);
159  }
160 
161  virtual services::Status allocateResult() DAAL_C11_OVERRIDE
162  {
163  services::Status s = _result->allocate<algorithmFPType>(&input, &parameter, (int) method);
164  _res = _result.get();
165  return s;
166  }
167 };
169 } // namespace interface1
170 using interface1::BatchContainer;
171 using interface1::Batch;
172 
173 } // rbf
174 } // namespace kernel_function
175 } // namespace algorithm
176 } // namespace daal
177 #endif
daal::algorithms::kernel_function::rbf::interface1::Batch::getParameter
virtual ParameterBase * getParameter() DAAL_C11_OVERRIDE
Definition: kernel_function_rbf.h:137
daal::batch
Definition: daal_defines.h:112
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:58
daal::algorithms::kernel_function::rbf::interface1::BatchContainer::compute
virtual services::Status compute() DAAL_C11_OVERRIDE
daal::algorithms::kernel_function::rbf::interface1::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: kernel_function_rbf.h:125
daal::algorithms::kernel_function::rbf::interface1::Batch::input
InputType input
Definition: kernel_function_rbf.h:102
daal::algorithms::AnalysisContainerIface
Abstract interface class that provides virtual methods to access and run implementations of the analy...
Definition: analysis.h:55
daal::algorithms::kernel_function::rbf::interface1::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: kernel_function_rbf.h:144
daal::algorithms::kernel_function::rbf::interface1::Batch::getInput
virtual InputType * getInput() DAAL_C11_OVERRIDE
Definition: kernel_function_rbf.h:131
daal::algorithms::kernel_function::rbf::interface1::Batch::Batch
Batch()
Definition: kernel_function_rbf.h:105
daal::algorithms::kernel_function::rbf::interface1::BatchContainer::~BatchContainer
~BatchContainer()
daal::algorithms::kernel_function::rbf::interface1::Batch::parameter
ParameterType parameter
Definition: kernel_function_rbf.h:101
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::rbf::interface1::Batch::Batch
Batch(const Batch< algorithmFPType, method > &other)
Definition: kernel_function_rbf.h:116
daal::algorithms::kernel_function::rbf::interface1::Batch
Computes the RBF kernel function in the batch processing mode.
Definition: kernel_function_rbf.h:92
daal::algorithms::kernel_function::rbf::interface1::BatchContainer::BatchContainer
BatchContainer(daal::services::Environment::env *daalEnv)

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