C++ API Reference for Intel® Data Analytics Acceleration Library 2020 Update 1

objective_function_batch.h
1 /* file: objective_function_batch.h */
2 /*******************************************************************************
3 * Copyright 2014-2020 Intel Corporation
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *******************************************************************************/
17 
18 /*
19 //++
20 // Implementation of the Objective function types.
21 //--
22 */
23 
24 #ifndef __OBJECTIVE_FUNCTION_BATCH_H__
25 #define __OBJECTIVE_FUNCTION_BATCH_H__
26 
27 #include "algorithms/algorithm.h"
28 #include "data_management/data/numeric_table.h"
29 #include "data_management/data/homogen_numeric_table.h"
30 #include "services/daal_defines.h"
31 #include "objective_function_types.h"
32 
33 namespace daal
34 {
35 namespace algorithms
36 {
37 namespace optimization_solver
38 {
39 namespace objective_function
40 {
41 
42 namespace interface1
43 {
60 class DAAL_EXPORT Batch : public daal::algorithms::Analysis<batch>
61 {
62 public:
63  typedef algorithms::optimization_solver::objective_function::Input InputType;
64  typedef algorithms::optimization_solver::objective_function::Parameter ParameterType;
65  typedef algorithms::optimization_solver::objective_function::Result ResultType;
66 
70  Batch()
71  {
72  initialize();
73  }
74 
81  Batch(const Batch &other)
82  {
83  initialize();
84  }
85 
87  virtual ~Batch() {}
88 
93  virtual objective_function::ResultPtr getResult()
94  {
95  return _result;
96  }
97 
104  virtual services::Status setResult(const objective_function::ResultPtr& result)
105  {
106  DAAL_CHECK(result, services::ErrorNullResult);
107  _result = result;
108  _res = _result.get();
109  return services::Status();
110  }
111 
117  services::SharedPtr<Batch> clone() const
118  {
119  return services::SharedPtr<Batch>(cloneImpl());
120  }
121 
122 protected:
123  virtual Batch *cloneImpl() const DAAL_C11_OVERRIDE = 0;
124 
125  void initialize()
126  {
127  _result = objective_function::ResultPtr(new ResultType());
128  }
129 
130 protected:
131  objective_function::ResultPtr _result;
132 };
134 } // namespace interface1
135 using interface1::Batch;
136 
137 } // namespace objective_function
138 } // namespace optimization_solver
139 } // namespace algorithm
140 } // namespace daal
141 #endif
daal::algorithms::optimization_solver::objective_function::interface1::Batch::setResult
virtual services::Status setResult(const objective_function::ResultPtr &result)
Definition: objective_function_batch.h:104
daal::algorithms::optimization_solver::objective_function::interface1::Batch::clone
services::SharedPtr< Batch > clone() const
Definition: objective_function_batch.h:117
daal::algorithms::optimization_solver::objective_function::interface1::Batch::Batch
Batch(const Batch &other)
Definition: objective_function_batch.h:81
daal::algorithms::optimization_solver::objective_function::interface1::Batch::Batch
Batch()
Definition: objective_function_batch.h:70
daal::services::ErrorNullResult
Definition: error_indexes.h:98
daal::algorithms::optimization_solver::objective_function::interface1::Batch::getResult
virtual objective_function::ResultPtr getResult()
Definition: objective_function_batch.h:93
daal_defines.h
daal::algorithms::optimization_solver::objective_function::interface1::Batch::~Batch
virtual ~Batch()
Definition: objective_function_batch.h:87
daal::algorithms::optimization_solver::objective_function::interface1::Batch
Interface for computing the Objective function in the batch processing mode.
Definition: objective_function_batch.h:60
daal::algorithms::Analysis
Provides methods for execution of operations over data, such as computation of Summary Statistics est...
Definition: analysis.h:70

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