49 #ifndef __LOW_ORDER_MOMENTS_BATCH_H__ 50 #define __LOW_ORDER_MOMENTS_BATCH_H__ 52 #include "algorithms/algorithm.h" 53 #include "data_management/data/numeric_table.h" 54 #include "services/daal_defines.h" 55 #include "algorithms/moments/low_order_moments_types.h" 61 namespace low_order_moments
75 class BatchContainerIface :
public daal::algorithms::AnalysisContainerIface<batch>
78 BatchContainerIface() {};
79 virtual ~BatchContainerIface() {}
84 virtual services::Status compute() = 0;
95 template<
typename algorithmFPType, Method method, CpuType cpu>
96 class DAAL_EXPORT BatchContainer :
public BatchContainerIface
104 BatchContainer(daal::services::Environment::env *daalEnv);
106 virtual ~BatchContainer();
110 virtual services::Status compute() DAAL_C11_OVERRIDE;
118 class DAAL_EXPORT BatchImpl :
public daal::algorithms::Analysis<batch>
121 typedef algorithms::low_order_moments::Input InputType;
122 typedef algorithms::low_order_moments::Parameter ParameterType;
123 typedef algorithms::low_order_moments::Result ResultType;
137 BatchImpl(
const BatchImpl &other) : parameter(other.parameter), input(other.input)
146 ResultPtr getResult()
155 virtual services::Status setResult(
const ResultPtr &result)
157 DAAL_CHECK(result, services::ErrorNullResult)
159 _res = _result.get();
160 return services::Status();
168 services::SharedPtr<BatchImpl> clone()
const 170 return services::SharedPtr<BatchImpl>(cloneImpl());
173 virtual ~BatchImpl() {}
176 ParameterType parameter;
183 _result.reset(
new ResultType());
187 virtual BatchImpl *cloneImpl()
const DAAL_C11_OVERRIDE = 0;
207 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
208 class DAAL_EXPORT Batch :
public BatchImpl
211 typedef BatchImpl super;
213 typedef typename super::InputType InputType;
214 typedef typename super::ParameterType ParameterType;
215 typedef typename super::ResultType ResultType;
229 Batch(
const Batch<algorithmFPType, method> &other) : BatchImpl(other)
240 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int)method; }
247 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const 249 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
253 virtual Batch<algorithmFPType, method> *cloneImpl()
const DAAL_C11_OVERRIDE
255 return new Batch<algorithmFPType, method>(*this);
258 virtual services::Status allocateResult() DAAL_C11_OVERRIDE
260 services::Status s = _result->allocate<algorithmFPType>(&input, 0, 0);
261 _res = _result.get();
267 this->_ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
272 using interface1::BatchContainerIface;
273 using interface1::BatchContainer;
274 using interface1::BatchImpl;
275 using interface1::Batch;
daal::algorithms::low_order_moments::interface1::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: low_order_moments_batch.h:247
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::BatchContainerIface::compute
virtual services::Status compute()=0
daal::algorithms::low_order_moments::interface1::Batch::Batch
Batch()
Definition: low_order_moments_batch.h:218
daal::algorithms::low_order_moments::interface1::BatchImpl::BatchImpl
BatchImpl()
Definition: low_order_moments_batch.h:126
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:75
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::Batch::Batch
Batch(const Batch< algorithmFPType, method > &other)
Definition: low_order_moments_batch.h:229
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:118
daal::algorithms::low_order_moments::interface1::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: low_order_moments_batch.h:240
daal::batch
Definition: daal_defines.h:132
daal::algorithms::low_order_moments::interface1::BatchImpl::clone
services::SharedPtr< BatchImpl > clone() const
Definition: low_order_moments_batch.h:168
daal::algorithms::low_order_moments::interface1::BatchImpl::getResult
ResultPtr getResult()
Definition: low_order_moments_batch.h:146
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::services::interface1::SharedPtr::get
T * get() const
Definition: daal_shared_ptr.h:332
daal::services::interface1::SharedPtr::reset
void reset()
Definition: daal_shared_ptr.h:265
daal::algorithms::low_order_moments::interface1::Parameter
Low order moments algorithm parameters.
Definition: low_order_moments_types.h:293
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::Batch
Computes moments of low order in the batch processing mode.
Definition: low_order_moments_batch.h:208
daal::algorithms::low_order_moments::interface1::BatchImpl::parameter
ParameterType parameter
Definition: low_order_moments_batch.h:176
daal::algorithms::low_order_moments::interface1::BatchImpl::setResult
virtual services::Status setResult(const ResultPtr &result)
Definition: low_order_moments_batch.h:155
daal::algorithms::low_order_moments::interface1::BatchImpl::BatchImpl
BatchImpl(const BatchImpl &other)
Definition: low_order_moments_batch.h:137
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:96
daal::services::ErrorNullResult
Definition: error_indexes.h:122
daal::algorithms::low_order_moments::interface1::BatchImpl::input
InputType input
Definition: low_order_moments_batch.h:175