23 #ifndef __COORDINATE_DESCENT_BATCH_H__
24 #define __COORDINATE_DESCENT_BATCH_H__
26 #include "data_management/data/numeric_table.h"
27 #include "services/daal_defines.h"
28 #include "algorithms/optimization_solver/iterative_solver/iterative_solver_batch.h"
29 #include "coordinate_descent_types.h"
35 namespace optimization_solver
37 namespace coordinate_descent
54 template<
typename algorithmFPType, Method method, CpuType cpu>
55 class DAAL_EXPORT BatchContainer :
public daal::algorithms::AnalysisContainerIface<batch>
63 BatchContainer(daal::services::Environment::env *daalEnv);
71 virtual services::Status compute() DAAL_C11_OVERRIDE;
88 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
89 class DAAL_EXPORT Batch :
public iterative_solver::Batch
92 typedef algorithms::optimization_solver::coordinate_descent::Input InputType;
93 typedef algorithms::optimization_solver::coordinate_descent::Parameter ParameterType;
94 typedef algorithms::optimization_solver::coordinate_descent::Result ResultType;
99 Batch(
const sum_of_functions::BatchPtr& objectiveFunction = sum_of_functions::BatchPtr());
107 Batch(
const Batch<algorithmFPType, method> &other);
117 ParameterType& parameter() {
return *
static_cast<ParameterType*
>(_par); }
123 const ParameterType& parameter()
const {
return *
static_cast<const ParameterType*
>(_par); }
129 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int) method; }
135 virtual iterative_solver::Input * getInput() DAAL_C11_OVERRIDE {
return &input; }
141 virtual iterative_solver::Parameter * getParameter() DAAL_C11_OVERRIDE {
return ¶meter(); }
148 virtual services::Status createResult() DAAL_C11_OVERRIDE
150 _result = iterative_solver::ResultPtr(
new ResultType());
152 return services::Status();
160 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
162 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
169 static services::SharedPtr<Batch<algorithmFPType, method> > create();
172 virtual Batch<algorithmFPType, method> *cloneImpl() const DAAL_C11_OVERRIDE
174 return new Batch<algorithmFPType, method>(*this);
177 virtual services::Status allocateResult() DAAL_C11_OVERRIDE
179 services::Status s =
static_cast<ResultType*
>(_result.get())->allocate<algorithmFPType>(&input, _par, (
int)method);
180 _res = _result.get();
186 Analysis<batch>::_ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
188 _result.reset(
new ResultType());
193 using interface1::BatchContainer;
194 using interface1::Batch;
daal::algorithms::optimization_solver::coordinate_descent::interface1::Batch::getInput
virtual iterative_solver::Input * getInput() DAAL_C11_OVERRIDE
Definition: coordinate_descent_batch.h:135
daal::algorithms::optimization_solver::coordinate_descent::interface1::Batch::createResult
virtual services::Status createResult() DAAL_C11_OVERRIDE
Definition: coordinate_descent_batch.h:148
daal::algorithms::optimization_solver::coordinate_descent::interface1::Batch::parameter
ParameterType & parameter()
Definition: coordinate_descent_batch.h:117
daal::algorithms::optimization_solver::coordinate_descent::interface1::Batch::input
InputType input
Definition: coordinate_descent_batch.h:96
daal::algorithms::optimization_solver::coordinate_descent::interface1::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: coordinate_descent_batch.h:160
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::optimization_solver::coordinate_descent::interface1::Batch
Computes Coordinate descent in the batch processing mode.
Definition: coordinate_descent_batch.h:89
daal::algorithms::optimization_solver::coordinate_descent::interface1::Batch::parameter
const ParameterType & parameter() const
Definition: coordinate_descent_batch.h:123
daal::algorithms::optimization_solver::coordinate_descent::interface1::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: coordinate_descent_batch.h:129
daal::batch
Definition: daal_defines.h:110
daal::algorithms::optimization_solver::coordinate_descent::interface1::BatchContainer
Provides methods to run implementations of the coordinate descent algorithm. This class is associated...
Definition: coordinate_descent_batch.h:55
daal::algorithms::Analysis
Provides methods for execution of operations over data, such as computation of Summary Statistics est...
Definition: analysis.h:68
daal::algorithms::kmeans::objectiveFunction
Definition: kmeans_types.h:109
daal::algorithms::optimization_solver::coordinate_descent::interface1::Batch::getParameter
virtual iterative_solver::Parameter * getParameter() DAAL_C11_OVERRIDE
Definition: coordinate_descent_batch.h:141