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

low_order_moments_types.h
1 /* file: low_order_moments_types.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 // Definition of LowOrderMoments common types.
21 //--
22 */
23 
24 #ifndef __LOW_ORDER_MOMENTS_TYPES_H__
25 #define __LOW_ORDER_MOMENTS_TYPES_H__
26 
27 #include "data_management/data/homogen_numeric_table.h"
28 
29 namespace daal
30 {
31 namespace algorithms
32 {
42 namespace low_order_moments
43 {
48 enum Method
49 {
50  defaultDense = 0,
51  singlePassDense = 1,
53  sumDense = 2,
55  fastCSR = 3,
56  singlePassCSR = 4,
58  sumCSR = 5
60 };
61 
66 enum EstimatesToCompute
67 {
68  estimatesAll,
69  estimatesMinMax,
70  estimatesMeanVariance
71 };
72 
77 enum InputId
78 {
79  data,
80  lastInputId = data
81 };
82 
87 enum ResultId
88 {
89  minimum,
90  maximum,
91  sum,
92  sumSquares,
93  sumSquaresCentered,
94  mean,
95  secondOrderRawMoment,
96  variance,
97  standardDeviation,
98  variation,
99  lastResultId = variation
100 };
101 
106 enum PartialResultId
107 {
108  nObservations,
109  partialMinimum,
110  partialMaximum,
111  partialSum,
112  partialSumSquares,
113  partialSumSquaresCentered,
114  lastPartialResultId = partialSumSquaresCentered
115 };
116 
121 enum MasterInputId
122 {
123  partialResults,
124  lastMasterInputId = partialResults
125 };
126 
130 namespace interface1
131 {
136 class InputIface : public daal::algorithms::Input
137 {
138 public:
139  InputIface(size_t nElements) : daal::algorithms::Input(nElements) {}
140  InputIface(const InputIface& other) : daal::algorithms::Input(other){}
141  virtual services::Status getNumberOfColumns(size_t& nCols) const = 0;
142  virtual ~InputIface() {}
143 };
144 
149 class DAAL_EXPORT Input : public InputIface
150 {
151 public:
152  Input();
153  Input(const Input& other);
154 
155  virtual ~Input() {}
156 
162  services::Status getNumberOfColumns(size_t& nCols) const DAAL_C11_OVERRIDE;
163 
169  data_management::NumericTablePtr get(InputId id) const;
170 
176  void set(InputId id, const data_management::NumericTablePtr &ptr);
177 
178  services::Status check(const daal::algorithms::Parameter *parameter, int method) const DAAL_C11_OVERRIDE;
179 };
180 
187 class DAAL_EXPORT PartialResult : public daal::algorithms::PartialResult
188 {
189 public:
190 
191  DECLARE_SERIALIZABLE_CAST(PartialResult);
192  PartialResult();
193 
194  virtual ~PartialResult()
195  {}
196 
203  template <typename algorithmFPType>
204  DAAL_EXPORT services::Status allocate(const daal::algorithms::Input *input, const daal::algorithms::Parameter *parameter, const int method);
205 
213  template <typename algorithmFPType>
214  DAAL_EXPORT services::Status initialize(const daal::algorithms::Input *input, const daal::algorithms::Parameter *parameter, const int method);
215 
221  services::Status getNumberOfColumns(size_t& nCols) const;
222 
228  data_management::NumericTablePtr get(PartialResultId id) const;
229 
235  void set(PartialResultId id, const data_management::NumericTablePtr &ptr);
236 
242  services::Status check(const daal::algorithms::Parameter *parameter, int method) const DAAL_C11_OVERRIDE;
243 
250  services::Status check(const daal::algorithms::Input *input, const daal::algorithms::Parameter *parameter, int method) const DAAL_C11_OVERRIDE;
251 
252 protected:
254  template<typename Archive, bool onDeserialize>
255  services::Status serialImpl(Archive *arch)
256  {
257  return daal::algorithms::PartialResult::serialImpl<Archive, onDeserialize>(arch);
258  }
259 
260  services::Status checkImpl(size_t nFeatures) const;
261 };
262 
263 typedef services::SharedPtr<PartialResult> PartialResultPtr;
264 
269 struct DAAL_EXPORT Parameter : public daal::algorithms::Parameter
270 {
272  Parameter(EstimatesToCompute _estimatesToCompute = estimatesAll);
273 
274  EstimatesToCompute estimatesToCompute;
276  services::Status check() const DAAL_C11_OVERRIDE;
277 };
278 
284 class DAAL_EXPORT Result : public daal::algorithms::Result
285 {
286 public:
287  DECLARE_SERIALIZABLE_CAST(Result);
288  Result();
289 
290  virtual ~Result() {}
291 
298  template <typename algorithmFPType>
299  DAAL_EXPORT services::Status allocate(const daal::algorithms::Input *input, const daal::algorithms::Parameter *parameter, const int method);
300 
307  template <typename algorithmFPType>
308  DAAL_EXPORT services::Status allocate(const daal::algorithms::PartialResult *partialResult, daal::algorithms::Parameter *parameter, const int method);
309 
315  data_management::NumericTablePtr get(ResultId id) const;
316 
322  void set(ResultId id, const data_management::NumericTablePtr &value);
323 
330  services::Status check(const daal::algorithms::PartialResult *partialResult, const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
331 
338  services::Status check(const daal::algorithms::Input *input, const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
339 
340 protected:
342  template<typename Archive, bool onDeserialize>
343  services::Status serialImpl(Archive *arch)
344  {
345  return daal::algorithms::Result::serialImpl<Archive, onDeserialize>(arch);
346  }
347 
348  services::Status checkImpl(size_t nFeatures) const;
349 };
350 typedef services::SharedPtr<Result> ResultPtr;
351 
358 template<ComputeStep step>
359 class DAAL_EXPORT DistributedInput : public InputIface
360 {
361 public:
362  DistributedInput();
363  DistributedInput(const DistributedInput& other);
364 
365  virtual ~DistributedInput() {}
366 
372  services::Status getNumberOfColumns(size_t& nCols) const DAAL_C11_OVERRIDE;
373 
379  void add(MasterInputId id, const PartialResultPtr &partialResult);
380 
386  void set(MasterInputId id, const data_management::DataCollectionPtr &ptr);
387 
393  data_management::DataCollectionPtr get(MasterInputId id) const;
394 
400  services::Status check(const daal::algorithms::Parameter *parameter, int method) const DAAL_C11_OVERRIDE;
401 };
403 } // namespace interface1
404 using interface1::InputIface;
405 using interface1::Input;
406 using interface1::PartialResult;
407 using interface1::PartialResultPtr;
408 using interface1::Parameter;
409 using interface1::Result;
410 using interface1::ResultPtr;
411 using interface1::DistributedInput;
412 
413 } // namespace daal::algorithms::low_order_moments
414 }
415 }
416 #endif
daal::algorithms::low_order_moments::estimatesMeanVariance
Definition: low_order_moments_types.h:70
daal::algorithms::low_order_moments::sum
Definition: low_order_moments_types.h:91
daal::algorithms::low_order_moments::singlePassDense
Definition: low_order_moments_types.h:51
daal::algorithms::low_order_moments::singlePassCSR
Definition: low_order_moments_types.h:56
daal::algorithms::low_order_moments::partialSumSquaresCentered
Definition: low_order_moments_types.h:113
daal::algorithms::low_order_moments::fastCSR
Definition: low_order_moments_types.h:55
daal::algorithms::low_order_moments::mean
Definition: low_order_moments_types.h:94
daal::algorithms::low_order_moments::variation
Definition: low_order_moments_types.h:98
daal::algorithms::low_order_moments::partialSumSquares
Definition: low_order_moments_types.h:112
daal::algorithms::low_order_moments::sumSquares
Definition: low_order_moments_types.h:92
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:187
daal::algorithms::low_order_moments::partialMinimum
Definition: low_order_moments_types.h:109
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:136
daal::algorithms::low_order_moments::data
Definition: low_order_moments_types.h:79
daal::algorithms::low_order_moments::estimatesAll
Definition: low_order_moments_types.h:68
daal::algorithms::low_order_moments::partialSum
Definition: low_order_moments_types.h:111
daal::algorithms::low_order_moments::Method
Method
Definition: low_order_moments_types.h:48
daal::algorithms::low_order_moments::variance
Definition: low_order_moments_types.h:96
daal::algorithms::low_order_moments::partialMaximum
Definition: low_order_moments_types.h:110
daal::algorithms::low_order_moments::standardDeviation
Definition: low_order_moments_types.h:97
daal::algorithms::low_order_moments::sumCSR
Definition: low_order_moments_types.h:58
daal::algorithms::low_order_moments::secondOrderRawMoment
Definition: low_order_moments_types.h:95
daal::algorithms::low_order_moments::interface1::Parameter::estimatesToCompute
EstimatesToCompute estimatesToCompute
Definition: low_order_moments_types.h:274
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:284
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:359
daal::algorithms::low_order_moments::minimum
Definition: low_order_moments_types.h:89
daal::algorithms::low_order_moments::partialResults
Definition: low_order_moments_types.h:123
daal::algorithms::low_order_moments::InputId
InputId
Definition: low_order_moments_types.h:77
daal::algorithms::low_order_moments::sumDense
Definition: low_order_moments_types.h:53
daal::algorithms::low_order_moments::defaultDense
Definition: low_order_moments_types.h:50
daal::algorithms::low_order_moments::sumSquaresCentered
Definition: low_order_moments_types.h:93
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:121
daal::algorithms::low_order_moments::estimatesMinMax
Definition: low_order_moments_types.h:69
daal::algorithms::math::abs::value
Definition: abs_types.h:88
daal::algorithms::low_order_moments::nObservations
Definition: low_order_moments_types.h:108
daal::algorithms::low_order_moments::PartialResultId
PartialResultId
Definition: low_order_moments_types.h:106
daal::algorithms::low_order_moments::interface1::Parameter
Low order moments algorithm parameters.
Definition: low_order_moments_types.h:269
daal::algorithms::low_order_moments::EstimatesToCompute
EstimatesToCompute
Definition: low_order_moments_types.h:66
daal::algorithms::low_order_moments::maximum
Definition: low_order_moments_types.h:90
daal::algorithms::low_order_moments::interface1::Input
Input objects for the low order moments algorithm
Definition: low_order_moments_types.h:149
daal::algorithms::low_order_moments::ResultId
ResultId
Definition: low_order_moments_types.h:87

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