48 #ifndef __PCA_ONLINE_H__
49 #define __PCA_ONLINE_H__
51 #include "algorithms/algorithm.h"
52 #include "data_management/data/numeric_table.h"
53 #include "services/daal_defines.h"
54 #include "services/daal_memory.h"
55 #include "algorithms/pca/pca_types.h"
75 template<
typename algorithmFPType, Method method, CpuType cpu>
76 class DAAL_EXPORT OnlineContainer :
public AnalysisContainerIface<online> {};
82 template<
typename algorithmFPType, CpuType cpu>
83 class DAAL_EXPORT OnlineContainer<algorithmFPType, correlationDense, cpu> :
public AnalysisContainerIface<online>
91 OnlineContainer(daal::services::Environment::env *daalEnv);
98 services::Status compute() DAAL_C11_OVERRIDE;
102 services::Status finalizeCompute() DAAL_C11_OVERRIDE;
109 template<
typename algorithmFPType, CpuType cpu>
110 class DAAL_EXPORT OnlineContainer<algorithmFPType, svdDense, cpu> :
public AnalysisContainerIface<online>
118 OnlineContainer(daal::services::Environment::env *daalEnv);
125 services::Status compute() DAAL_C11_OVERRIDE;
129 services::Status finalizeCompute() DAAL_C11_OVERRIDE;
139 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = correlationDense>
140 class DAAL_EXPORT Online :
public Analysis<online> {};
149 template<
typename algorithmFPType>
150 class DAAL_EXPORT Online<algorithmFPType, correlationDense> :
public Analysis<online>
164 Online(
const Online<algorithmFPType, correlationDense> &other) : input(other.input), parameter(other.parameter)
175 int getMethod() const DAAL_C11_OVERRIDE {
return(
int)correlationDense; }
181 services::Status setPartialResult(
const services::SharedPtr<PartialResult<correlationDense> >& partialResult)
183 DAAL_CHECK(partialResult, services::ErrorNullPartialResult);
184 _partialResult = partialResult;
185 _pres = _partialResult.get();
186 return services::Status();
193 services::Status setResult(
const ResultPtr& res)
195 DAAL_CHECK(res, services::ErrorNullResult)
197 _res = _result.get();
198 return services::Status();
205 services::SharedPtr<PartialResult<correlationDense> > getPartialResult()
207 return _partialResult;
214 ResultPtr getResult()
224 services::SharedPtr<Online<algorithmFPType, correlationDense> > clone()
const
226 return services::SharedPtr<Online<algorithmFPType, correlationDense> >(cloneImpl());
230 OnlineParameter<algorithmFPType, correlationDense> parameter;
233 services::SharedPtr<PartialResult<correlationDense> > _partialResult;
236 virtual Online<algorithmFPType, correlationDense> * cloneImpl() const DAAL_C11_OVERRIDE
238 return new Online<algorithmFPType, correlationDense>(*this);
241 services::Status allocateResult() DAAL_C11_OVERRIDE
243 services::Status s = _result->allocate<algorithmFPType>(_pres, ¶meter, correlationDense);
244 _res = _result.get();
248 services::Status allocatePartialResult() DAAL_C11_OVERRIDE
250 services::Status s = _partialResult->allocate<algorithmFPType>(&input, ¶meter, correlationDense);
251 _pres = _partialResult.get();
255 services::Status initializePartialResult() DAAL_C11_OVERRIDE
257 services::Status s = _partialResult->initialize<algorithmFPType>(&input, ¶meter, correlationDense);
258 _pres = _partialResult.get();
264 _ac =
new __DAAL_ALGORITHM_CONTAINER(online, OnlineContainer, algorithmFPType, correlationDense)(&_env);
267 _partialResult.reset(
new PartialResult<correlationDense>());
268 _result.reset(
new Result());
279 template<
typename algorithmFPType>
280 class DAAL_EXPORT Online<algorithmFPType, svdDense> :
public Analysis<online>
294 Online(
const Online<algorithmFPType, svdDense> &other) : input(other.input), parameter(other.parameter)
305 int getMethod() const DAAL_C11_OVERRIDE {
return(
int)svdDense; }
311 services::Status setPartialResult(
const services::SharedPtr<PartialResult<svdDense> >& partialResult)
313 DAAL_CHECK(partialResult, services::ErrorNullPartialResult);
314 _partialResult = partialResult;
315 _pres = _partialResult.get();
316 return services::Status();
323 services::Status setResult(
const ResultPtr& res)
325 DAAL_CHECK(res, services::ErrorNullResult)
327 _res = _result.get();
328 return services::Status();
335 services::SharedPtr<PartialResult<svdDense> > getPartialResult()
337 return _partialResult;
344 ResultPtr getResult()
354 services::SharedPtr<Online<algorithmFPType, svdDense> > clone()
const
356 return services::SharedPtr<Online<algorithmFPType, svdDense> >(cloneImpl());
360 OnlineParameter<algorithmFPType, svdDense> parameter;
363 services::SharedPtr<PartialResult<svdDense> > _partialResult;
366 virtual Online<algorithmFPType, svdDense> * cloneImpl() const DAAL_C11_OVERRIDE
368 return new Online<algorithmFPType, svdDense>(*this);
371 services::Status allocateResult() DAAL_C11_OVERRIDE
373 services::Status s = _result->allocate<algorithmFPType>(_pres, ¶meter, svdDense);
374 _res = _result.get();
378 services::Status allocatePartialResult() DAAL_C11_OVERRIDE
380 services::Status s = _partialResult->allocate<algorithmFPType>(&input, ¶meter, svdDense);
381 _pres = _partialResult.get();
385 services::Status initializePartialResult() DAAL_C11_OVERRIDE
387 services::Status s = _partialResult->initialize<algorithmFPType>(&input, ¶meter, svdDense);
388 _pres = _partialResult.get();
394 _ac =
new __DAAL_ALGORITHM_CONTAINER(online, OnlineContainer, algorithmFPType, svdDense)(&_env);
397 _partialResult.reset(
new PartialResult<svdDense>());
398 _result.reset(
new Result());
403 using interface1::OnlineContainer;
404 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:498
daal
Definition: algorithm_base_common.h:57
daal::algorithms::pca::interface1::Online
Computes the results of the PCA algorithm.
Definition: pca_online.h:140
daal::algorithms::AnalysisContainerIface
Abstract interface class that provides virtual methods to access and run implementations of the analy...
Definition: analysis.h:79
daal::algorithms::pca::interface1::Online< algorithmFPType, correlationDense >::getMethod
int getMethod() const DAAL_C11_OVERRIDE
Definition: pca_online.h:175
daal::algorithms::pca::interface1::Online< algorithmFPType, correlationDense >::clone
services::SharedPtr< Online< algorithmFPType, correlationDense > > clone() const
Definition: pca_online.h:224
daal::algorithms::pca::interface1::Online< algorithmFPType, svdDense >::setPartialResult
services::Status setPartialResult(const services::SharedPtr< PartialResult< svdDense > > &partialResult)
Definition: pca_online.h:311
daal::algorithms::pca::interface1::Online< algorithmFPType, svdDense >
Computes the results of the PCA SVD algorithm.
Definition: pca_online.h:280
daal::services::ErrorNullPartialResult
Definition: error_indexes.h:131
daal::algorithms::pca::interface1::OnlineContainer
Class containing methods to compute the result of the PCA algorithm.
Definition: pca_online.h:76
daal::algorithms::pca::interface1::Online< algorithmFPType, svdDense >::setResult
services::Status setResult(const ResultPtr &res)
Definition: pca_online.h:323
daal::algorithms::pca::interface1::Online< algorithmFPType, svdDense >::Online
Online()
Definition: pca_online.h:284
daal::algorithms::pca::interface1::Online< algorithmFPType, svdDense >::getPartialResult
services::SharedPtr< PartialResult< svdDense > > getPartialResult()
Definition: pca_online.h:335
daal::algorithms::pca::interface1::Online< algorithmFPType, correlationDense >::parameter
OnlineParameter< algorithmFPType, correlationDense > parameter
Definition: pca_online.h:230
daal::algorithms::pca::interface1::Online< algorithmFPType, svdDense >::input
Input input
Definition: pca_online.h:359
daal::algorithms::pca::interface1::Online< algorithmFPType, svdDense >::getMethod
int getMethod() const DAAL_C11_OVERRIDE
Definition: pca_online.h:305
daal::algorithms::pca::interface1::Online< algorithmFPType, correlationDense >::setResult
services::Status setResult(const ResultPtr &res)
Definition: pca_online.h:193
daal::algorithms::pca::interface1::Online< algorithmFPType, correlationDense >::getPartialResult
services::SharedPtr< PartialResult< correlationDense > > getPartialResult()
Definition: pca_online.h:205
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:287
daal::algorithms::pca::interface1::Online< algorithmFPType, correlationDense >
Computes the results of the PCA Correlation algorithm.
Definition: pca_online.h:150
daal::algorithms::pca::svdDense
Definition: pca_types.h:83
daal::algorithms::pca::interface1::Online< algorithmFPType, svdDense >::getResult
ResultPtr getResult()
Definition: pca_online.h:344
daal::algorithms::pca::interface1::Online< algorithmFPType, svdDense >::parameter
OnlineParameter< algorithmFPType, svdDense > parameter
Definition: pca_online.h:360
daal::algorithms::Analysis
Provides methods for execution of operations over data, such as computation of Summary Statistics est...
Definition: analysis.h:94
daal::algorithms::pca::interface1::Online< algorithmFPType, correlationDense >::Online
Online(const Online< algorithmFPType, correlationDense > &other)
Definition: pca_online.h:164
daal::algorithms::pca::interface1::Online< algorithmFPType, svdDense >::clone
services::SharedPtr< Online< algorithmFPType, svdDense > > clone() const
Definition: pca_online.h:354
daal::algorithms::pca::interface1::Online< algorithmFPType, correlationDense >::Online
Online()
Definition: pca_online.h:154
daal::online
Definition: daal_defines.h:133
daal::algorithms::pca::interface1::Online< algorithmFPType, correlationDense >::input
Input input
Definition: pca_online.h:229
daal::algorithms::pca::interface1::Online< algorithmFPType, correlationDense >::getResult
ResultPtr getResult()
Definition: pca_online.h:214
daal::algorithms::pca::interface1::Online< algorithmFPType, correlationDense >::setPartialResult
services::Status setPartialResult(const services::SharedPtr< PartialResult< correlationDense > > &partialResult)
Definition: pca_online.h:181
daal::algorithms::pca::interface1::Online< algorithmFPType, svdDense >::Online
Online(const Online< algorithmFPType, svdDense > &other)
Definition: pca_online.h:294
daal::services::ErrorNullResult
Definition: error_indexes.h:122
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:521
daal::algorithms::pca::correlationDense
Definition: pca_types.h:81