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

outlier_detection_multivariate.h
1 /* file: outlier_detection_multivariate.h */
2 /*******************************************************************************
3 * Copyright 2014-2018 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 the interface for the multivariate outlier detection algorithm
45 // in the batch processing mode
46 //--
47 */
48 
49 #ifndef __OUTLIER_DETECTION_MULTIVARIATE_H__
50 #define __OUTLIER_DETECTION_MULTIVARIATE_H__
51 
52 #include "algorithms/algorithm.h"
53 #include "data_management/data/numeric_table.h"
54 #include "services/daal_defines.h"
55 #include "algorithms/outlier_detection/outlier_detection_multivariate_types.h"
56 
57 namespace daal
58 {
59 namespace algorithms
60 {
61 namespace multivariate_outlier_detection
62 {
63 
64 namespace interface1
65 {
80 template<typename algorithmFPType, Method method, CpuType cpu>
81 class DAAL_EXPORT BatchContainer : public daal::algorithms::AnalysisContainerIface<batch>
82 {
83 public:
89  BatchContainer(daal::services::Environment::env *daalEnv);
91  ~BatchContainer();
97  virtual services::Status compute() DAAL_C11_OVERRIDE;
98 };
99 
118 template<typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
119 class DAAL_EXPORT Batch : public daal::algorithms::Analysis<batch>
120 {
121 public:
122  typedef algorithms::multivariate_outlier_detection::Input InputType;
123  typedef algorithms::multivariate_outlier_detection::Result ResultType;
124 
126  Batch()
127  {
128  initialize();
129  }
130 
137  Batch(const Batch<algorithmFPType, method> &other) : input(other.input)
138  {
139  initialize();
140  }
141 
146  virtual int getMethod() const DAAL_C11_OVERRIDE { return(int) method; }
147 
152  ResultPtr getResult()
153  {
154  return _result;
155  }
156 
163  services::Status setResult(const ResultPtr& result)
164  {
165  DAAL_CHECK(result, services::ErrorNullResult)
166  _result = result;
167  _res = _result.get();
168  return services::Status();
169  }
170 
176  services::SharedPtr<Batch<algorithmFPType, method> > clone() const
177  {
178  return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
179  }
180 
181 protected:
182  virtual Batch<algorithmFPType, method> * cloneImpl() const DAAL_C11_OVERRIDE
183  {
184  return new Batch<algorithmFPType, method>(*this);
185  }
186 
187  virtual services::Status allocateResult() DAAL_C11_OVERRIDE
188  {
189  services::Status s = _result->allocate<algorithmFPType>(&input, NULL, (int) method);
190  _res = _result.get();
191  return s;
192  }
193 
194  void initialize()
195  {
196  Analysis<batch>::_ac = new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
197  _in = &input;
198  _result.reset(new ResultType());
199  }
200 
201 public:
202  InputType input;
204 private:
205  ResultPtr _result;
206 };
208 } // namespace interface1
209 using interface1::BatchContainer;
210 using interface1::Batch;
211 
212 } // namespace multivariate_outlier_detection
213 } // namespace algorithm
214 } // namespace daal
215 #endif
daal::services::interface1::Environment::_envStruct
The environment structure.
Definition: env_detect.h:95
daal::services::interface1::Status
Class that holds the results of API calls. In case of API routine failure it contains the list of err...
Definition: error_handling.h:491
daal
Definition: algorithm_base_common.h:57
daal::algorithms::AnalysisContainerIface
Abstract interface class that provides virtual methods to access and run implementations of the analy...
Definition: analysis.h:79
daal::algorithms::multivariate_outlier_detection::interface1::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: outlier_detection_multivariate.h:146
daal::algorithms::multivariate_outlier_detection::interface1::Batch::Batch
Batch(const Batch< algorithmFPType, method > &other)
Definition: outlier_detection_multivariate.h:137
daal::algorithms::multivariate_outlier_detection::interface1::Input
Input objects for the multivariate outlier detection algorithm
Definition: outlier_detection_multivariate_types.h:212
daal::algorithms::multivariate_outlier_detection::interface1::Batch::Batch
Batch()
Definition: outlier_detection_multivariate.h:126
daal_defines.h
daal::algorithms::multivariate_outlier_detection::interface1::Batch::setResult
services::Status setResult(const ResultPtr &result)
Definition: outlier_detection_multivariate.h:163
daal::batch
Definition: daal_defines.h:132
daal::services::interface1::SharedPtr
Shared pointer that retains shared ownership of an object through a pointer. Several SharedPtr object...
Definition: daal_shared_ptr.h:187
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:119
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:81
daal::services::interface1::SharedPtr::get
T * get() const
Definition: daal_shared_ptr.h:332
daal::algorithms::multivariate_outlier_detection::interface1::Batch::getResult
ResultPtr getResult()
Definition: outlier_detection_multivariate.h:152
daal::algorithms::multivariate_outlier_detection::interface1::Batch::input
InputType input
Definition: outlier_detection_multivariate.h:202
daal::algorithms::Analysis
Provides methods for execution of operations over data, such as computation of Summary Statistics est...
Definition: analysis.h:94
daal::algorithms::multivariate_outlier_detection::interface1::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: outlier_detection_multivariate.h:176
daal::services::ErrorNullResult
Definition: error_indexes.h:122
daal::algorithms::multivariate_outlier_detection::interface1::Result
Results obtained with the compute() method of the multivariate outlier detection algorithm in the bat...
Definition: outlier_detection_multivariate_types.h:248

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