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

outlier_detection_multivariate.h
1 /* file: outlier_detection_multivariate.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 // Implementation of the interface for the multivariate outlier detection algorithm
21 // in the batch processing mode
22 //--
23 */
24 
25 #ifndef __OUTLIER_DETECTION_MULTIVARIATE_H__
26 #define __OUTLIER_DETECTION_MULTIVARIATE_H__
27 
28 #include "algorithms/algorithm.h"
29 #include "data_management/data/numeric_table.h"
30 #include "services/daal_defines.h"
31 #include "algorithms/outlier_detection/outlier_detection_multivariate_types.h"
32 
33 namespace daal
34 {
35 namespace algorithms
36 {
37 namespace multivariate_outlier_detection
38 {
39 
40 namespace interface1
41 {
56 template<typename algorithmFPType, Method method, CpuType cpu>
57 class BatchContainer : public daal::algorithms::AnalysisContainerIface<batch>
58 {
59 public:
65  BatchContainer(daal::services::Environment::env *daalEnv);
67  ~BatchContainer();
73  virtual services::Status compute() DAAL_C11_OVERRIDE;
74 };
75 
94 template<typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
95 class DAAL_EXPORT Batch : public daal::algorithms::Analysis<batch>
96 {
97 public:
98  typedef algorithms::multivariate_outlier_detection::Input InputType;
99  typedef algorithms::multivariate_outlier_detection::Result ResultType;
100 
102  Batch()
103  {
104  initialize();
105  }
106 
113  Batch(const Batch<algorithmFPType, method> &other) : input(other.input)
114  {
115  initialize();
116  }
117 
122  virtual int getMethod() const DAAL_C11_OVERRIDE { return(int) method; }
123 
128  ResultPtr getResult()
129  {
130  return _result;
131  }
132 
139  services::Status setResult(const ResultPtr& result)
140  {
141  DAAL_CHECK(result, services::ErrorNullResult)
142  _result = result;
143  _res = _result.get();
144  return services::Status();
145  }
146 
152  services::SharedPtr<Batch<algorithmFPType, method> > clone() const
153  {
154  return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
155  }
156 
157 protected:
158  virtual Batch<algorithmFPType, method> * cloneImpl() const DAAL_C11_OVERRIDE
159  {
160  return new Batch<algorithmFPType, method>(*this);
161  }
162 
163  virtual services::Status allocateResult() DAAL_C11_OVERRIDE
164  {
165  services::Status s = _result->allocate<algorithmFPType>(&input, NULL, (int) method);
166  _res = _result.get();
167  return s;
168  }
169 
170  void initialize()
171  {
172  Analysis<batch>::_ac = new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
173  _in = &input;
174  _result.reset(new ResultType());
175  }
176 
177 public:
178  InputType input;
180 private:
181  ResultPtr _result;
182 };
184 } // namespace interface1
185 using interface1::BatchContainer;
186 using interface1::Batch;
187 
188 } // namespace multivariate_outlier_detection
189 } // namespace algorithm
190 } // namespace daal
191 #endif
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:95
daal::algorithms::multivariate_outlier_detection::interface1::BatchContainer::BatchContainer
BatchContainer(daal::services::Environment::env *daalEnv)
daal::batch
Definition: daal_defines.h:112
daal::algorithms::multivariate_outlier_detection::interface1::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: outlier_detection_multivariate.h:152
daal::algorithms::multivariate_outlier_detection::interface1::BatchContainer::compute
virtual services::Status compute() DAAL_C11_OVERRIDE
daal::services::ErrorNullResult
Definition: error_indexes.h:98
daal::algorithms::AnalysisContainerIface
Abstract interface class that provides virtual methods to access and run implementations of the analy...
Definition: analysis.h:55
daal::algorithms::multivariate_outlier_detection::interface1::Batch::Batch
Batch()
Definition: outlier_detection_multivariate.h:102
daal_defines.h
daal::algorithms::multivariate_outlier_detection::interface1::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: outlier_detection_multivariate.h:122
daal::algorithms::multivariate_outlier_detection::interface1::Batch::setResult
services::Status setResult(const ResultPtr &result)
Definition: outlier_detection_multivariate.h:139
daal::algorithms::multivariate_outlier_detection::interface1::Batch::Batch
Batch(const Batch< algorithmFPType, method > &other)
Definition: outlier_detection_multivariate.h:113
daal::algorithms::Analysis
Provides methods for execution of operations over data, such as computation of Summary Statistics est...
Definition: analysis.h:70
daal::algorithms::multivariate_outlier_detection::interface1::Batch::getResult
ResultPtr getResult()
Definition: outlier_detection_multivariate.h:128
daal::algorithms::multivariate_outlier_detection::interface1::BatchContainer::~BatchContainer
~BatchContainer()
daal::algorithms::multivariate_outlier_detection::interface1::Batch::input
InputType input
Definition: outlier_detection_multivariate.h:178
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:57

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