49 #ifndef __LOW_ORDER_MOMENTS_ONLINE_H__ 50 #define __LOW_ORDER_MOMENTS_ONLINE_H__ 52 #include "algorithms/algorithm.h" 53 #include "services/daal_defines.h" 54 #include "algorithms/moments/low_order_moments_types.h" 60 namespace low_order_moments
79 template<
typename algorithmFPType, Method method, CpuType cpu>
80 class DAAL_EXPORT OnlineContainer :
public daal::algorithms::AnalysisContainerIface<online>
88 OnlineContainer(daal::services::Environment::env *daalEnv);
90 virtual ~OnlineContainer();
95 virtual services::Status compute() DAAL_C11_OVERRIDE;
100 virtual services::Status finalizeCompute() DAAL_C11_OVERRIDE;
117 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
118 class DAAL_EXPORT Online :
public daal::algorithms::Analysis<online>
121 typedef algorithms::low_order_moments::Input InputType;
122 typedef algorithms::low_order_moments::Parameter ParameterType;
123 typedef algorithms::low_order_moments::Result ResultType;
124 typedef algorithms::low_order_moments::PartialResult PartialResultType;
127 ParameterType parameter;
141 Online(
const Online<algorithmFPType, method> &other) : parameter(other.parameter), input(other.input)
150 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int)method; }
156 ResultPtr getResult()
165 services::Status setResult(
const ResultPtr &result)
167 DAAL_CHECK(result, services::ErrorNullResult)
169 _res = _result.get();
170 return services::Status();
177 PartialResultPtr getPartialResult()
179 return _partialResult;
187 services::Status setPartialResult(
const PartialResultPtr &partialResult,
bool initFlag =
false)
189 _partialResult = partialResult;
190 _pres = _partialResult.get();
191 setInitFlag(initFlag);
192 return services::Status();
200 services::SharedPtr<Online<algorithmFPType, method> > clone()
const 202 return services::SharedPtr<Online<algorithmFPType, method> >(cloneImpl());
206 virtual Online<algorithmFPType, method> *cloneImpl()
const DAAL_C11_OVERRIDE
208 return new Online<algorithmFPType, method>(*this);
211 virtual services::Status allocateResult() DAAL_C11_OVERRIDE
213 services::Status s = _result->allocate<algorithmFPType>(_in, 0, 0);
214 _res = _result.get();
215 _pres = _partialResult.get();
219 virtual services::Status allocatePartialResult() DAAL_C11_OVERRIDE
221 services::Status s = _partialResult->allocate<algorithmFPType>(_in, 0, 0);
222 _pres = _partialResult.get();
226 virtual services::Status initializePartialResult() DAAL_C11_OVERRIDE
228 services::Status s = _partialResult->initialize<algorithmFPType>(_in, 0, 0);
229 _pres = _partialResult.get();
235 Analysis<online>::_ac =
new __DAAL_ALGORITHM_CONTAINER(online, OnlineContainer, algorithmFPType, method)(&_env);
238 _result.reset(
new ResultType());
239 _partialResult.reset(
new PartialResultType());
243 PartialResultPtr _partialResult;
248 using interface1::OnlineContainer;
249 using interface1::Online;
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::low_order_moments::interface1::Online::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: low_order_moments_online.h:150
daal::algorithms::low_order_moments::interface1::Online::setPartialResult
services::Status setPartialResult(const PartialResultPtr &partialResult, bool initFlag=false)
Definition: low_order_moments_online.h:187
daal::algorithms::low_order_moments::interface1::Online::setResult
services::Status setResult(const ResultPtr &result)
Definition: low_order_moments_online.h:165
daal::algorithms::low_order_moments::interface1::Online::input
InputType input
Definition: low_order_moments_online.h:126
daal::algorithms::low_order_moments::interface1::Online
Computes moments of low order in the online processing mode.
Definition: low_order_moments_online.h:118
daal::algorithms::low_order_moments::interface1::OnlineContainer
Provides methods to run implementations of the low order moments algorithm. This class is associated ...
Definition: low_order_moments_online.h:80
daal::algorithms::low_order_moments::interface1::Result
Provides methods to access final results obtained with the compute() method of the low order moments ...
Definition: low_order_moments_types.h:308
daal::algorithms::low_order_moments::interface1::Online::getPartialResult
PartialResultPtr getPartialResult()
Definition: low_order_moments_online.h:177
daal::algorithms::low_order_moments::interface1::Online::getResult
ResultPtr getResult()
Definition: low_order_moments_online.h:156
daal::algorithms::low_order_moments::interface1::Online::Online
Online(const Online< algorithmFPType, method > &other)
Definition: low_order_moments_online.h:141
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::low_order_moments::interface1::Online::clone
services::SharedPtr< Online< algorithmFPType, method > > clone() const
Definition: low_order_moments_online.h:200
daal::services::interface1::SharedPtr::get
T * get() const
Definition: daal_shared_ptr.h:332
daal::algorithms::low_order_moments::interface1::Parameter
Low order moments algorithm parameters.
Definition: low_order_moments_types.h:293
daal::algorithms::low_order_moments::interface1::Online::Online
Online()
Definition: low_order_moments_online.h:130
daal::algorithms::Analysis
Provides methods for execution of operations over data, such as computation of Summary Statistics est...
Definition: analysis.h:94
daal::algorithms::low_order_moments::interface1::Online::parameter
ParameterType parameter
Definition: low_order_moments_online.h:127
daal::online
Definition: daal_defines.h:134
daal::services::ErrorNullResult
Definition: error_indexes.h:122
daal::algorithms::low_order_moments::interface1::PartialResult
Provides methods to access partial results obtained with the compute() method of the low order moment...
Definition: low_order_moments_types.h:211