48 #ifndef __SVD_ONLINE_H__ 49 #define __SVD_ONLINE_H__ 51 #include "algorithms/algorithm.h" 52 #include "data_management/data/numeric_table.h" 53 #include "services/daal_defines.h" 54 #include "algorithms/svd/svd_types.h" 78 template<
typename algorithmFPType, Method method, CpuType cpu>
79 class OnlineContainer :
public daal::algorithms::AnalysisContainerIface<online>
87 OnlineContainer(daal::services::Environment::env *daalEnv);
89 virtual ~OnlineContainer();
94 services::Status compute() DAAL_C11_OVERRIDE;
99 services::Status finalizeCompute() DAAL_C11_OVERRIDE;
113 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
114 class Online :
public daal::algorithms::Analysis<online>
117 typedef OnlinePartialResult PartialResult;
118 typedef OnlinePartialResultPtr PartialResultPtr;
120 typedef algorithms::svd::Input InputType;
121 typedef algorithms::svd::Parameter ParameterType;
122 typedef algorithms::svd::Result ResultType;
123 typedef algorithms::svd::OnlinePartialResult PartialResultType;
126 ParameterType parameter;
139 Online(
const Online<algorithmFPType, method> &other) : input(other.input), parameter(other.parameter)
148 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int)method; }
154 ResultPtr getResult()
163 PartialResultPtr getPartialResult()
165 return _partialResult;
172 services::Status setResult(
const ResultPtr& res)
174 DAAL_CHECK(res, services::ErrorNullResult)
176 _res = _result.get();
177 return services::Status();
186 services::Status setPartialResult(
const PartialResultPtr &partialResult,
bool initFlag =
false)
188 _partialResult = partialResult;
189 _pres = _partialResult.get();
190 setInitFlag(initFlag);
191 return services::Status();
198 services::Status checkFinalizeComputeParams() DAAL_C11_OVERRIDE
202 services::Status s = _partialResult->check(_par, method);
208 return services::Status(services::ErrorNullResult);
212 return _result->check(_partialResult.get(), _par, method);
213 return services::Status(services::ErrorNullResult);
221 services::SharedPtr<Online<algorithmFPType, method> > clone()
const 223 return services::SharedPtr<Online<algorithmFPType, method> >(cloneImpl());
227 virtual Online<algorithmFPType, method> * cloneImpl()
const DAAL_C11_OVERRIDE
229 return new Online<algorithmFPType, method>(*this);
232 virtual services::Status allocateResult() DAAL_C11_OVERRIDE
234 _result.reset(
new ResultType());
235 services::Status s = _result->allocate<algorithmFPType>(_pres, 0, 0);
236 _res = _result.get();
240 virtual services::Status allocatePartialResult() DAAL_C11_OVERRIDE
242 _partialResult.reset(
new PartialResultType());
243 services::Status s = _partialResult->allocate<algorithmFPType>(_in, 0, 0);
244 _pres = _partialResult.get();
248 virtual services::Status initializePartialResult() DAAL_C11_OVERRIDE
250 services::Status s = _partialResult->initialize<algorithmFPType>(_in, 0, 0);
251 _pres = _partialResult.get();
257 Analysis<online>::_ac =
new __DAAL_ALGORITHM_CONTAINER(online, OnlineContainer, algorithmFPType, method)(&_env);
263 PartialResultPtr _partialResult;
268 using interface1::OnlineContainer;
269 using interface1::Online;
daal::algorithms::svd::interface1::Online::parameter
ParameterType parameter
Definition: svd_online.h:126
daal::algorithms::svd::interface1::Online::clone
services::SharedPtr< Online< algorithmFPType, method > > clone() const
Definition: svd_online.h:221
daal::algorithms::svd::interface1::Parameter
Parameters for the computation method of the SVD algorithm.
Definition: svd_types.h:187
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::svd::interface1::Online
Computes results of the SVD algorithm in the online processing mode.
Definition: svd_online.h:114
daal::algorithms::svd::interface1::Result
Provides methods to access final results obtained with the compute() method of the SVD algorithm in t...
Definition: svd_types.h:425
daal::algorithms::svd::interface1::OnlineContainer::compute
services::Status compute() DAAL_C11_OVERRIDE
daal::algorithms::svd::interface1::OnlineContainer::OnlineContainer
OnlineContainer(daal::services::Environment::env *daalEnv)
daal::algorithms::svd::interface1::Online::checkFinalizeComputeParams
services::Status checkFinalizeComputeParams() DAAL_C11_OVERRIDE
Definition: svd_online.h:198
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::svd::interface1::Online::setResult
services::Status setResult(const ResultPtr &res)
Definition: svd_online.h:172
daal::services::interface1::SharedPtr::get
T * get() const
Definition: daal_shared_ptr.h:332
daal::algorithms::svd::interface1::Online::Online
Online(const Online< algorithmFPType, method > &other)
Definition: svd_online.h:139
daal::algorithms::svd::interface1::OnlineContainer
Provides methods to run implementations of the SVD algorithm in the online processing mode...
Definition: svd_online.h:79
daal::algorithms::svd::interface1::Online::input
InputType input
Definition: svd_online.h:125
daal::algorithms::svd::interface1::OnlineContainer::finalizeCompute
services::Status finalizeCompute() DAAL_C11_OVERRIDE
daal::algorithms::Analysis
Provides methods for execution of operations over data, such as computation of Summary Statistics est...
Definition: analysis.h:94
daal::algorithms::svd::interface1::Online::getPartialResult
PartialResultPtr getPartialResult()
Definition: svd_online.h:163
daal::algorithms::svd::interface1::OnlineContainer::~OnlineContainer
virtual ~OnlineContainer()
daal::online
Definition: daal_defines.h:134
daal::algorithms::svd::interface1::Online::setPartialResult
services::Status setPartialResult(const PartialResultPtr &partialResult, bool initFlag=false)
Definition: svd_online.h:186
daal::algorithms::svd::interface1::OnlinePartialResult
Provides methods to access partial results obtained with the compute() method of the SVD algorithm in...
Definition: svd_types.h:342
daal::algorithms::svd::interface1::Online::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: svd_online.h:148
daal::algorithms::svd::interface1::Online::getResult
ResultPtr getResult()
Definition: svd_online.h:154
daal::services::ErrorNullResult
Definition: error_indexes.h:122