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

distribution_types.h
1 /* file: distribution_types.h */
2 /*******************************************************************************
3 * Copyright 2014-2017 Intel Corporation
4 * All Rights Reserved.
5 *
6 * If this software was obtained under the Intel Simplified Software License,
7 * the following terms apply:
8 *
9 * The source code, information and material ("Material") contained herein is
10 * owned by Intel Corporation or its suppliers or licensors, and title to such
11 * Material remains with Intel Corporation or its suppliers or licensors. The
12 * Material contains proprietary information of Intel or its suppliers and
13 * licensors. The Material is protected by worldwide copyright laws and treaty
14 * provisions. No part of the Material may be used, copied, reproduced,
15 * modified, published, uploaded, posted, transmitted, distributed or disclosed
16 * in any way without Intel's prior express written permission. No license under
17 * any patent, copyright or other intellectual property rights in the Material
18 * is granted to or conferred upon you, either expressly, by implication,
19 * inducement, estoppel or otherwise. Any license under such intellectual
20 * property rights must be express and approved by Intel in writing.
21 *
22 * Unless otherwise agreed by Intel in writing, you may not remove or alter this
23 * notice or any other notice embedded in Materials by Intel or Intel's
24 * suppliers or licensors in any way.
25 *
26 *
27 * If this software was obtained under the Apache License, Version 2.0 (the
28 * "License"), the following terms apply:
29 *
30 * You may not use this file except in compliance with the License. You may
31 * obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
32 *
33 *
34 * Unless required by applicable law or agreed to in writing, software
35 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
36 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
37 *
38 * See the License for the specific language governing permissions and
39 * limitations under the License.
40 *******************************************************************************/
41 
42 /*
43 //++
44 // Implementation of distributions.
45 //--
46 */
47 
48 #ifndef __DISTRIBUTIONS__TYPES__H__
49 #define __DISTRIBUTIONS__TYPES__H__
50 
51 #include "algorithms/algorithm.h"
52 #include "services/daal_defines.h"
53 #include "data_management/data/numeric_table.h"
54 #include "data_management/data/homogen_numeric_table.h"
55 #include "algorithms/engines/engine.h"
56 
57 namespace daal
58 {
59 namespace algorithms
60 {
70 namespace distributions
71 {
76 enum InputId
77 {
78  tableToFill = 0
79 };
80 
85 enum ResultId
86 {
87  randomNumbers = 0
88 };
89 
93 namespace interface1
94 {
99 class DAAL_EXPORT ParameterBase: public daal::algorithms::Parameter
100 {
101 public:
102  ParameterBase();
103  virtual ~ParameterBase();
104 
105  engines::EnginePtr engine;
106 };
107 
112 class DAAL_EXPORT Input : public daal::algorithms::Input
113 {
114 public:
118  Input();
120  Input(const Input& other);
121 
122  virtual ~Input();
123 
129  data_management::NumericTablePtr get(InputId id) const;
130 
136  void set(InputId id, const data_management::NumericTablePtr &ptr);
137 
145  services::Status check(const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
146 };
147 
152 class DAAL_EXPORT Result : public daal::algorithms::Result
153 {
154 public:
156  Result();
157 
158  virtual ~Result();
159 
168  template <typename algorithmFPType>
169  DAAL_EXPORT services::Status allocate(const daal::algorithms::Input *input, const daal::algorithms::Parameter *par, const int method);
170 
176  data_management::NumericTablePtr get(ResultId id) const;
177 
183  void set(ResultId id, const data_management::NumericTablePtr &ptr);
184 
193  virtual services::Status check(const daal::algorithms::Input *input, const daal::algorithms::Parameter *parameter, int method) const DAAL_C11_OVERRIDE;
194 
195 protected:
197  template<typename Archive, bool onDeserialize>
198  services::Status serialImpl(Archive *arch)
199  {
200  daal::algorithms::Result::serialImpl<Archive, onDeserialize>(arch);
201 
202  return services::Status();
203  }
204 
205  services::Status serializeImpl(data_management::InputDataArchive *arch) DAAL_C11_OVERRIDE
206  {
207  serialImpl<data_management::InputDataArchive, false>(arch);
208 
209  return services::Status();
210  }
211 
212  services::Status deserializeImpl(const data_management::OutputDataArchive *arch) DAAL_C11_OVERRIDE
213  {
214  serialImpl<const data_management::OutputDataArchive, true>(arch);
215 
216  return services::Status();
217  }
218 };
219 typedef services::SharedPtr<Result> ResultPtr;
220 } // interface1
221 using interface1::Input;
222 using interface1::Result;
223 using interface1::ResultPtr;
224 using interface1::ParameterBase;
226 } // namespace distributions
227 } // namespace algorithm
228 } // namespace daal
229 #endif
daal
Definition: algorithm_base_common.h:57
daal::algorithms::distributions::interface1::ParameterBase::engine
engines::EnginePtr engine
Definition: distribution_types.h:105
daal::algorithms::distributions::interface1::ParameterBase
Definition: distribution_types.h:99
daal::algorithms::distributions::randomNumbers
Definition: distribution_types.h:87
daal_defines.h
daal::algorithms::distributions::interface1::Result
Provides methods to access the result obtained with the compute() method of the distribution.
Definition: distribution_types.h:152
daal::algorithms::distributions::interface1::Input
Input objects for distributions
Definition: distribution_types.h:112
daal::algorithms::distributions::ResultId
ResultId
Definition: distribution_types.h:85
daal::algorithms::distributions::tableToFill
Definition: distribution_types.h:78
daal::algorithms::distributions::InputId
InputId
Definition: distribution_types.h:76

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