49 #ifndef __LOW_ORDER_MOMENTS_DISTRIBUTED_H__ 50 #define __LOW_ORDER_MOMENTS_DISTRIBUTED_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
80 template<ComputeStep step,
typename algorithmFPType, Method method, CpuType cpu>
81 class DAAL_EXPORT DistributedContainer
93 template<
typename algorithmFPType, Method method, CpuType cpu>
94 class DAAL_EXPORT DistributedContainer<step2Master, algorithmFPType, method, cpu> :
95 public daal::algorithms::AnalysisContainerIface<distributed>
103 DistributedContainer(daal::services::Environment::env *daalEnv);
105 virtual ~DistributedContainer();
110 virtual services::Status compute() DAAL_C11_OVERRIDE;
115 virtual services::Status finalizeCompute() DAAL_C11_OVERRIDE;
138 template<ComputeStep step,
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
139 class DAAL_EXPORT Distributed{};
156 template<
typename algorithmFPType, Method method>
157 class DAAL_EXPORT Distributed<step1Local, algorithmFPType, method> :
public Online<algorithmFPType, method>
160 typedef Online<algorithmFPType, method> super;
162 typedef typename super::InputType InputType;
163 typedef typename super::ParameterType ParameterType;
164 typedef typename super::ResultType ResultType;
165 typedef typename super::PartialResultType PartialResultType;
177 Distributed(
const Distributed<step1Local, algorithmFPType, method> &other) : Online<algorithmFPType, method>(other)
185 services::SharedPtr<Distributed<step1Local, algorithmFPType, method> > clone()
const 187 return services::SharedPtr<Distributed<step1Local, algorithmFPType, method> >(cloneImpl());
191 virtual Distributed<step1Local, algorithmFPType, method> * cloneImpl()
const DAAL_C11_OVERRIDE
193 return new Distributed<step1Local, algorithmFPType, method>(*this);
212 template<
typename algorithmFPType, Method method>
213 class DAAL_EXPORT Distributed<step2Master, algorithmFPType, method> :
public daal::algorithms::Analysis<distributed>
216 typedef algorithms::low_order_moments::DistributedInput<step2Master> InputType;
217 typedef algorithms::low_order_moments::Parameter ParameterType;
218 typedef algorithms::low_order_moments::Result ResultType;
219 typedef algorithms::low_order_moments::PartialResult PartialResultType;
221 DistributedInput<step2Master> input;
222 ParameterType parameter;
236 Distributed(
const Distributed<step2Master, algorithmFPType, method> &other) : parameter(other.parameter), input(other.input)
245 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int)method; }
251 ResultPtr getResult()
260 services::Status setResult(
const ResultPtr &result)
262 DAAL_CHECK(result, services::ErrorNullResult)
264 _res = _result.get();
265 return services::Status();
272 PartialResultPtr getPartialResult()
274 return _partialResult;
282 services::Status setPartialResult(
const PartialResultPtr &partialResult,
bool initFlag =
false)
284 DAAL_CHECK(partialResult, services::ErrorNullPartialResult);
285 _partialResult = partialResult;
286 _pres = _partialResult.get();
287 setInitFlag(initFlag);
288 return services::Status();
296 services::SharedPtr<Distributed<step2Master, algorithmFPType, method> > clone()
const 298 return services::SharedPtr<Distributed<step2Master, algorithmFPType, method> >(cloneImpl());
302 virtual Distributed<step2Master, algorithmFPType, method> * cloneImpl()
const DAAL_C11_OVERRIDE
304 return new Distributed<step2Master, algorithmFPType, method>(*this);
307 virtual services::Status allocateResult() DAAL_C11_OVERRIDE
309 services::Status s = _result->allocate<algorithmFPType>(_pres, 0, 0);
310 _res = _result.get();
314 virtual services::Status allocatePartialResult() DAAL_C11_OVERRIDE
316 services::Status s = _partialResult->allocate<algorithmFPType>(_in, 0, 0);
317 _pres = _partialResult.get();
321 virtual services::Status initializePartialResult() DAAL_C11_OVERRIDE
323 return services::Status();
328 Analysis<distributed>::_ac =
new __DAAL_ALGORITHM_CONTAINER(distributed, DistributedContainer, step2Master, algorithmFPType, method)(&_env);
331 _result.reset(
new ResultType());
332 _partialResult.reset(
new PartialResultType());
336 PartialResultPtr _partialResult;
341 using interface1::DistributedInput;
342 using interface1::DistributedContainer;
343 using interface1::Distributed;
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::low_order_moments::interface1::Distributed< step2Master, algorithmFPType, method >::parameter
ParameterType parameter
Definition: low_order_moments_distributed.h:222
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::Distributed< step2Master, algorithmFPType, method >
Computes the result of the second step of the moments of low order algorithm in the distributed proce...
Definition: low_order_moments_distributed.h:213
daal::algorithms::low_order_moments::interface1::Distributed< step1Local, algorithmFPType, method >::Distributed
Distributed(const Distributed< step1Local, algorithmFPType, method > &other)
Definition: low_order_moments_distributed.h:177
daal::services::ErrorNullPartialResult
Definition: error_indexes.h:131
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::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::Distributed< step2Master, algorithmFPType, method >::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: low_order_moments_distributed.h:245
daal::algorithms::low_order_moments::interface1::Distributed< step2Master, algorithmFPType, method >::clone
services::SharedPtr< Distributed< step2Master, algorithmFPType, method > > clone() const
Definition: low_order_moments_distributed.h:296
daal::algorithms::low_order_moments::interface1::Distributed< step2Master, algorithmFPType, method >::setResult
services::Status setResult(const ResultPtr &result)
Definition: low_order_moments_distributed.h:260
daal::algorithms::low_order_moments::interface1::Distributed< step1Local, algorithmFPType, method >::clone
services::SharedPtr< Distributed< step1Local, algorithmFPType, method > > clone() const
Definition: low_order_moments_distributed.h:185
daal::algorithms::low_order_moments::interface1::Distributed< step2Master, algorithmFPType, method >::Distributed
Distributed()
Definition: low_order_moments_distributed.h:225
daal::algorithms::kmeans::init::interface1::Distributed
class DAAL_EXPORT Distributed
Computes initial clusters for the K-Means algorithm in the distributed processing mode...
Definition: kmeans_init_distributed.h:281
daal::distributed
Definition: daal_defines.h:133
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::algorithms::low_order_moments::interface1::Distributed< step2Master, algorithmFPType, method >::input
DistributedInput< step2Master > input
Definition: low_order_moments_distributed.h:221
daal::algorithms::low_order_moments::interface1::Distributed< step2Master, algorithmFPType, method >::getPartialResult
PartialResultPtr getPartialResult()
Definition: low_order_moments_distributed.h:272
daal::algorithms::low_order_moments::interface1::Distributed< step2Master, algorithmFPType, method >::Distributed
Distributed(const Distributed< step2Master, algorithmFPType, method > &other)
Definition: low_order_moments_distributed.h:236
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::DistributedContainer
Provides methods to run implementations of the low order moments algorithm in the distributed process...
Definition: low_order_moments_distributed.h:81
daal::algorithms::low_order_moments::interface1::Distributed< step2Master, algorithmFPType, method >::getResult
ResultPtr getResult()
Definition: low_order_moments_distributed.h:251
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::Distributed< step2Master, algorithmFPType, method >::setPartialResult
services::Status setPartialResult(const PartialResultPtr &partialResult, bool initFlag=false)
Definition: low_order_moments_distributed.h:282
daal::algorithms::kmeans::interface1::DistributedContainer
class DAAL_EXPORT DistributedContainer
Provides methods to run implementations of the K-Means algorithm. This class is associated with the d...
Definition: kmeans_distributed.h:81
daal::step1Local
Definition: daal_defines.h:143
daal::algorithms::low_order_moments::interface1::Distributed
Computes moments of low order in the distributed processing mode.
Definition: low_order_moments_distributed.h:139
daal::step2Master
Definition: daal_defines.h:144
daal::algorithms::low_order_moments::interface1::Distributed< step1Local, algorithmFPType, method >
Computes the result of the first step of the moments of low order algorithm in the distributed proces...
Definition: low_order_moments_distributed.h:157
daal::services::ErrorNullResult
Definition: error_indexes.h:122
daal::algorithms::low_order_moments::interface1::Distributed< step1Local, algorithmFPType, method >::Distributed
Distributed()
Definition: low_order_moments_distributed.h:168
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