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

outlier_detection_multivariate.h
1 /* file: outlier_detection_multivariate.h */
2 /*******************************************************************************
3 * Copyright 2014-2019 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 multivariate outlier detection algorithm
19 // in the batch processing mode
20 //--
21 */
22 
23 #ifndef __OUTLIER_DETECTION_MULTIVARIATE_H__
24 #define __OUTLIER_DETECTION_MULTIVARIATE_H__
25 
26 #include "algorithms/algorithm.h"
27 #include "data_management/data/numeric_table.h"
28 #include "services/daal_defines.h"
29 #include "algorithms/outlier_detection/outlier_detection_multivariate_types.h"
30 
31 namespace daal
32 {
33 namespace algorithms
34 {
35 namespace multivariate_outlier_detection
36 {
37 
38 namespace interface1
39 {
54 template<typename algorithmFPType, Method method, CpuType cpu>
55 class DAAL_EXPORT BatchContainer : public daal::algorithms::AnalysisContainerIface<batch>
56 {
57 public:
63  BatchContainer(daal::services::Environment::env *daalEnv);
65  ~BatchContainer();
71  virtual services::Status compute() DAAL_C11_OVERRIDE;
72 };
73 
92 template<typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
93 class DAAL_EXPORT Batch : public daal::algorithms::Analysis<batch>
94 {
95 public:
96  typedef algorithms::multivariate_outlier_detection::Input InputType;
97  typedef algorithms::multivariate_outlier_detection::Result ResultType;
98 
100  Batch()
101  {
102  initialize();
103  }
104 
111  Batch(const Batch<algorithmFPType, method> &other) : input(other.input)
112  {
113  initialize();
114  }
115 
120  virtual int getMethod() const DAAL_C11_OVERRIDE { return(int) method; }
121 
126  ResultPtr getResult()
127  {
128  return _result;
129  }
130 
137  services::Status setResult(const ResultPtr& result)
138  {
139  DAAL_CHECK(result, services::ErrorNullResult)
140  _result = result;
141  _res = _result.get();
142  return services::Status();
143  }
144 
150  services::SharedPtr<Batch<algorithmFPType, method> > clone() const
151  {
152  return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
153  }
154 
155 protected:
156  virtual Batch<algorithmFPType, method> * cloneImpl() const DAAL_C11_OVERRIDE
157  {
158  return new Batch<algorithmFPType, method>(*this);
159  }
160 
161  virtual services::Status allocateResult() DAAL_C11_OVERRIDE
162  {
163  services::Status s = _result->allocate<algorithmFPType>(&input, NULL, (int) method);
164  _res = _result.get();
165  return s;
166  }
167 
168  void initialize()
169  {
170  Analysis<batch>::_ac = new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
171  _in = &input;
172  _result.reset(new ResultType());
173  }
174 
175 public:
176  InputType input;
178 private:
179  ResultPtr _result;
180 };
182 } // namespace interface1
183 using interface1::BatchContainer;
184 using interface1::Batch;
185 
186 } // namespace multivariate_outlier_detection
187 } // namespace algorithm
188 } // namespace daal
189 #endif
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::multivariate_outlier_detection::interface1::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: outlier_detection_multivariate.h:120
daal::algorithms::multivariate_outlier_detection::interface1::Batch::Batch
Batch(const Batch< algorithmFPType, method > &other)
Definition: outlier_detection_multivariate.h:111
daal::algorithms::multivariate_outlier_detection::interface1::Batch::Batch
Batch()
Definition: outlier_detection_multivariate.h:100
daal_defines.h
daal::algorithms::multivariate_outlier_detection::interface1::Batch::setResult
services::Status setResult(const ResultPtr &result)
Definition: outlier_detection_multivariate.h:137
daal::batch
Definition: daal_defines.h:110
daal::algorithms::multivariate_outlier_detection::interface1::Batch
Abstract class that specifies interface of the algorithms for computing multivariate outlier detectio...
Definition: outlier_detection_multivariate.h:93
daal::algorithms::multivariate_outlier_detection::interface1::BatchContainer
Provides methods to run implementations of the multivariate outlier detection algorithm. This class is associated with daal::algorithms::multivariate_outlier_detection::Batch class and supports the methods of the multivariate outlier detection in the batch processing mode.
Definition: outlier_detection_multivariate.h:55
daal::algorithms::multivariate_outlier_detection::interface1::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: outlier_detection_multivariate.h:150
daal::algorithms::multivariate_outlier_detection::interface1::Batch::getResult
ResultPtr getResult()
Definition: outlier_detection_multivariate.h:126
daal::algorithms::multivariate_outlier_detection::interface1::Batch::input
InputType input
Definition: outlier_detection_multivariate.h:176
daal::algorithms::Analysis
Provides methods for execution of operations over data, such as computation of Summary Statistics est...
Definition: analysis.h:68
daal::services::ErrorNullResult
Definition: error_indexes.h:96

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