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

em_gmm.h
1 /* file: em_gmm.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 // Implementation of the interface for the EM for GMM algorithm
19 //--
20 */
21 
22 #ifndef __EM_GMM_H__
23 #define __EM_GMM_H__
24 
25 #include "algorithms/algorithm.h"
26 #include "data_management/data/numeric_table.h"
27 #include "services/daal_defines.h"
28 #include "em_gmm_types.h"
29 
30 namespace daal
31 {
32 namespace algorithms
33 {
34 namespace em_gmm
35 {
36 
37 namespace interface1
38 {
52 template<typename algorithmFPType, Method method, CpuType cpu>
53 class DAAL_EXPORT BatchContainer : public daal::algorithms::AnalysisContainerIface<batch>
54 {
55 public:
61  BatchContainer(daal::services::Environment::env *daalEnv);
63  ~BatchContainer();
67  virtual services::Status compute() DAAL_C11_OVERRIDE;
68 };
69 
83 template<typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
84 class DAAL_EXPORT Batch : public daal::algorithms::Analysis<batch>
85 {
86 public:
87  typedef algorithms::em_gmm::Input InputType;
88  typedef algorithms::em_gmm::Parameter ParameterType;
89  typedef algorithms::em_gmm::Result ResultType;
90 
91  Batch(const size_t nComponents);
92 
99  Batch(const Batch<algorithmFPType, method> &other) : input(other.input), parameter(other.parameter)
100  {
101  initialize();
102  }
103 
108  virtual int getMethod() const DAAL_C11_OVERRIDE { return(int)method; }
109 
114  ResultPtr getResult()
115  {
116  return _result;
117  }
118 
123  services::Status setResult(const ResultPtr& result)
124  {
125  DAAL_CHECK(result, services::ErrorNullResult)
126  _result = result;
127  _res = _result.get();
128  return services::Status();
129  }
130 
136  services::SharedPtr<Batch<algorithmFPType, method> > clone() const
137  {
138  return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
139  }
140 
141 protected:
142  virtual Batch<algorithmFPType, method> * cloneImpl() const DAAL_C11_OVERRIDE
143  {
144  return new Batch<algorithmFPType, method>(*this);
145  }
146 
147  virtual services::Status allocateResult() DAAL_C11_OVERRIDE
148  {
149  services::Status s = _result->allocate<algorithmFPType>(&input, &parameter, (int) method);
150  _res = _result.get();
151  return s;
152  }
153 
154  void initialize();
155 
156 public:
157  InputType input;
158  ParameterType parameter;
160 private:
161  ResultPtr _result;
162 };
164 } // namespace interface1
165 using interface1::BatchContainer;
166 using interface1::Batch;
167 
168 } // namespace em_gmm
169 } // namespace algorithm
170 } // namespace daal
171 #endif
daal::algorithms::em_gmm::interface1::Batch::input
InputType input
Definition: em_gmm.h:157
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::em_gmm::interface1::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: em_gmm.h:108
daal::algorithms::em_gmm::interface1::BatchContainer
Provides methods to run implementations of the EM for GMM algorithm. This class is associated with th...
Definition: em_gmm.h:53
daal::algorithms::em_gmm::interface1::Batch::setResult
services::Status setResult(const ResultPtr &result)
Definition: em_gmm.h:123
daal_defines.h
daal::algorithms::em_gmm::interface1::Batch::parameter
ParameterType parameter
Definition: em_gmm.h:158
daal::algorithms::em_gmm::interface1::Batch
Computes EM for GMM in the batch processing mode.
Definition: em_gmm.h:84
daal::algorithms::Analysis
Provides methods for execution of operations over data, such as computation of Summary Statistics est...
Definition: analysis.h:68
daal::algorithms::em_gmm::interface1::Batch::Batch
Batch(const Batch< algorithmFPType, method > &other)
Definition: em_gmm.h:99
daal::algorithms::em_gmm::interface1::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: em_gmm.h:136
daal::algorithms::em_gmm::interface1::Batch::getResult
ResultPtr getResult()
Definition: em_gmm.h:114
daal::services::ErrorNullResult
Definition: error_indexes.h:96

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