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

low_order_moments_types.h
1 /* file: low_order_moments_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 LowOrderMoments common types.
19 //--
20 */
21 
22 #ifndef __LOW_ORDER_MOMENTS_TYPES_H__
23 #define __LOW_ORDER_MOMENTS_TYPES_H__
24 
25 #include "data_management/data/homogen_numeric_table.h"
26 
27 namespace daal
28 {
29 namespace algorithms
30 {
40 namespace low_order_moments
41 {
46 enum Method
47 {
48  defaultDense = 0,
49  singlePassDense = 1,
51  sumDense = 2,
53  fastCSR = 3,
54  singlePassCSR = 4,
56  sumCSR = 5
58 };
59 
64 enum EstimatesToCompute
65 {
66  estimatesAll,
67  estimatesMinMax,
68  estimatesMeanVariance
69 };
70 
75 enum InputId
76 {
77  data,
78  lastInputId = data
79 };
80 
85 enum ResultId
86 {
87  minimum,
88  maximum,
89  sum,
90  sumSquares,
91  sumSquaresCentered,
92  mean,
93  secondOrderRawMoment,
94  variance,
95  standardDeviation,
96  variation,
97  lastResultId = variation
98 };
99 
104 enum PartialResultId
105 {
106  nObservations,
107  partialMinimum,
108  partialMaximum,
109  partialSum,
110  partialSumSquares,
111  partialSumSquaresCentered,
112  lastPartialResultId = partialSumSquaresCentered
113 };
114 
119 enum MasterInputId
120 {
121  partialResults,
122  lastMasterInputId = partialResults
123 };
124 
128 namespace interface1
129 {
134 class InputIface : public daal::algorithms::Input
135 {
136 public:
137  InputIface(size_t nElements) : daal::algorithms::Input(nElements) {}
138  InputIface(const InputIface& other) : daal::algorithms::Input(other){}
139  virtual services::Status getNumberOfColumns(size_t& nCols) const = 0;
140  virtual ~InputIface() {}
141 };
142 
147 class DAAL_EXPORT Input : public InputIface
148 {
149 public:
150  Input();
151  Input(const Input& other);
152 
153  virtual ~Input() {};
154 
160  services::Status getNumberOfColumns(size_t& nCols) const DAAL_C11_OVERRIDE;
161 
167  data_management::NumericTablePtr get(InputId id) const;
168 
174  void set(InputId id, const data_management::NumericTablePtr &ptr);
175 
176  services::Status check(const daal::algorithms::Parameter *parameter, int method) const DAAL_C11_OVERRIDE;
177 };
178 
185 class DAAL_EXPORT PartialResult : public daal::algorithms::PartialResult
186 {
187 public:
188 
189  DECLARE_SERIALIZABLE_CAST(PartialResult);
190  PartialResult();
191 
192  virtual ~PartialResult()
193  {}
194 
201  template <typename algorithmFPType>
202  DAAL_EXPORT services::Status allocate(const daal::algorithms::Input *input, const daal::algorithms::Parameter *parameter, const int method);
203 
211  template <typename algorithmFPType>
212  DAAL_EXPORT services::Status initialize(const daal::algorithms::Input *input, const daal::algorithms::Parameter *parameter, const int method);
213 
219  services::Status getNumberOfColumns(size_t& nCols) const;
220 
226  data_management::NumericTablePtr get(PartialResultId id) const;
227 
233  void set(PartialResultId id, const data_management::NumericTablePtr &ptr);
234 
240  services::Status check(const daal::algorithms::Parameter *parameter, int method) const DAAL_C11_OVERRIDE;
241 
248  services::Status check(const daal::algorithms::Input *input, const daal::algorithms::Parameter *parameter, int method) const DAAL_C11_OVERRIDE;
249 
250 protected:
252  template<typename Archive, bool onDeserialize>
253  services::Status serialImpl(Archive *arch)
254  {
255  return daal::algorithms::PartialResult::serialImpl<Archive, onDeserialize>(arch);
256  }
257 
258  services::Status checkImpl(size_t nFeatures) const;
259 };
260 
261 typedef services::SharedPtr<PartialResult> PartialResultPtr;
262 
267 struct DAAL_EXPORT Parameter : public daal::algorithms::Parameter
268 {
270  Parameter(EstimatesToCompute _estimatesToCompute = estimatesAll);
271 
272  EstimatesToCompute estimatesToCompute;
274  services::Status check() const DAAL_C11_OVERRIDE;
275 };
276 
282 class DAAL_EXPORT Result : public daal::algorithms::Result
283 {
284 public:
285  DECLARE_SERIALIZABLE_CAST(Result);
286  Result();
287 
288  virtual ~Result() {};
289 
296  template <typename algorithmFPType>
297  DAAL_EXPORT services::Status allocate(const daal::algorithms::Input *input, const daal::algorithms::Parameter *parameter, const int method);
298 
305  template <typename algorithmFPType>
306  DAAL_EXPORT services::Status allocate(const daal::algorithms::PartialResult *partialResult, daal::algorithms::Parameter *parameter, const int method);
307 
313  data_management::NumericTablePtr get(ResultId id) const;
314 
320  void set(ResultId id, const data_management::NumericTablePtr &value);
321 
328  services::Status check(const daal::algorithms::PartialResult *partialResult, const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
329 
336  services::Status check(const daal::algorithms::Input *input, const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
337 
338 protected:
340  template<typename Archive, bool onDeserialize>
341  services::Status serialImpl(Archive *arch)
342  {
343  return daal::algorithms::Result::serialImpl<Archive, onDeserialize>(arch);
344  }
345 
346  services::Status checkImpl(size_t nFeatures) const;
347 };
348 typedef services::SharedPtr<Result> ResultPtr;
349 
356 template<ComputeStep step>
357 class DAAL_EXPORT DistributedInput : public InputIface
358 {
359 public:
360  DistributedInput();
361  DistributedInput(const DistributedInput& other);
362 
363  virtual ~DistributedInput() {}
364 
370  services::Status getNumberOfColumns(size_t& nCols) const DAAL_C11_OVERRIDE;
371 
377  void add(MasterInputId id, const PartialResultPtr &partialResult);
378 
384  void set(MasterInputId id, const data_management::DataCollectionPtr &ptr);
385 
391  data_management::DataCollectionPtr get(MasterInputId id) const;
392 
398  services::Status check(const daal::algorithms::Parameter *parameter, int method) const DAAL_C11_OVERRIDE;
399 };
401 } // namespace interface1
402 using interface1::InputIface;
403 using interface1::Input;
404 using interface1::PartialResult;
405 using interface1::PartialResultPtr;
406 using interface1::Parameter;
407 using interface1::Result;
408 using interface1::ResultPtr;
409 using interface1::DistributedInput;
410 
411 } // namespace daal::algorithms::low_order_moments
412 }
413 }
414 #endif
daal::algorithms::low_order_moments::partialMaximum
Definition: low_order_moments_types.h:108
daal
Definition: algorithm_base_common.h:31
daal::algorithms::low_order_moments::partialResults
Definition: low_order_moments_types.h:121
daal::algorithms::low_order_moments::partialSumSquaresCentered
Definition: low_order_moments_types.h:111
daal::algorithms::low_order_moments::defaultDense
Definition: low_order_moments_types.h:48
daal::algorithms::low_order_moments::sumCSR
Definition: low_order_moments_types.h:56
daal::algorithms::low_order_moments::interface1::Result
Provides methods to access final results obtained with the compute() method of the low order moments ...
Definition: low_order_moments_types.h:282
daal::algorithms::low_order_moments::sum
Definition: low_order_moments_types.h:89
daal::algorithms::low_order_moments::variance
Definition: low_order_moments_types.h:94
daal::algorithms::low_order_moments::maximum
Definition: low_order_moments_types.h:88
daal::algorithms::low_order_moments::data
Definition: low_order_moments_types.h:77
daal::algorithms::low_order_moments::minimum
Definition: low_order_moments_types.h:87
daal::algorithms::low_order_moments::estimatesMeanVariance
Definition: low_order_moments_types.h:68
daal::algorithms::low_order_moments::InputId
InputId
Definition: low_order_moments_types.h:75
daal::algorithms::low_order_moments::sumSquares
Definition: low_order_moments_types.h:90
daal::algorithms::low_order_moments::partialSum
Definition: low_order_moments_types.h:109
daal::algorithms::low_order_moments::ResultId
ResultId
Definition: low_order_moments_types.h:85
daal::algorithms::low_order_moments::fastCSR
Definition: low_order_moments_types.h:53
daal::algorithms::low_order_moments::interface1::InputIface
Abstract class that specifies interface of the input objects for the low order moments algorithm...
Definition: low_order_moments_types.h:134
daal::algorithms::low_order_moments::mean
Definition: low_order_moments_types.h:92
daal::algorithms::low_order_moments::interface1::Parameter
Low order moments algorithm parameters.
Definition: low_order_moments_types.h:267
daal::algorithms::low_order_moments::estimatesAll
Definition: low_order_moments_types.h:66
daal::algorithms::low_order_moments::EstimatesToCompute
EstimatesToCompute
Definition: low_order_moments_types.h:64
daal::algorithms::low_order_moments::interface1::DistributedInput
Input objects for the low order moments algorithm in the distributed processing mode on master node...
Definition: low_order_moments_types.h:357
daal::algorithms::low_order_moments::nObservations
Definition: low_order_moments_types.h:106
daal::algorithms::low_order_moments::secondOrderRawMoment
Definition: low_order_moments_types.h:93
daal::algorithms::low_order_moments::singlePassCSR
Definition: low_order_moments_types.h:54
daal::algorithms::low_order_moments::interface1::Parameter::estimatesToCompute
EstimatesToCompute estimatesToCompute
Definition: low_order_moments_types.h:272
daal::algorithms::low_order_moments::estimatesMinMax
Definition: low_order_moments_types.h:67
daal::algorithms::math::abs::value
Definition: abs_types.h:86
daal::algorithms::low_order_moments::partialSumSquares
Definition: low_order_moments_types.h:110
daal::algorithms::low_order_moments::standardDeviation
Definition: low_order_moments_types.h:95
daal::algorithms::low_order_moments::variation
Definition: low_order_moments_types.h:96
daal::algorithms::low_order_moments::interface1::Input
Input objects for the low order moments algorithm
Definition: low_order_moments_types.h:147
daal::algorithms::low_order_moments::singlePassDense
Definition: low_order_moments_types.h:49
daal::algorithms::low_order_moments::MasterInputId
MasterInputId
Available identifiers of input objects for the low order moments algorithm on the master node...
Definition: low_order_moments_types.h:119
daal::algorithms::low_order_moments::sumDense
Definition: low_order_moments_types.h:51
daal::algorithms::low_order_moments::Method
Method
Definition: low_order_moments_types.h:46
daal::algorithms::low_order_moments::sumSquaresCentered
Definition: low_order_moments_types.h:91
daal::algorithms::low_order_moments::interface1::PartialResult
Provides methods to access partial results obtained with the compute() method of the low order moment...
Definition: low_order_moments_types.h:185
daal::algorithms::low_order_moments::PartialResultId
PartialResultId
Definition: low_order_moments_types.h:104
daal::algorithms::low_order_moments::partialMinimum
Definition: low_order_moments_types.h:107

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