22 #ifndef __PCA_ONLINE_H__
23 #define __PCA_ONLINE_H__
25 #include "algorithms/algorithm.h"
26 #include "data_management/data/numeric_table.h"
27 #include "services/daal_defines.h"
28 #include "services/daal_memory.h"
29 #include "algorithms/pca/pca_types.h"
49 template<
typename algorithmFPType, Method method, CpuType cpu>
50 class DAAL_EXPORT OnlineContainer :
public AnalysisContainerIface<online> {};
56 template<
typename algorithmFPType, CpuType cpu>
57 class DAAL_EXPORT OnlineContainer<algorithmFPType, correlationDense, cpu> :
public AnalysisContainerIface<online>
65 OnlineContainer(daal::services::Environment::env *daalEnv);
72 services::Status compute() DAAL_C11_OVERRIDE;
76 services::Status finalizeCompute() DAAL_C11_OVERRIDE;
83 template<
typename algorithmFPType, CpuType cpu>
84 class DAAL_EXPORT OnlineContainer<algorithmFPType, svdDense, cpu> :
public AnalysisContainerIface<online>
92 OnlineContainer(daal::services::Environment::env *daalEnv);
99 services::Status compute() DAAL_C11_OVERRIDE;
103 services::Status finalizeCompute() DAAL_C11_OVERRIDE;
113 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = correlationDense>
114 class DAAL_EXPORT Online :
public Analysis<online> {};
123 template<
typename algorithmFPType>
124 class DAAL_EXPORT Online<algorithmFPType, correlationDense> :
public Analysis<online>
127 typedef algorithms::pca::Input InputType;
128 typedef algorithms::pca::OnlineParameter<algorithmFPType, correlationDense> ParameterType;
129 typedef algorithms::pca::Result ResultType;
130 typedef algorithms::pca::PartialResult<correlationDense> PartialResultType;
143 Online(
const Online<algorithmFPType, correlationDense> &other) : input(other.input), parameter(other.parameter)
154 int getMethod() const DAAL_C11_OVERRIDE {
return(
int)correlationDense; }
160 services::Status setPartialResult(
const services::SharedPtr<PartialResult<correlationDense> >& partialResult)
162 DAAL_CHECK(partialResult, services::ErrorNullPartialResult);
163 _partialResult = partialResult;
164 _pres = _partialResult.get();
165 return services::Status();
172 services::Status setResult(
const ResultPtr& res)
174 DAAL_CHECK(res, services::ErrorNullResult)
176 _res = _result.get();
177 return services::Status();
184 services::SharedPtr<PartialResult<correlationDense> > getPartialResult()
186 return _partialResult;
193 ResultPtr getResult()
203 services::SharedPtr<Online<algorithmFPType, correlationDense> > clone()
const
205 return services::SharedPtr<Online<algorithmFPType, correlationDense> >(cloneImpl());
209 OnlineParameter<algorithmFPType, correlationDense> parameter;
212 services::SharedPtr<PartialResult<correlationDense> > _partialResult;
215 virtual Online<algorithmFPType, correlationDense> * cloneImpl() const DAAL_C11_OVERRIDE
217 return new Online<algorithmFPType, correlationDense>(*this);
220 services::Status allocateResult() DAAL_C11_OVERRIDE
222 services::Status s = _result->allocate<algorithmFPType>(_pres, ¶meter, correlationDense);
223 _res = _result.get();
227 services::Status allocatePartialResult() DAAL_C11_OVERRIDE
229 services::Status s = _partialResult->allocate<algorithmFPType>(&input, ¶meter, correlationDense);
230 _pres = _partialResult.get();
234 services::Status initializePartialResult() DAAL_C11_OVERRIDE
236 services::Status s = _partialResult->initialize<algorithmFPType>(&input, ¶meter, correlationDense);
237 _pres = _partialResult.get();
243 _ac =
new __DAAL_ALGORITHM_CONTAINER(online, OnlineContainer, algorithmFPType, correlationDense)(&_env);
246 _partialResult.reset(
new PartialResult<correlationDense>());
247 _result.reset(
new ResultType());
258 template<
typename algorithmFPType>
259 class DAAL_EXPORT Online<algorithmFPType, svdDense> :
public Analysis<online>
262 typedef algorithms::pca::Input InputType;
263 typedef algorithms::pca::OnlineParameter<algorithmFPType, svdDense> ParameterType;
264 typedef algorithms::pca::Result ResultType;
265 typedef algorithms::pca::PartialResult<svdDense> PartialResultType;
278 Online(
const Online<algorithmFPType, svdDense> &other) : input(other.input), parameter(other.parameter)
289 int getMethod() const DAAL_C11_OVERRIDE {
return(
int)svdDense; }
295 services::Status setPartialResult(
const services::SharedPtr<PartialResult<svdDense> >& partialResult)
297 DAAL_CHECK(partialResult, services::ErrorNullPartialResult);
298 _partialResult = partialResult;
299 _pres = _partialResult.get();
300 return services::Status();
307 services::Status setResult(
const ResultPtr& res)
309 DAAL_CHECK(res, services::ErrorNullResult)
311 _res = _result.get();
312 return services::Status();
319 services::SharedPtr<PartialResult<svdDense> > getPartialResult()
321 return _partialResult;
328 ResultPtr getResult()
338 services::SharedPtr<Online<algorithmFPType, svdDense> > clone()
const
340 return services::SharedPtr<Online<algorithmFPType, svdDense> >(cloneImpl());
344 OnlineParameter<algorithmFPType, svdDense> parameter;
347 services::SharedPtr<PartialResult<svdDense> > _partialResult;
350 virtual Online<algorithmFPType, svdDense> * cloneImpl() const DAAL_C11_OVERRIDE
352 return new Online<algorithmFPType, svdDense>(*this);
355 services::Status allocateResult() DAAL_C11_OVERRIDE
357 services::Status s = _result->allocate<algorithmFPType>(_pres, ¶meter, svdDense);
358 _res = _result.get();
362 services::Status allocatePartialResult() DAAL_C11_OVERRIDE
364 services::Status s = _partialResult->allocate<algorithmFPType>(&input, ¶meter, svdDense);
365 _pres = _partialResult.get();
369 services::Status initializePartialResult() DAAL_C11_OVERRIDE
371 services::Status s = _partialResult->initialize<algorithmFPType>(&input, ¶meter, svdDense);
372 _pres = _partialResult.get();
378 _ac =
new __DAAL_ALGORITHM_CONTAINER(online, OnlineContainer, algorithmFPType, svdDense)(&_env);
381 _partialResult.reset(
new PartialResult<svdDense>());
382 _result.reset(
new ResultType());
387 using interface1::OnlineContainer;
388 using interface1::Online;
daal::algorithms::pca::interface1::OnlineParameter< algorithmFPType, correlationDense >
Class that specifies the parameters of the PCA Correlation algorithm in the online computing mode...
Definition: pca_types.h:472
daal
Definition: algorithm_base_common.h:31
daal::algorithms::pca::interface1::Online
Computes the results of the PCA algorithm.
Definition: pca_online.h:114
daal::algorithms::AnalysisContainerIface
Abstract interface class that provides virtual methods to access and run implementations of the analy...
Definition: analysis.h:53
daal::algorithms::pca::interface1::Online< algorithmFPType, correlationDense >::getMethod
int getMethod() const DAAL_C11_OVERRIDE
Definition: pca_online.h:154
daal::algorithms::pca::interface1::Online< algorithmFPType, correlationDense >::clone
services::SharedPtr< Online< algorithmFPType, correlationDense > > clone() const
Definition: pca_online.h:203
daal::algorithms::pca::interface1::Online< algorithmFPType, svdDense >::setPartialResult
services::Status setPartialResult(const services::SharedPtr< PartialResult< svdDense > > &partialResult)
Definition: pca_online.h:295
daal::algorithms::pca::interface1::Online< algorithmFPType, svdDense >
Computes the results of the PCA SVD algorithm.
Definition: pca_online.h:259
daal::services::ErrorNullPartialResult
Definition: error_indexes.h:105
daal::algorithms::pca::interface1::OnlineContainer
Class containing methods to compute the result of the PCA algorithm.
Definition: pca_online.h:50
daal::algorithms::pca::interface1::Online< algorithmFPType, svdDense >::setResult
services::Status setResult(const ResultPtr &res)
Definition: pca_online.h:307
daal::algorithms::pca::interface1::Online< algorithmFPType, svdDense >::Online
Online()
Definition: pca_online.h:268
daal::algorithms::pca::interface1::Online< algorithmFPType, svdDense >::getPartialResult
services::SharedPtr< PartialResult< svdDense > > getPartialResult()
Definition: pca_online.h:319
daal::algorithms::pca::interface1::Online< algorithmFPType, correlationDense >::parameter
OnlineParameter< algorithmFPType, correlationDense > parameter
Definition: pca_online.h:209
daal::algorithms::pca::interface1::Online< algorithmFPType, correlationDense >::input
InputType input
Definition: pca_online.h:208
daal::algorithms::pca::interface1::Online< algorithmFPType, svdDense >::input
InputType input
Definition: pca_online.h:343
daal::algorithms::pca::interface1::Online< algorithmFPType, svdDense >::getMethod
int getMethod() const DAAL_C11_OVERRIDE
Definition: pca_online.h:289
daal::algorithms::pca::interface1::Online< algorithmFPType, correlationDense >::setResult
services::Status setResult(const ResultPtr &res)
Definition: pca_online.h:172
daal::algorithms::pca::interface1::Online< algorithmFPType, correlationDense >::getPartialResult
services::SharedPtr< PartialResult< correlationDense > > getPartialResult()
Definition: pca_online.h:184
daal::algorithms::pca::interface1::PartialResult
Provides methods to access partial results obtained with the compute() method of the PCA algorithm in...
Definition: pca_types.h:261
daal::algorithms::pca::interface1::Online< algorithmFPType, correlationDense >
Computes the results of the PCA Correlation algorithm.
Definition: pca_online.h:124
daal::algorithms::pca::svdDense
Definition: pca_types.h:57
daal::algorithms::pca::interface1::Online< algorithmFPType, svdDense >::getResult
ResultPtr getResult()
Definition: pca_online.h:328
daal::algorithms::pca::interface1::Online< algorithmFPType, svdDense >::parameter
OnlineParameter< algorithmFPType, svdDense > parameter
Definition: pca_online.h:344
daal::algorithms::Analysis
Provides methods for execution of operations over data, such as computation of Summary Statistics est...
Definition: analysis.h:68
daal::algorithms::pca::interface1::Online< algorithmFPType, correlationDense >::Online
Online(const Online< algorithmFPType, correlationDense > &other)
Definition: pca_online.h:143
daal::algorithms::pca::interface1::Online< algorithmFPType, svdDense >::clone
services::SharedPtr< Online< algorithmFPType, svdDense > > clone() const
Definition: pca_online.h:338
daal::algorithms::pca::interface1::Online< algorithmFPType, correlationDense >::Online
Online()
Definition: pca_online.h:133
daal::online
Definition: daal_defines.h:112
daal::algorithms::pca::interface1::Online< algorithmFPType, correlationDense >::getResult
ResultPtr getResult()
Definition: pca_online.h:193
daal::algorithms::pca::interface1::Online< algorithmFPType, correlationDense >::setPartialResult
services::Status setPartialResult(const services::SharedPtr< PartialResult< correlationDense > > &partialResult)
Definition: pca_online.h:160
daal::algorithms::pca::interface1::Online< algorithmFPType, svdDense >::Online
Online(const Online< algorithmFPType, svdDense > &other)
Definition: pca_online.h:278
daal::services::ErrorNullResult
Definition: error_indexes.h:96
daal::algorithms::pca::interface1::OnlineParameter< algorithmFPType, svdDense >
Class that specifies the parameters of the PCA SVD algorithm in the online computing mode...
Definition: pca_types.h:495
daal::algorithms::pca::correlationDense
Definition: pca_types.h:55