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

zscore_types.h
1 /* file: zscore_types.h */
2 /*******************************************************************************
3 * Copyright 2014-2018 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 // Definition of common types of z-score normalization.
19 //--
20 */
21 
22 #ifndef __ZSCORE_TYPES_H__
23 #define __ZSCORE_TYPES_H__
24 
25 #include "algorithms/algorithm.h"
26 #include "data_management/data/numeric_table.h"
27 #include "data_management/data/homogen_numeric_table.h"
28 #include "algorithms/moments/low_order_moments_batch.h"
29 #include "services/daal_defines.h"
30 
31 namespace daal
32 {
33 namespace algorithms
34 {
44 namespace normalization
45 {
55 namespace zscore
56 {
62 enum Method
63 {
64  defaultDense = 0,
65  sumDense = 1,
67 };
68 
74 enum InputId
75 {
76  data,
77  lastInputId = data
78 };
79 
80 
86 enum ResultId
87 {
88  normalizedData,
89  means,
90  variances,
91  lastResultId = variances
92 };
93 
94 
100 enum ResultToComputeId
101 {
102  none = 0x00000000ULL,
103  mean = 0x00000001ULL,
104  variance = 0x00000002ULL
105 };
106 
107 
111 namespace interface1
112 {
113 
118 class DAAL_EXPORT Input : public daal::algorithms::Input
119 {
120 public:
122  Input();
123 
125  Input(const Input& other);
126 
127  virtual ~Input() {}
128 
134  data_management::NumericTablePtr get(InputId id) const;
135 
141  void set(InputId id, const data_management::NumericTablePtr &ptr);
142 
150  services::Status check(const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
151 };
152 
155 } // namespace interface1
156 
157 
161 namespace interface2
162 {
163 
168 template<typename algorithmFPType, Method method>
169 class DAAL_EXPORT Parameter {};
170 
175 class DAAL_EXPORT BaseParameter : public daal::algorithms::Parameter
176 {
177 public:
178  BaseParameter();
179  DAAL_UINT64 resultsToCompute;
180 };
181 
182 // /**
183 // * <a name="DAAL-CLASS-ALGORITHMS__NORMALIZATION__ZSCORE__PARAMETER"></a>
184 // * \brief Class that specifies the parameters of the default algorithm in the batch computing mode
185 // */
186 template<typename algorithmFPType>
187 class DAAL_EXPORT Parameter<algorithmFPType, sumDense> : public BaseParameter
188 {
189 public:
190  Parameter();
191 };
192 
193 // /**
194 // * <a name="DAAL-CLASS-ALGORITHMS__NORMALIZATION__ZSCORE__PARAMETER"></a>
195 // * \brief Class that specifies the parameters of the default algorithm in the batch computing mode
196 // */
197 template<typename algorithmFPType>
198 class DAAL_EXPORT Parameter<algorithmFPType, defaultDense> : public BaseParameter
199 {
200 public:
202  Parameter(const services::SharedPtr<low_order_moments::BatchImpl> &momentsForParameter =
203  services::SharedPtr<low_order_moments::Batch<algorithmFPType, low_order_moments::defaultDense> >
204  (new low_order_moments::Batch<algorithmFPType, low_order_moments::defaultDense>()));
205 
206  services::SharedPtr<low_order_moments::BatchImpl> moments;
213  virtual services::Status check() const DAAL_C11_OVERRIDE;
214 };
215 
221 class DAAL_EXPORT Result : public daal::algorithms::Result
222 {
223 public:
224  DECLARE_SERIALIZABLE_CAST(Result);
225  Result(const Result& o);
226  Result();
227 
228  virtual ~Result() {};
229 
238  template <typename algorithmFPType>
239  DAAL_EXPORT services::Status allocate(const daal::algorithms::Input *input, const daal::algorithms::Parameter *parameter, const int method);
240 
241 
249  template <typename algorithmFPType>
250  DAAL_EXPORT services::Status allocate(const daal::algorithms::Input *input, const int method);
251 
252 
253 
259  data_management::NumericTablePtr get(ResultId id) const;
260 
266  void set(ResultId id, const data_management::NumericTablePtr &value);
267 
276  services::Status check(const daal::algorithms::Input *in, const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
277 
278 protected:
280  template<typename Archive, bool onDeserialize>
281  services::Status serialImpl(Archive *arch)
282  {
283  return daal::algorithms::Result::serialImpl<Archive, onDeserialize>(arch);
284  }
285 };
286 typedef services::SharedPtr<Result> ResultPtr;
287 
290 } // namespace interface1
291 
292 
293 using interface1::Input;
294 using interface2::Parameter;
295 using interface2::BaseParameter;
296 using interface2::Result;
297 using interface2::ResultPtr;
298 
299 } // namespace zscore
300 } // namespace normalization
301 } // namespace algorithms
302 } // namespace daal
303 #endif
daal::algorithms::normalization::zscore::interface2::BaseParameter
Class that specifies the base parameters of the algorithm in the batch computing mode.
Definition: zscore_types.h:175
daal
Definition: algorithm_base_common.h:31
daal::algorithms::normalization::zscore::interface1::Input
Input objects for the z-score normalization algorithm
Definition: zscore_types.h:118
daal::algorithms::normalization::zscore::interface2::Parameter< algorithmFPType, defaultDense >::moments
services::SharedPtr< low_order_moments::BatchImpl > moments
Definition: zscore_types.h:206
daal::algorithms::normalization::zscore::defaultDense
Definition: zscore_types.h:64
daal::algorithms::normalization::zscore::Method
Method
Definition: zscore_types.h:62
daal::algorithms::normalization::zscore::sumDense
Definition: zscore_types.h:65
daal::algorithms::normalization::zscore::variances
Definition: zscore_types.h:90
daal_defines.h
daal::algorithms::normalization::zscore::data
Definition: zscore_types.h:76
daal::algorithms::normalization::zscore::variance
Definition: zscore_types.h:104
daal::algorithms::normalization::zscore::interface2::Parameter
Class that specifies the parameters of the algorithm in the batch computing mode. ...
Definition: zscore_types.h:169
daal::algorithms::normalization::zscore::InputId
InputId
Definition: zscore_types.h:74
daal::algorithms::normalization::zscore::interface2::Result
Provides methods to access final results obtained with the compute() method of the z-score normalizat...
Definition: zscore_types.h:221
daal::algorithms::normalization::zscore::means
Definition: zscore_types.h:89
daal::algorithms::normalization::zscore::ResultToComputeId
ResultToComputeId
Definition: zscore_types.h:100
daal::algorithms::math::abs::value
Definition: abs_types.h:86
daal::algorithms::normalization::zscore::ResultId
ResultId
Definition: zscore_types.h:86
daal::algorithms::normalization::zscore::mean
Definition: zscore_types.h:103
daal::algorithms::normalization::zscore::normalizedData
Definition: zscore_types.h:88
daal::algorithms::normalization::zscore::interface2::BaseParameter::resultsToCompute
DAAL_UINT64 resultsToCompute
Definition: zscore_types.h:179

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