22 #ifndef __BERNOULLI_H__
23 #define __BERNOULLI_H__
25 #include "algorithms/distributions/distribution.h"
26 #include "algorithms/distributions/bernoulli/bernoulli_types.h"
32 namespace distributions
53 template<
typename algorithmFPType, Method method, CpuType cpu>
54 class DAAL_EXPORT BatchContainer :
public daal::algorithms::AnalysisContainerIface<batch>
62 BatchContainer(daal::services::Environment::env *daalEnv);
69 services::Status compute() DAAL_C11_OVERRIDE;
86 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
87 class DAAL_EXPORT Batch :
public distributions::BatchBase
90 typedef distributions::BatchBase super;
92 typedef typename super::InputType InputType;
93 typedef algorithms::distributions::bernoulli::Parameter<algorithmFPType> ParameterType;
94 typedef typename super::ResultType ResultType;
100 Batch(algorithmFPType p) : parameter(p)
109 Batch(
const Batch<algorithmFPType, method> &other): super(other), parameter(other.parameter)
118 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int) method; }
124 ResultPtr getResult() {
return _result; }
132 services::Status setResult(
const ResultPtr& result)
134 DAAL_CHECK(result, services::ErrorNullResult)
136 _res = _result.get();
137 return services::Status();
145 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
147 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
155 virtual services::Status allocateResult() DAAL_C11_OVERRIDE
158 services::Status s = this->_result->template allocate<algorithmFPType>(&(this->input), ¶meter, (
int) method);
159 this->_res = this->_result.get();
163 Parameter<algorithmFPType> parameter;
166 virtual Batch<algorithmFPType, method> *cloneImpl() const DAAL_C11_OVERRIDE
168 return new Batch<algorithmFPType, method>(*this);
173 Analysis<batch>::_ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
176 _result.reset(
new ResultType());
184 using interface1::BatchContainer;
185 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::distributions::bernoulli::interface1::Batch
Provides methods for bernoulli distribution computations in the batch processing mode.
Definition: bernoulli.h:87
daal::algorithms::distributions::bernoulli::interface1::Parameter
Bernoulli distribution parameters.
Definition: bernoulli_types.h:64
daal::algorithms::distributions::bernoulli::interface1::Batch::getResult
ResultPtr getResult()
Definition: bernoulli.h:124
daal::algorithms::distributions::bernoulli::interface1::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: bernoulli.h:145
daal::batch
Definition: daal_defines.h:110
daal::algorithms::distributions::bernoulli::interface1::Batch::Batch
Batch(algorithmFPType p)
Definition: bernoulli.h:100
daal::algorithms::Analysis
Provides methods for execution of operations over data, such as computation of Summary Statistics est...
Definition: analysis.h:68
daal::algorithms::distributions::bernoulli::interface1::BatchContainer
Provides methods to run implementations of the bernoulli distribution. This class is associated with ...
Definition: bernoulli.h:54
daal::algorithms::distributions::bernoulli::interface1::Batch::allocateResult
virtual services::Status allocateResult() DAAL_C11_OVERRIDE
Definition: bernoulli.h:155
daal::algorithms::distributions::bernoulli::interface1::Batch::parameter
Parameter< algorithmFPType > parameter
Definition: bernoulli.h:163
daal::algorithms::distributions::bernoulli::interface1::Batch::Batch
Batch(const Batch< algorithmFPType, method > &other)
Definition: bernoulli.h:109
daal::services::ErrorNullResult
Definition: error_indexes.h:96
daal::algorithms::distributions::bernoulli::interface1::Batch::setResult
services::Status setResult(const ResultPtr &result)
Definition: bernoulli.h:132
daal::algorithms::distributions::bernoulli::interface1::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: bernoulli.h:118