49 #ifndef __KMEANS_INIT_BATCH_H__ 50 #define __KMEANS_INIT_BATCH_H__ 52 #include "algorithms/algorithm.h" 53 #include "data_management/data/numeric_table.h" 54 #include "services/daal_defines.h" 55 #include "algorithms/kmeans/kmeans_init_types.h" 82 template<
typename algorithmFPType, Method method, CpuType cpu>
83 class DAAL_EXPORT BatchContainer :
public daal::algorithms::AnalysisContainerIface<batch>
91 BatchContainer(daal::services::Environment::env *daalEnv);
93 virtual ~BatchContainer();
97 virtual services::Status compute() DAAL_C11_OVERRIDE;
113 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
114 class DAAL_EXPORT Batch :
public daal::algorithms::Analysis<batch>
117 typedef algorithms::kmeans::init::Input InputType;
118 typedef algorithms::kmeans::init::Parameter ParameterType;
119 typedef algorithms::kmeans::init::Result ResultType;
125 Batch(
size_t nClusters) : parameter(nClusters)
136 Batch(
const Batch<algorithmFPType, method> &other) : parameter(other.parameter)
139 input.set(data, other.input.get(data));
146 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int) method; }
152 ResultPtr getResult()
161 services::Status setResult(
const ResultPtr& result)
163 DAAL_CHECK(result, services::ErrorNullResult)
165 _res = _result.get();
166 return services::Status();
174 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const 176 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
180 virtual Batch<algorithmFPType, method> * cloneImpl()
const DAAL_C11_OVERRIDE
182 return new Batch<algorithmFPType, method>(*this);
185 virtual services::Status allocateResult() DAAL_C11_OVERRIDE
187 _result.reset(
new ResultType());
188 size_t nFeatures = input.getNumberOfFeatures();
189 services::Status s = _result->allocate<algorithmFPType>(_in, _par, (int) method);
190 _res = _result.get();
196 Analysis<batch>::_ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
203 ParameterType parameter;
210 using interface1::BatchContainer;
211 using interface1::Batch;
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::kmeans::init::interface1::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: kmeans_init_batch.h:146
daal::algorithms::AnalysisContainerIface
Abstract interface class that provides virtual methods to access and run implementations of the analy...
Definition: analysis.h:79
daal::algorithms::kmeans::init::interface1::Batch
Computes initial clusters for the K-Means algorithm in the batch processing mode. ...
Definition: kmeans_init_batch.h:114
daal::algorithms::kmeans::init::interface1::Batch::parameter
ParameterType parameter
Definition: kmeans_init_batch.h:203
daal::algorithms::kmeans::init::interface1::Batch::setResult
services::Status setResult(const ResultPtr &result)
Definition: kmeans_init_batch.h:161
daal::batch
Definition: daal_defines.h:132
daal::algorithms::kmeans::init::interface1::Batch::Batch
Batch(const Batch< algorithmFPType, method > &other)
Definition: kmeans_init_batch.h:136
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::kmeans::init::interface1::Result
Results obtained with the compute() method that computes initial centroids for the K-Means algorithm ...
Definition: kmeans_init_types.h:450
daal::algorithms::kmeans::init::interface1::Batch::getResult
ResultPtr getResult()
Definition: kmeans_init_batch.h:152
daal::algorithms::kmeans::init::interface1::Parameter
Parameters for computing initial centroids for the K-Means algorithm.
Definition: kmeans_init_types.h:293
daal::algorithms::kmeans::init::interface1::Batch::Batch
Batch(size_t nClusters)
Definition: kmeans_init_batch.h:125
daal::algorithms::Analysis
Provides methods for execution of operations over data, such as computation of Summary Statistics est...
Definition: analysis.h:94
daal::algorithms::kmeans::init::interface1::BatchContainer
Provides methods to run implementations of initialization of the K-Means algorithm. This class is associated with the daal::algorithms::kmeans::init::Batch class and supports the method of computing initial clusters for the K-Means algorithm in the batch processing mode.
Definition: kmeans_init_batch.h:83
daal::services::ErrorNullResult
Definition: error_indexes.h:122
daal::algorithms::kmeans::init::data
Definition: kmeans_init_types.h:109
daal::algorithms::kmeans::init::interface1::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: kmeans_init_batch.h:174
daal::algorithms::kmeans::init::interface1::Batch::input
InputType input
Definition: kmeans_init_batch.h:202