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

minmax.h
1 /* file: minmax.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 min-max normalization algorithm
19 // in the batch processing mode
20 //--
21 */
22 
23 #ifndef __MINMAX_BATCH_H__
24 #define __MINMAX_BATCH_H__
25 
26 #include "algorithms/algorithm.h"
27 #include "data_management/data/numeric_table.h"
28 #include "services/daal_defines.h"
29 #include "algorithms/normalization/minmax_types.h"
30 
31 namespace daal
32 {
33 namespace algorithms
34 {
35 namespace normalization
36 {
37 namespace minmax
38 {
39 
40 namespace interface1
41 {
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);
65 
66  virtual ~BatchContainer();
67 
73  virtual services::Status compute() DAAL_C11_OVERRIDE;
74 };
75 
89 template<typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
90 class DAAL_EXPORT Batch : public daal::algorithms::Analysis<batch>
91 {
92 public:
93  typedef algorithms::normalization::minmax::Input InputType;
94  typedef algorithms::normalization::minmax::Parameter<algorithmFPType> ParameterType;
95  typedef algorithms::normalization::minmax::Result ResultType;
96 
97  InputType input;
98  Parameter<algorithmFPType> parameter;
101  Batch()
102  {
103  initialize();
104  }
105 
111  Batch(const Batch<algorithmFPType, method> &other) : input(other.input), parameter(other.parameter)
112  {
113  initialize();
114  }
115 
116  virtual ~Batch() {}
117 
122  virtual int getMethod() const DAAL_C11_OVERRIDE { return(int)method; }
123 
128  ResultPtr getResult()
129  {
130  return _result;
131  }
132 
139  services::Status setResult(const ResultPtr &result)
140  {
141  DAAL_CHECK(result, services::ErrorNullResult)
142  _result = result;
143  _res = _result.get();
144  return services::Status();
145  }
146 
152  services::SharedPtr<Batch<algorithmFPType, method> > clone() const
153  {
154  return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
155  }
156 
157 protected:
158  virtual Batch<algorithmFPType, method> *cloneImpl() const DAAL_C11_OVERRIDE
159  {
160  return new Batch<algorithmFPType, method>(*this);
161  }
162 
163  virtual services::Status allocateResult() DAAL_C11_OVERRIDE
164  {
165  services::Status s = _result->allocate<algorithmFPType>(&input, method);
166  _res = _result.get();
167  return s;
168  }
169 
170  void initialize()
171  {
172  Analysis<batch>::_ac = new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
173  _in = &input;
174  _par = &parameter;
175  _result.reset(new ResultType());
176  }
177 
178  ResultPtr _result;
179 
180 };
182 } // namespace interface1
183 using interface1::BatchContainer;
184 using interface1::Batch;
185 
186 } // namespace minmax
187 } // namespace normalization
188 } // namespace algorithms
189 } // namespace daal
190 #endif
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::normalization::minmax::interface1::Parameter
Class that specifies the parameters of the algorithm in the batch computing mode. ...
Definition: minmax_types.h:123
daal_defines.h
daal::algorithms::normalization::minmax::interface1::Batch::parameter
Parameter< algorithmFPType > parameter
Definition: minmax.h:98
daal::batch
Definition: daal_defines.h:110
daal::algorithms::normalization::minmax::interface1::Batch::input
InputType input
Definition: minmax.h:97
daal::algorithms::normalization::minmax::interface1::Batch::setResult
services::Status setResult(const ResultPtr &result)
Definition: minmax.h:139
daal::algorithms::normalization::minmax::interface1::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: minmax.h:152
daal::algorithms::normalization::minmax::interface1::BatchContainer
Provides methods to run implementations of the min-max normalization algorithm. It is associated with...
Definition: minmax.h:56
daal::algorithms::normalization::minmax::interface1::Batch::Batch
Batch(const Batch< algorithmFPType, method > &other)
Definition: minmax.h:111
daal::algorithms::Analysis
Provides methods for execution of operations over data, such as computation of Summary Statistics est...
Definition: analysis.h:68
daal::algorithms::normalization::minmax::interface1::Batch::Batch
Batch()
Definition: minmax.h:101
daal::algorithms::normalization::minmax::interface1::Batch::getResult
ResultPtr getResult()
Definition: minmax.h:128
daal::algorithms::normalization::minmax::interface1::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: minmax.h:122
daal::algorithms::normalization::minmax::interface1::Batch
Normalizes datasets in the batch processing mode.
Definition: minmax.h:90
daal::services::ErrorNullResult
Definition: error_indexes.h:96

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