25 #ifndef __LOW_ORDER_MOMENTS_BATCH_H__
26 #define __LOW_ORDER_MOMENTS_BATCH_H__
28 #include "algorithms/algorithm.h"
29 #include "data_management/data/numeric_table.h"
30 #include "services/daal_defines.h"
31 #include "algorithms/moments/low_order_moments_types.h"
37 namespace low_order_moments
51 class BatchContainerIface :
public daal::algorithms::AnalysisContainerIface<batch>
54 BatchContainerIface() {}
55 virtual ~BatchContainerIface() {}
60 virtual services::Status compute() = 0;
71 template<
typename algorithmFPType, Method method, CpuType cpu>
72 class BatchContainer :
public BatchContainerIface
80 BatchContainer(daal::services::Environment::env *daalEnv);
82 virtual ~BatchContainer();
86 virtual services::Status compute() DAAL_C11_OVERRIDE;
94 class DAAL_EXPORT BatchImpl :
public daal::algorithms::Analysis<batch>
97 typedef algorithms::low_order_moments::Input InputType;
98 typedef algorithms::low_order_moments::Parameter ParameterType;
99 typedef algorithms::low_order_moments::Result ResultType;
113 BatchImpl(
const BatchImpl &other) : parameter(other.parameter), input(other.input)
122 ResultPtr getResult()
131 virtual services::Status setResult(
const ResultPtr &result)
133 DAAL_CHECK(result, services::ErrorNullResult)
135 _res = _result.get();
136 return services::Status();
144 services::SharedPtr<BatchImpl> clone()
const
146 return services::SharedPtr<BatchImpl>(cloneImpl());
149 virtual ~BatchImpl() {}
152 ParameterType parameter;
159 _result.reset(
new ResultType());
163 virtual BatchImpl *cloneImpl() const DAAL_C11_OVERRIDE = 0;
183 template<typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
184 class DAAL_EXPORT Batch : public BatchImpl
187 typedef BatchImpl super;
189 typedef typename super::InputType InputType;
190 typedef typename super::ParameterType ParameterType;
191 typedef typename super::ResultType ResultType;
205 Batch(
const Batch<algorithmFPType, method> &other) : BatchImpl(other)
216 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int)method; }
223 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
225 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
229 virtual Batch<algorithmFPType, method> *cloneImpl() const DAAL_C11_OVERRIDE
231 return new Batch<algorithmFPType, method>(*this);
234 virtual services::Status allocateResult() DAAL_C11_OVERRIDE
236 services::Status s = _result->allocate<algorithmFPType>(&input, 0, 0);
237 _res = _result.get();
243 this->_ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
248 using interface1::BatchContainerIface;
249 using interface1::BatchContainer;
250 using interface1::BatchImpl;
251 using interface1::Batch;
daal::batch
Definition: daal_defines.h:112
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:94
daal::algorithms::low_order_moments::interface1::BatchImpl::BatchImpl
BatchImpl(const BatchImpl &other)
Definition: low_order_moments_batch.h:113
daal::algorithms::low_order_moments::interface1::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: low_order_moments_batch.h:223
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:72
daal::algorithms::low_order_moments::interface1::BatchImpl::getResult
ResultPtr getResult()
Definition: low_order_moments_batch.h:122
daal::algorithms::low_order_moments::interface1::BatchImpl::parameter
ParameterType parameter
Definition: low_order_moments_batch.h:152
daal::algorithms::low_order_moments::interface1::Batch::Batch
Batch()
Definition: low_order_moments_batch.h:194
daal::services::ErrorNullResult
Definition: error_indexes.h:98
daal::algorithms::AnalysisContainerIface
Abstract interface class that provides virtual methods to access and run implementations of the analy...
Definition: analysis.h:55
daal::algorithms::low_order_moments::interface1::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: low_order_moments_batch.h:216
daal::algorithms::low_order_moments::Method
Method
Definition: low_order_moments_types.h:48
daal::algorithms::low_order_moments::interface1::BatchContainer::BatchContainer
BatchContainer(daal::services::Environment::env *daalEnv)
daal::algorithms::low_order_moments::interface1::BatchImpl::input
InputType input
Definition: low_order_moments_batch.h:151
daal::algorithms::low_order_moments::interface1::BatchContainerIface::compute
virtual services::Status compute()=0
daal::algorithms::low_order_moments::defaultDense
Definition: low_order_moments_types.h:50
daal::algorithms::low_order_moments::interface1::BatchImpl::clone
services::SharedPtr< BatchImpl > clone() const
Definition: low_order_moments_batch.h:144
daal::algorithms::low_order_moments::interface1::Batch::Batch
Batch(const Batch< algorithmFPType, method > &other)
Definition: low_order_moments_batch.h:205
daal::algorithms::low_order_moments::interface1::BatchContainer::compute
virtual services::Status compute() DAAL_C11_OVERRIDE
daal::algorithms::low_order_moments::interface1::BatchImpl::setResult
virtual services::Status setResult(const ResultPtr &result)
Definition: low_order_moments_batch.h:131
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:51
daal::algorithms::low_order_moments::interface1::Batch
Computes moments of low order in the batch processing mode.
Definition: low_order_moments_batch.h:184
daal::algorithms::Analysis
Provides methods for execution of operations over data, such as computation of Summary Statistics est...
Definition: analysis.h:70
daal::algorithms::low_order_moments::interface1::BatchContainer::~BatchContainer
virtual ~BatchContainer()
daal::algorithms::low_order_moments::interface1::BatchImpl::BatchImpl
BatchImpl()
Definition: low_order_moments_batch.h:102