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

cholesky.h
1 /* file: cholesky.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 Cholesky decomposition algorithm
19 //--
20 */
21 
22 #ifndef __CHOLESKY_H__
23 #define __CHOLESKY_H__
24 
25 #include "algorithms/algorithm.h"
26 #include "data_management/data/numeric_table.h"
27 #include "services/daal_defines.h"
28 #include "algorithms/cholesky/cholesky_types.h"
29 
30 namespace daal
31 {
32 namespace algorithms
33 {
34 namespace cholesky
35 {
36 namespace interface1
37 {
51 template<typename algorithmFPType, Method method, CpuType cpu>
52 class DAAL_EXPORT BatchContainer : public daal::algorithms::AnalysisContainerIface<batch>
53 {
54 public:
59  BatchContainer(daal::services::Environment::env *daalEnv);
61  ~BatchContainer();
65  virtual services::Status compute() DAAL_C11_OVERRIDE;
66 };
67 
82 template<typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
83 class DAAL_EXPORT Batch : public daal::algorithms::Analysis<batch>
84 {
85 public:
86  typedef algorithms::cholesky::Input InputType;
87  typedef algorithms::cholesky::Result ResultType;
88 
90  Batch()
91  {
92  initialize();
93  }
94 
101  Batch(const Batch<algorithmFPType, method> &other) : input(other.input)
102  {
103  initialize();
104  }
105 
107  virtual ~Batch() {}
108 
113  virtual int getMethod() const DAAL_C11_OVERRIDE { return(int) method; }
114 
119  ResultPtr getResult()
120  {
121  return _result;
122  }
123 
130  services::Status setResult(const ResultPtr& result)
131  {
132  DAAL_CHECK(result, services::ErrorNullResult)
133  _result = result;
134  _res = _result.get();
135  return services::Status();
136  }
137 
143  services::SharedPtr<Batch<algorithmFPType, method> > clone() const
144  {
145  return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
146  }
147 
148 protected:
149  virtual Batch<algorithmFPType, method> * cloneImpl() const DAAL_C11_OVERRIDE
150  {
151  return new Batch<algorithmFPType, method>(*this);
152  }
153 
154  virtual services::Status allocateResult() DAAL_C11_OVERRIDE
155  {
156  services::Status s = _result->allocate<algorithmFPType>(&input, NULL, (int)method);
157  _res = _result.get();
158  return s;
159  }
160 
161  void initialize()
162  {
163  Analysis<batch>::_ac = new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
164  _in = &input;
165  _result.reset(new ResultType());
166  }
167 
168 public:
169  InputType input;
171 private:
172  ResultPtr _result;
173 };
175 } // namespace interface1
176 using interface1::BatchContainer;
177 using interface1::Batch;
178 
179 } // namespace cholesky
180 } // namespace algorithm
181 } // namespace daal
182 #endif
daal::algorithms::cholesky::interface1::Batch::~Batch
virtual ~Batch()
Definition: cholesky.h:107
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::cholesky::interface1::Batch::setResult
services::Status setResult(const ResultPtr &result)
Definition: cholesky.h:130
daal_defines.h
daal::algorithms::cholesky::interface1::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: cholesky.h:113
daal::batch
Definition: daal_defines.h:106
daal::algorithms::cholesky::interface1::BatchContainer
Provides methods to run implementations of the Cholesky decomposition algorithm. This class is associ...
Definition: cholesky.h:52
daal::algorithms::Analysis
Provides methods for execution of operations over data, such as computation of Summary Statistics est...
Definition: analysis.h:68
daal::algorithms::cholesky::interface1::Batch::Batch
Batch(const Batch< algorithmFPType, method > &other)
Definition: cholesky.h:101
daal::algorithms::cholesky::interface1::Batch
Computes Cholesky decomposition in the batch processing mode.
Definition: cholesky.h:83
daal::algorithms::cholesky::interface1::Batch::getResult
ResultPtr getResult()
Definition: cholesky.h:119
daal::algorithms::cholesky::interface1::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: cholesky.h:143
daal::algorithms::cholesky::interface1::Batch::input
InputType input
Definition: cholesky.h:169
daal::services::ErrorNullResult
Definition: error_indexes.h:96
daal::algorithms::cholesky::interface1::Batch::Batch
Batch()
Definition: cholesky.h:90

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