23 #ifndef __LOW_ORDER_MOMENTS_BATCH_H__
24 #define __LOW_ORDER_MOMENTS_BATCH_H__
26 #include "algorithms/algorithm.h"
27 #include "data_management/data/numeric_table.h"
28 #include "services/daal_defines.h"
29 #include "algorithms/moments/low_order_moments_types.h"
35 namespace low_order_moments
49 class BatchContainerIface :
public daal::algorithms::AnalysisContainerIface<batch>
52 BatchContainerIface() {};
53 virtual ~BatchContainerIface() {}
58 virtual services::Status compute() = 0;
69 template<
typename algorithmFPType, Method method, CpuType cpu>
70 class DAAL_EXPORT BatchContainer :
public BatchContainerIface
78 BatchContainer(daal::services::Environment::env *daalEnv);
80 virtual ~BatchContainer();
84 virtual services::Status compute() DAAL_C11_OVERRIDE;
92 class DAAL_EXPORT BatchImpl :
public daal::algorithms::Analysis<batch>
95 typedef algorithms::low_order_moments::Input InputType;
96 typedef algorithms::low_order_moments::Parameter ParameterType;
97 typedef algorithms::low_order_moments::Result ResultType;
111 BatchImpl(
const BatchImpl &other) : parameter(other.parameter), input(other.input)
120 ResultPtr getResult()
129 virtual services::Status setResult(
const ResultPtr &result)
131 DAAL_CHECK(result, services::ErrorNullResult)
133 _res = _result.get();
134 return services::Status();
142 services::SharedPtr<BatchImpl> clone()
const
144 return services::SharedPtr<BatchImpl>(cloneImpl());
147 virtual ~BatchImpl() {}
150 ParameterType parameter;
157 _result.reset(
new ResultType());
161 virtual BatchImpl *cloneImpl() const DAAL_C11_OVERRIDE = 0;
181 template<typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
182 class DAAL_EXPORT Batch : public BatchImpl
185 typedef BatchImpl super;
187 typedef typename super::InputType InputType;
188 typedef typename super::ParameterType ParameterType;
189 typedef typename super::ResultType ResultType;
203 Batch(
const Batch<algorithmFPType, method> &other) : BatchImpl(other)
214 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int)method; }
221 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
223 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
227 virtual Batch<algorithmFPType, method> *cloneImpl() const DAAL_C11_OVERRIDE
229 return new Batch<algorithmFPType, method>(*this);
232 virtual services::Status allocateResult() DAAL_C11_OVERRIDE
234 services::Status s = _result->allocate<algorithmFPType>(&input, 0, 0);
235 _res = _result.get();
241 this->_ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
246 using interface1::BatchContainerIface;
247 using interface1::BatchContainer;
248 using interface1::BatchImpl;
249 using interface1::Batch;
daal
Definition: algorithm_base_common.h:31
daal::algorithms::AnalysisContainerIface
Abstract interface class that provides virtual methods to access and run implementations of the analy...
Definition: analysis.h:53
daal::algorithms::low_order_moments::interface1::BatchImpl::clone
services::SharedPtr< BatchImpl > clone() const
Definition: low_order_moments_batch.h:142
daal::algorithms::low_order_moments::defaultDense
Definition: low_order_moments_types.h:48
daal::algorithms::low_order_moments::interface1::BatchContainerIface::compute
virtual services::Status compute()=0
daal::algorithms::low_order_moments::interface1::Batch::Batch
Batch()
Definition: low_order_moments_batch.h:192
daal::algorithms::low_order_moments::interface1::BatchImpl::BatchImpl
BatchImpl()
Definition: low_order_moments_batch.h:100
daal::algorithms::low_order_moments::interface1::BatchContainerIface
Class that specifies interfaces of implementations of the low order moments algorithm.
Definition: low_order_moments_batch.h:49
daal::algorithms::low_order_moments::interface1::Batch::Batch
Batch(const Batch< algorithmFPType, method > &other)
Definition: low_order_moments_batch.h:203
daal::algorithms::low_order_moments::interface1::BatchImpl
Abstract class that specifies interface of the algorithms for computing moments of low order in the b...
Definition: low_order_moments_batch.h:92
daal::algorithms::low_order_moments::interface1::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: low_order_moments_batch.h:214
daal::batch
Definition: daal_defines.h:106
daal::algorithms::low_order_moments::interface1::BatchImpl::getResult
ResultPtr getResult()
Definition: low_order_moments_batch.h:120
daal::algorithms::Analysis
Provides methods for execution of operations over data, such as computation of Summary Statistics est...
Definition: analysis.h:68
daal::algorithms::low_order_moments::interface1::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: low_order_moments_batch.h:221
daal::algorithms::low_order_moments::interface1::Batch
Computes moments of low order in the batch processing mode.
Definition: low_order_moments_batch.h:182
daal::algorithms::low_order_moments::interface1::BatchImpl::parameter
ParameterType parameter
Definition: low_order_moments_batch.h:150
daal::algorithms::low_order_moments::interface1::BatchImpl::setResult
virtual services::Status setResult(const ResultPtr &result)
Definition: low_order_moments_batch.h:129
daal::algorithms::low_order_moments::interface1::BatchImpl::BatchImpl
BatchImpl(const BatchImpl &other)
Definition: low_order_moments_batch.h:111
daal::algorithms::low_order_moments::Method
Method
Definition: low_order_moments_types.h:46
daal::algorithms::low_order_moments::interface1::BatchContainer
Provides methods to run implementations of the low order moments algorithm. This class is associated ...
Definition: low_order_moments_batch.h:70
daal::services::ErrorNullResult
Definition: error_indexes.h:96
daal::algorithms::low_order_moments::interface1::BatchImpl::input
InputType input
Definition: low_order_moments_batch.h:149