25 #ifndef __COORDINATE_DESCENT_BATCH_H__
26 #define __COORDINATE_DESCENT_BATCH_H__
28 #include "data_management/data/numeric_table.h"
29 #include "services/daal_defines.h"
30 #include "algorithms/optimization_solver/iterative_solver/iterative_solver_batch.h"
31 #include "coordinate_descent_types.h"
37 namespace optimization_solver
39 namespace coordinate_descent
56 template<
typename algorithmFPType, Method method, CpuType cpu>
57 class BatchContainer :
public daal::algorithms::AnalysisContainerIface<batch>
65 BatchContainer(daal::services::Environment::env *daalEnv);
73 virtual services::Status compute() DAAL_C11_OVERRIDE;
90 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
91 class DAAL_EXPORT Batch :
public iterative_solver::Batch
94 typedef algorithms::optimization_solver::coordinate_descent::Input InputType;
95 typedef algorithms::optimization_solver::coordinate_descent::Parameter ParameterType;
96 typedef algorithms::optimization_solver::coordinate_descent::Result ResultType;
101 Batch(
const sum_of_functions::BatchPtr& objectiveFunction = sum_of_functions::BatchPtr());
109 Batch(
const Batch<algorithmFPType, method> &other);
119 ParameterType& parameter() {
return *
static_cast<ParameterType*
>(_par); }
125 const ParameterType& parameter()
const {
return *
static_cast<const ParameterType*
>(_par); }
131 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int) method; }
137 virtual iterative_solver::Input * getInput() DAAL_C11_OVERRIDE {
return &input; }
143 virtual iterative_solver::Parameter * getParameter() DAAL_C11_OVERRIDE {
return ¶meter(); }
150 virtual services::Status createResult() DAAL_C11_OVERRIDE
152 _result = iterative_solver::ResultPtr(
new ResultType());
154 return services::Status();
162 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
164 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
171 static services::SharedPtr<Batch<algorithmFPType, method> > create();
174 virtual Batch<algorithmFPType, method> *cloneImpl() const DAAL_C11_OVERRIDE
176 return new Batch<algorithmFPType, method>(*this);
179 virtual services::Status allocateResult() DAAL_C11_OVERRIDE
181 services::Status s =
static_cast<ResultType*
>(_result.get())->allocate<algorithmFPType>(&input, _par, (
int)method);
182 _res = _result.get();
188 Analysis<batch>::_ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
190 _result.reset(
new ResultType());
195 using interface1::BatchContainer;
196 using interface1::Batch;
daal::batch
Definition: daal_defines.h:112
daal::algorithms::optimization_solver::coordinate_descent::interface1::BatchContainer::compute
virtual services::Status compute() DAAL_C11_OVERRIDE
daal::algorithms::optimization_solver::coordinate_descent::interface1::Batch::parameter
const ParameterType & parameter() const
Definition: coordinate_descent_batch.h:125
daal::algorithms::optimization_solver::coordinate_descent::interface1::Batch::getInput
virtual iterative_solver::Input * getInput() DAAL_C11_OVERRIDE
Definition: coordinate_descent_batch.h:137
daal::algorithms::optimization_solver::coordinate_descent::interface1::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: coordinate_descent_batch.h:162
daal::algorithms::AnalysisContainerIface
Abstract interface class that provides virtual methods to access and run implementations of the analy...
Definition: analysis.h:55
daal::algorithms::optimization_solver::coordinate_descent::interface1::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: coordinate_descent_batch.h:131
daal::algorithms::optimization_solver::coordinate_descent::interface1::Batch::parameter
ParameterType & parameter()
Definition: coordinate_descent_batch.h:119
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:57
daal::algorithms::optimization_solver::coordinate_descent::interface1::Batch::getParameter
virtual iterative_solver::Parameter * getParameter() DAAL_C11_OVERRIDE
Definition: coordinate_descent_batch.h:143
daal::algorithms::optimization_solver::coordinate_descent::interface1::BatchContainer::BatchContainer
BatchContainer(daal::services::Environment::env *daalEnv)
daal::algorithms::optimization_solver::coordinate_descent::interface1::BatchContainer::~BatchContainer
~BatchContainer()
daal::algorithms::optimization_solver::coordinate_descent::interface1::Batch
Computes Coordinate descent in the batch processing mode.
Definition: coordinate_descent_batch.h:91
daal::algorithms::optimization_solver::coordinate_descent::interface1::Batch::createResult
virtual services::Status createResult() DAAL_C11_OVERRIDE
Definition: coordinate_descent_batch.h:150
daal::algorithms::Analysis
Provides methods for execution of operations over data, such as computation of Summary Statistics est...
Definition: analysis.h:70
daal::algorithms::optimization_solver::coordinate_descent::interface1::Batch::input
InputType input
Definition: coordinate_descent_batch.h:98