C++ API Reference for Intel® Data Analytics Acceleration Library 2019 Update 5

objective_function_batch.h
1 /* file: objective_function_batch.h */
2 /*******************************************************************************
3 * Copyright 2014-2019 Intel Corporation.
4 *
5 * This software and the related documents are Intel copyrighted materials, and
6 * your use of them is governed by the express license under which they were
7 * provided to you (License). Unless the License provides otherwise, you may not
8 * use, modify, copy, publish, distribute, disclose or transmit this software or
9 * the related documents without Intel's prior written permission.
10 *
11 * This software and the related documents are provided as is, with no express
12 * or implied warranties, other than those that are expressly stated in the
13 * License.
14 *******************************************************************************/
15 
16 /*
17 //++
18 // Implementation of the Objective function types.
19 //--
20 */
21 
22 #ifndef __OBJECTIVE_FUNCTION_BATCH_H__
23 #define __OBJECTIVE_FUNCTION_BATCH_H__
24 
25 #include "algorithms/algorithm.h"
26 #include "data_management/data/numeric_table.h"
27 #include "data_management/data/homogen_numeric_table.h"
28 #include "services/daal_defines.h"
29 #include "objective_function_types.h"
30 
31 namespace daal
32 {
33 namespace algorithms
34 {
35 namespace optimization_solver
36 {
37 namespace objective_function
38 {
39 
40 namespace interface1
41 {
58 class DAAL_EXPORT Batch : public daal::algorithms::Analysis<batch>
59 {
60 public:
61  typedef algorithms::optimization_solver::objective_function::Input InputType;
62  typedef algorithms::optimization_solver::objective_function::Parameter ParameterType;
63  typedef algorithms::optimization_solver::objective_function::Result ResultType;
64 
68  Batch()
69  {
70  initialize();
71  }
72 
79  Batch(const Batch &other)
80  {
81  initialize();
82  }
83 
85  virtual ~Batch() {}
86 
91  virtual objective_function::ResultPtr getResult()
92  {
93  return _result;
94  }
95 
102  virtual services::Status setResult(const objective_function::ResultPtr& result)
103  {
104  DAAL_CHECK(result, services::ErrorNullResult);
105  _result = result;
106  _res = _result.get();
107  return services::Status();
108  }
109 
115  services::SharedPtr<Batch> clone() const
116  {
117  return services::SharedPtr<Batch>(cloneImpl());
118  }
119 
120 protected:
121  virtual Batch *cloneImpl() const DAAL_C11_OVERRIDE = 0;
122 
123  void initialize()
124  {
125  _result = objective_function::ResultPtr(new ResultType());
126  }
127 
128 protected:
129  objective_function::ResultPtr _result;
130 };
132 } // namespace interface1
133 using interface1::Batch;
134 
135 } // namespace objective_function
136 } // namespace optimization_solver
137 } // namespace algorithm
138 } // namespace daal
139 #endif
daal
Definition: algorithm_base_common.h:31
daal::algorithms::optimization_solver::objective_function::interface1::Batch
Interface for computing the Objective function in the batch processing mode.
Definition: objective_function_batch.h:58
daal::algorithms::optimization_solver::objective_function::interface1::Batch::setResult
virtual services::Status setResult(const objective_function::ResultPtr &result)
Definition: objective_function_batch.h:102
daal_defines.h
daal::algorithms::optimization_solver::objective_function::interface1::Batch::~Batch
virtual ~Batch()
Definition: objective_function_batch.h:85
daal::algorithms::optimization_solver::objective_function::interface1::Batch::Batch
Batch()
Definition: objective_function_batch.h:68
daal::algorithms::optimization_solver::objective_function::interface1::Batch::Batch
Batch(const Batch &other)
Definition: objective_function_batch.h:79
daal::algorithms::optimization_solver::objective_function::interface1::Batch::clone
services::SharedPtr< Batch > clone() const
Definition: objective_function_batch.h:115
daal::algorithms::Analysis
Provides methods for execution of operations over data, such as computation of Summary Statistics est...
Definition: analysis.h:68
daal::algorithms::optimization_solver::objective_function::interface1::Batch::getResult
virtual objective_function::ResultPtr getResult()
Definition: objective_function_batch.h:91
daal::services::ErrorNullResult
Definition: error_indexes.h:96

For more complete information about compiler optimizations, see our Optimization Notice.