24 #ifndef __PCA_ONLINE_H__
25 #define __PCA_ONLINE_H__
27 #include "algorithms/algorithm.h"
28 #include "data_management/data/numeric_table.h"
29 #include "services/daal_defines.h"
30 #include "services/daal_memory.h"
31 #include "algorithms/pca/pca_types.h"
51 template<
typename algorithmFPType, Method method, CpuType cpu>
52 class OnlineContainer :
public AnalysisContainerIface<online> {};
58 template<
typename algorithmFPType, CpuType cpu>
59 class OnlineContainer<algorithmFPType, correlationDense, cpu> :
public AnalysisContainerIface<online>
67 OnlineContainer(daal::services::Environment::env *daalEnv);
74 services::Status compute() DAAL_C11_OVERRIDE;
78 services::Status finalizeCompute() DAAL_C11_OVERRIDE;
85 template<
typename algorithmFPType, CpuType cpu>
86 class OnlineContainer<algorithmFPType, svdDense, cpu> :
public AnalysisContainerIface<online>
94 OnlineContainer(daal::services::Environment::env *daalEnv);
101 services::Status compute() DAAL_C11_OVERRIDE;
105 services::Status finalizeCompute() DAAL_C11_OVERRIDE;
115 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = correlationDense>
116 class DAAL_EXPORT Online :
public Analysis<online> {};
125 template<
typename algorithmFPType>
126 class DAAL_EXPORT Online<algorithmFPType, correlationDense> :
public Analysis<online>
129 typedef algorithms::pca::Input InputType;
130 typedef algorithms::pca::OnlineParameter<algorithmFPType, correlationDense> ParameterType;
131 typedef algorithms::pca::Result ResultType;
132 typedef algorithms::pca::PartialResult<correlationDense> PartialResultType;
145 Online(
const Online<algorithmFPType, correlationDense> &other) : input(other.input), parameter(other.parameter)
156 int getMethod() const DAAL_C11_OVERRIDE {
return(
int)correlationDense; }
162 services::Status setPartialResult(
const services::SharedPtr<PartialResult<correlationDense> >& partialResult)
164 DAAL_CHECK(partialResult, services::ErrorNullPartialResult);
165 _partialResult = partialResult;
166 _pres = _partialResult.get();
167 return services::Status();
174 services::Status setResult(
const ResultPtr& res)
176 DAAL_CHECK(res, services::ErrorNullResult)
178 _res = _result.get();
179 return services::Status();
186 services::SharedPtr<PartialResult<correlationDense> > getPartialResult()
188 return _partialResult;
195 ResultPtr getResult()
205 services::SharedPtr<Online<algorithmFPType, correlationDense> > clone()
const
207 return services::SharedPtr<Online<algorithmFPType, correlationDense> >(cloneImpl());
211 OnlineParameter<algorithmFPType, correlationDense> parameter;
214 services::SharedPtr<PartialResult<correlationDense> > _partialResult;
217 virtual Online<algorithmFPType, correlationDense> * cloneImpl() const DAAL_C11_OVERRIDE
219 return new Online<algorithmFPType, correlationDense>(*this);
222 services::Status allocateResult() DAAL_C11_OVERRIDE
224 services::Status s = _result->allocate<algorithmFPType>(_pres, ¶meter, correlationDense);
225 _res = _result.get();
229 services::Status allocatePartialResult() DAAL_C11_OVERRIDE
231 services::Status s = _partialResult->allocate<algorithmFPType>(&input, ¶meter, correlationDense);
232 _pres = _partialResult.get();
236 services::Status initializePartialResult() DAAL_C11_OVERRIDE
238 services::Status s = _partialResult->initialize<algorithmFPType>(&input, ¶meter, correlationDense);
239 _pres = _partialResult.get();
245 _ac =
new __DAAL_ALGORITHM_CONTAINER(online, OnlineContainer, algorithmFPType, correlationDense)(&_env);
248 _partialResult.reset(
new PartialResult<correlationDense>());
249 _result.reset(
new ResultType());
260 template<
typename algorithmFPType>
261 class DAAL_EXPORT Online<algorithmFPType, svdDense> :
public Analysis<online>
264 typedef algorithms::pca::Input InputType;
265 typedef algorithms::pca::OnlineParameter<algorithmFPType, svdDense> ParameterType;
266 typedef algorithms::pca::Result ResultType;
267 typedef algorithms::pca::PartialResult<svdDense> PartialResultType;
280 Online(
const Online<algorithmFPType, svdDense> &other) : input(other.input), parameter(other.parameter)
291 int getMethod() const DAAL_C11_OVERRIDE {
return(
int)svdDense; }
297 services::Status setPartialResult(
const services::SharedPtr<PartialResult<svdDense> >& partialResult)
299 DAAL_CHECK(partialResult, services::ErrorNullPartialResult);
300 _partialResult = partialResult;
301 _pres = _partialResult.get();
302 return services::Status();
309 services::Status setResult(
const ResultPtr& res)
311 DAAL_CHECK(res, services::ErrorNullResult)
313 _res = _result.get();
314 return services::Status();
321 services::SharedPtr<PartialResult<svdDense> > getPartialResult()
323 return _partialResult;
330 ResultPtr getResult()
340 services::SharedPtr<Online<algorithmFPType, svdDense> > clone()
const
342 return services::SharedPtr<Online<algorithmFPType, svdDense> >(cloneImpl());
346 OnlineParameter<algorithmFPType, svdDense> parameter;
349 services::SharedPtr<PartialResult<svdDense> > _partialResult;
352 virtual Online<algorithmFPType, svdDense> * cloneImpl() const DAAL_C11_OVERRIDE
354 return new Online<algorithmFPType, svdDense>(*this);
357 services::Status allocateResult() DAAL_C11_OVERRIDE
359 services::Status s = _result->allocate<algorithmFPType>(_pres, ¶meter, svdDense);
360 _res = _result.get();
364 services::Status allocatePartialResult() DAAL_C11_OVERRIDE
366 services::Status s = _partialResult->allocate<algorithmFPType>(&input, ¶meter, svdDense);
367 _pres = _partialResult.get();
371 services::Status initializePartialResult() DAAL_C11_OVERRIDE
373 services::Status s = _partialResult->initialize<algorithmFPType>(&input, ¶meter, svdDense);
374 _pres = _partialResult.get();
380 _ac =
new __DAAL_ALGORITHM_CONTAINER(online, OnlineContainer, algorithmFPType, svdDense)(&_env);
383 _partialResult.reset(
new PartialResult<svdDense>());
384 _result.reset(
new ResultType());
389 using interface1::OnlineContainer;
390 using interface1::Online;
daal::algorithms::pca::interface1::Online< algorithmFPType, correlationDense >::getMethod
int getMethod() const DAAL_C11_OVERRIDE
Definition: pca_online.h:156
daal::algorithms::pca::interface1::Online< algorithmFPType, svdDense >::Online
Online()
Definition: pca_online.h:270
daal::algorithms::pca::interface1::Online< algorithmFPType, correlationDense >::getPartialResult
services::SharedPtr< PartialResult< correlationDense > > getPartialResult()
Definition: pca_online.h:186
daal::algorithms::pca::interface1::Online< algorithmFPType, svdDense >::input
InputType input
Definition: pca_online.h:345
daal::algorithms::pca::interface1::Online< algorithmFPType, svdDense >::parameter
OnlineParameter< algorithmFPType, svdDense > parameter
Definition: pca_online.h:346
daal::algorithms::pca::interface1::Online< algorithmFPType, svdDense >::getPartialResult
services::SharedPtr< PartialResult< svdDense > > getPartialResult()
Definition: pca_online.h:321
daal::algorithms::pca::correlationDense
Definition: pca_types.h:57
daal::algorithms::pca::interface1::Online< algorithmFPType, svdDense >::setResult
services::Status setResult(const ResultPtr &res)
Definition: pca_online.h:309
daal::algorithms::pca::interface1::Online< algorithmFPType, svdDense >::getMethod
int getMethod() const DAAL_C11_OVERRIDE
Definition: pca_online.h:291
daal::algorithms::pca::interface1::Online< algorithmFPType, svdDense >::clone
services::SharedPtr< Online< algorithmFPType, svdDense > > clone() const
Definition: pca_online.h:340
daal::algorithms::pca::interface1::Online< algorithmFPType, svdDense >::setPartialResult
services::Status setPartialResult(const services::SharedPtr< PartialResult< svdDense > > &partialResult)
Definition: pca_online.h:297
daal::algorithms::pca::interface1::Online< algorithmFPType, correlationDense >::parameter
OnlineParameter< algorithmFPType, correlationDense > parameter
Definition: pca_online.h:211
daal::algorithms::pca::svdDense
Definition: pca_types.h:59
daal::algorithms::pca::interface1::Online< algorithmFPType, correlationDense >
Computes the results of the PCA Correlation algorithm.
Definition: pca_online.h:126
daal::algorithms::pca::interface1::Online< algorithmFPType, correlationDense >::input
InputType input
Definition: pca_online.h:210
daal::services::ErrorNullResult
Definition: error_indexes.h:98
daal::algorithms::pca::interface1::Online< algorithmFPType, svdDense >::Online
Online(const Online< algorithmFPType, svdDense > &other)
Definition: pca_online.h:280
daal::algorithms::AnalysisContainerIface
Abstract interface class that provides virtual methods to access and run implementations of the analy...
Definition: analysis.h:55
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:497
daal::algorithms::pca::interface1::Online< algorithmFPType, correlationDense >::Online
Online()
Definition: pca_online.h:135
daal::algorithms::pca::interface1::Online< algorithmFPType, correlationDense >::getResult
ResultPtr getResult()
Definition: pca_online.h:195
daal::algorithms::pca::interface1::OnlineContainer
Class containing methods to compute the result of the PCA algorithm.
Definition: pca_online.h:52
daal::algorithms::pca::interface1::Online< algorithmFPType, correlationDense >::clone
services::SharedPtr< Online< algorithmFPType, correlationDense > > clone() const
Definition: pca_online.h:205
daal::online
Definition: daal_defines.h:114
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:263
daal::algorithms::pca::interface1::Online< algorithmFPType, svdDense >
Computes the results of the PCA SVD algorithm.
Definition: pca_online.h:261
daal::algorithms::pca::interface1::Online< algorithmFPType, correlationDense >::setPartialResult
services::Status setPartialResult(const services::SharedPtr< PartialResult< correlationDense > > &partialResult)
Definition: pca_online.h:162
daal::algorithms::pca::interface1::Online
Computes the results of the PCA algorithm.
Definition: pca_online.h:116
daal::algorithms::Analysis
Provides methods for execution of operations over data, such as computation of Summary Statistics est...
Definition: analysis.h:70
daal::services::ErrorNullPartialResult
Definition: error_indexes.h:107
daal::algorithms::pca::interface1::Online< algorithmFPType, correlationDense >::Online
Online(const Online< algorithmFPType, correlationDense > &other)
Definition: pca_online.h:145
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:474
daal::algorithms::pca::interface1::Online< algorithmFPType, correlationDense >::setResult
services::Status setResult(const ResultPtr &res)
Definition: pca_online.h:174
daal::algorithms::pca::interface1::Online< algorithmFPType, svdDense >::getResult
ResultPtr getResult()
Definition: pca_online.h:330