49 #ifndef __COVARIANCE_BATCH_H__ 50 #define __COVARIANCE_BATCH_H__ 52 #include "algorithms/algorithm.h" 53 #include "data_management/data/numeric_table.h" 54 #include "services/daal_defines.h" 55 #include "algorithms/covariance/covariance_types.h" 76 class BatchContainerIface :
public daal::algorithms::AnalysisContainerIface<batch>
80 BatchContainerIface() {};
82 virtual ~BatchContainerIface() {}
88 virtual services::Status compute() = 0;
99 template<
typename algorithmFPType, Method method, CpuType cpu>
100 class DAAL_EXPORT BatchContainer
111 template<
typename algorithmFPType, CpuType cpu>
112 class DAAL_EXPORT BatchContainer<algorithmFPType, defaultDense, cpu> :
public BatchContainerIface
120 BatchContainer(daal::services::Environment::env *daalEnv);
122 virtual ~BatchContainer();
128 virtual services::Status compute() DAAL_C11_OVERRIDE;
139 template<
typename algorithmFPType, CpuType cpu>
140 class DAAL_EXPORT BatchContainer<algorithmFPType, singlePassDense, cpu> :
public BatchContainerIface
148 BatchContainer(daal::services::Environment::env *daalEnv);
150 virtual ~BatchContainer();
156 virtual services::Status compute() DAAL_C11_OVERRIDE;
167 template<
typename algorithmFPType, CpuType cpu>
168 class DAAL_EXPORT BatchContainer<algorithmFPType, sumDense, cpu> :
public BatchContainerIface
176 BatchContainer(daal::services::Environment::env *daalEnv);
178 virtual ~BatchContainer();
184 virtual services::Status compute() DAAL_C11_OVERRIDE;
195 template<
typename algorithmFPType, CpuType cpu>
196 class DAAL_EXPORT BatchContainer<algorithmFPType, fastCSR, cpu> :
public BatchContainerIface
204 BatchContainer(daal::services::Environment::env *daalEnv);
206 virtual ~BatchContainer();
212 virtual services::Status compute() DAAL_C11_OVERRIDE;
223 template<
typename algorithmFPType, CpuType cpu>
224 class DAAL_EXPORT BatchContainer<algorithmFPType, singlePassCSR, cpu> :
public BatchContainerIface
232 BatchContainer(daal::services::Environment::env *daalEnv);
234 virtual ~BatchContainer();
240 virtual services::Status compute() DAAL_C11_OVERRIDE;
251 template<
typename algorithmFPType, CpuType cpu>
252 class DAAL_EXPORT BatchContainer<algorithmFPType, sumCSR, cpu> :
public BatchContainerIface
260 BatchContainer(daal::services::Environment::env *daalEnv);
262 virtual ~BatchContainer();
268 virtual services::Status compute() DAAL_C11_OVERRIDE;
276 class DAAL_EXPORT BatchImpl :
public daal::algorithms::Analysis<batch>
279 typedef algorithms::covariance::Input InputType;
280 typedef algorithms::covariance::Parameter ParameterType;
281 typedef algorithms::covariance::Result ResultType;
296 BatchImpl(
const BatchImpl &other) : input(other.input), parameter(other.parameter)
305 ResultPtr getResult()
314 virtual services::Status setResult(
const ResultPtr &result)
316 DAAL_CHECK(result, services::ErrorNullResult)
318 _res = _result.get();
319 return services::Status();
328 services::SharedPtr<BatchImpl> clone()
const 330 return services::SharedPtr<BatchImpl>(cloneImpl());
333 virtual ~BatchImpl() {}
336 ParameterType parameter;
343 _result.reset(
new ResultType());
347 virtual BatchImpl * cloneImpl()
const DAAL_C11_OVERRIDE = 0;
368 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
369 class DAAL_EXPORT Batch :
public BatchImpl
372 typedef BatchImpl super;
374 typedef typename super::InputType InputType;
375 typedef typename super::ParameterType ParameterType;
376 typedef typename super::ResultType ResultType;
391 Batch(
const Batch<algorithmFPType, method> &other) : BatchImpl(other)
402 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int)method; }
410 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const 412 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
416 virtual Batch<algorithmFPType, method> * cloneImpl()
const DAAL_C11_OVERRIDE
418 return new Batch<algorithmFPType, method>(*this);
421 virtual services::Status allocateResult() DAAL_C11_OVERRIDE
423 services::Status s = _result->allocate<algorithmFPType>(&input, _par, (int)method);
424 _res = _result.get();
430 this->_ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
435 using interface1::BatchContainerIface;
436 using interface1::BatchContainer;
437 using interface1::BatchImpl;
438 using interface1::Batch;
443 #endif // __COVARIANCE_BATCH_H__ daal::algorithms::covariance::singlePassCSR
Definition: covariance_types.h:80
daal::algorithms::covariance::interface1::BatchImpl::clone
services::SharedPtr< BatchImpl > clone() const
Definition: covariance_batch.h:328
daal::algorithms::covariance::interface1::BatchContainerIface
Class that specifies interfaces of implementations of the correlation or variance-covariance matrix c...
Definition: covariance_batch.h:76
daal::algorithms::covariance::interface1::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: covariance_batch.h:410
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::covariance::interface1::BatchContainer
Provides methods to run implementations of the correlation or variance-covariance matrix algorithm...
Definition: covariance_batch.h:100
daal::algorithms::AnalysisContainerIface
Abstract interface class that provides virtual methods to access and run implementations of the analy...
Definition: analysis.h:79
daal::algorithms::covariance::interface1::Parameter
Parameters of the correlation or variance-covariance matrix algorithm.
Definition: covariance_types.h:284
daal::algorithms::covariance::interface1::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: covariance_batch.h:402
daal::algorithms::covariance::interface1::BatchImpl::BatchImpl
BatchImpl()
Definition: covariance_batch.h:284
daal::algorithms::covariance::sumDense
Definition: covariance_types.h:77
daal::algorithms::covariance::interface1::Batch::Batch
Batch()
Definition: covariance_batch.h:379
daal::algorithms::covariance::interface1::BatchImpl::input
InputType input
Definition: covariance_batch.h:335
daal::algorithms::covariance::fastCSR
Definition: covariance_types.h:79
daal::batch
Definition: daal_defines.h:132
daal::algorithms::covariance::interface1::BatchContainerIface::~BatchContainerIface
virtual ~BatchContainerIface()
Definition: covariance_batch.h:82
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::algorithms::covariance::interface1::Result
Provides methods to access final results obtained with the compute() method of the correlation or var...
Definition: covariance_types.h:317
daal::algorithms::covariance::interface1::BatchImpl::getResult
ResultPtr getResult()
Definition: covariance_batch.h:305
daal::services::interface1::SharedPtr::get
T * get() const
Definition: daal_shared_ptr.h:332
daal::algorithms::covariance::sumCSR
Definition: covariance_types.h:82
daal::algorithms::covariance::interface1::BatchImpl::setResult
virtual services::Status setResult(const ResultPtr &result)
Definition: covariance_batch.h:314
daal::services::interface1::SharedPtr::reset
void reset()
Definition: daal_shared_ptr.h:265
daal::algorithms::covariance::interface1::BatchContainerIface::BatchContainerIface
BatchContainerIface()
Definition: covariance_batch.h:80
daal::algorithms::Analysis
Provides methods for execution of operations over data, such as computation of Summary Statistics est...
Definition: analysis.h:94
daal::algorithms::covariance::covariance
Definition: covariance_types.h:114
daal::algorithms::covariance::interface1::BatchImpl::parameter
ParameterType parameter
Definition: covariance_batch.h:336
daal::algorithms::covariance::interface1::BatchImpl::BatchImpl
BatchImpl(const BatchImpl &other)
Definition: covariance_batch.h:296
daal::algorithms::covariance::interface1::Batch::Batch
Batch(const Batch< algorithmFPType, method > &other)
Definition: covariance_batch.h:391
daal::algorithms::covariance::interface1::Batch
Computes correlation or variance-covariance matrix in the batch processing mode.
Definition: covariance_batch.h:369
daal::algorithms::covariance::defaultDense
Definition: covariance_types.h:74
daal::algorithms::covariance::interface1::BatchContainerIface::compute
virtual services::Status compute()=0
daal::algorithms::covariance::interface1::BatchImpl
Abstract class that specifies interface of the algorithms for computing correlation or variance-covar...
Definition: covariance_batch.h:276
daal::services::ErrorNullResult
Definition: error_indexes.h:122
daal::algorithms::covariance::singlePassDense
Definition: covariance_types.h:75