24 #ifndef __BERNOULLI_H__
25 #define __BERNOULLI_H__
27 #include "algorithms/distributions/distribution.h"
28 #include "algorithms/distributions/bernoulli/bernoulli_types.h"
34 namespace distributions
55 template<
typename algorithmFPType, Method method, CpuType cpu>
56 class BatchContainer :
public daal::algorithms::AnalysisContainerIface<batch>
64 BatchContainer(daal::services::Environment::env *daalEnv);
71 services::Status compute() DAAL_C11_OVERRIDE;
88 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
89 class DAAL_EXPORT Batch :
public distributions::BatchBase
92 typedef distributions::BatchBase super;
94 typedef typename super::InputType InputType;
95 typedef algorithms::distributions::bernoulli::Parameter<algorithmFPType> ParameterType;
96 typedef typename super::ResultType ResultType;
102 Batch(algorithmFPType p) : parameter(p)
111 Batch(
const Batch<algorithmFPType, method> &other): super(other), parameter(other.parameter)
120 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int) method; }
126 ResultPtr getResult() {
return _result; }
134 services::Status setResult(
const ResultPtr& result)
136 DAAL_CHECK(result, services::ErrorNullResult)
138 _res = _result.get();
139 return services::Status();
147 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
149 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
157 virtual services::Status allocateResult() DAAL_C11_OVERRIDE
160 services::Status s = this->_result->template allocate<algorithmFPType>(&(this->input), ¶meter, (
int) method);
161 this->_res = this->_result.get();
165 Parameter<algorithmFPType> parameter;
168 virtual Batch<algorithmFPType, method> *cloneImpl() const DAAL_C11_OVERRIDE
170 return new Batch<algorithmFPType, method>(*this);
175 Analysis<batch>::_ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
178 _result.reset(
new ResultType());
186 using interface1::BatchContainer;
187 using interface1::Batch;
daal::algorithms::distributions::bernoulli::interface1::Batch::allocateResult
virtual services::Status allocateResult() DAAL_C11_OVERRIDE
Definition: bernoulli.h:157
daal::algorithms::distributions::bernoulli::interface1::Batch::Batch
Batch(const Batch< algorithmFPType, method > &other)
Definition: bernoulli.h:111
daal::batch
Definition: daal_defines.h:112
daal::algorithms::distributions::bernoulli::interface1::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: bernoulli.h:120
daal::algorithms::distributions::bernoulli::interface1::BatchContainer
Provides methods to run implementations of the bernoulli distribution. This class is associated with ...
Definition: bernoulli.h:56
daal::algorithms::distributions::bernoulli::interface1::Batch::setResult
services::Status setResult(const ResultPtr &result)
Definition: bernoulli.h:134
daal::algorithms::distributions::bernoulli::interface1::Batch::parameter
Parameter< algorithmFPType > parameter
Definition: bernoulli.h:165
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::distributions::bernoulli::interface1::Batch::getResult
ResultPtr getResult()
Definition: bernoulli.h:126
daal::algorithms::distributions::bernoulli::interface1::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: bernoulli.h:147
daal::algorithms::distributions::bernoulli::interface1::Parameter
Bernoulli distribution parameters.
Definition: bernoulli_types.h:66
daal::algorithms::distributions::bernoulli::interface1::BatchContainer::compute
services::Status compute() DAAL_C11_OVERRIDE
daal::algorithms::distributions::bernoulli::interface1::BatchContainer::BatchContainer
BatchContainer(daal::services::Environment::env *daalEnv)
daal::algorithms::Analysis
Provides methods for execution of operations over data, such as computation of Summary Statistics est...
Definition: analysis.h:70
daal::algorithms::distributions::bernoulli::interface1::Batch
Provides methods for bernoulli distribution computations in the batch processing mode.
Definition: bernoulli.h:89
daal::algorithms::distributions::bernoulli::interface1::Batch::Batch
Batch(algorithmFPType p)
Definition: bernoulli.h:102