C++ API Reference for Intel® Data Analytics Acceleration Library 2018 Update 3

objective_function_types.h
1 /* file: objective_function_types.h */
2 /*******************************************************************************
3 * Copyright 2014-2018 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 interface.
19 //--
20 */
21 
22 #ifndef __OBJECTIVE_FUNCTION_TYPES_H__
23 #define __OBJECTIVE_FUNCTION_TYPES_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 
30 namespace daal
31 {
32 namespace algorithms
33 {
37 namespace optimization_solver
38 {
48 namespace objective_function
49 {
50 
55 enum InputId
56 {
57  argument,
58  lastInputId = argument
59 };
60 
65 enum ResultToComputeId
66 {
67  gradient = 0x00000001ULL,
68  value = 0x00000002ULL,
69  hessian = 0x00000004ULL
70 };
71 
76 enum ResultId
77 {
78  gradientIdx,
79  valueIdx,
80  hessianIdx,
81  lastResultId = hessianIdx
82 };
83 
87 namespace interface1
88 {
95 /* [Parameter source code] */
96 struct DAAL_EXPORT Parameter : public daal::algorithms::Parameter
97 {
102  Parameter(const DAAL_UINT64 resultsToCompute = gradient);
103 
108  Parameter(const Parameter &other);
109 
110  virtual ~Parameter() {}
111 
112  DAAL_UINT64 resultsToCompute;
113 };
114 /* [Parameter source code] */
115 
120 class DAAL_EXPORT Input : public daal::algorithms::Input
121 {
122 public:
124  Input(size_t n = 1);
125 
127  Input(const Input& other);
128 
130  virtual ~Input() {}
131 
137  void set(InputId id, const data_management::NumericTablePtr &ptr);
138 
144  data_management::NumericTablePtr get(InputId id) const;
145 
153  services::Status check(const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
154 };
155 
160 class DAAL_EXPORT Result: public daal::algorithms::Result
161 {
162 public:
163  DECLARE_SERIALIZABLE_CAST(Result);
165  Result();
166 
168  virtual ~Result() {};
169 
178  template <typename algorithmFPType>
179  DAAL_EXPORT services::Status allocate(const daal::algorithms::Input *input, const daal::algorithms::Parameter *parameter, const int method);
180 
186  void set(ResultId id, const data_management::NumericTablePtr &ptr);
187 
193  data_management::NumericTablePtr get(ResultId id) const;
194 
203  virtual services::Status check(const daal::algorithms::Input *input, const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
204 
205 protected:
206 
207  template<typename Archive, bool onDeserialize>
208  services::Status serialImpl(Archive *arch)
209  {
210  return daal::algorithms::Result::serialImpl<Archive, onDeserialize>(arch);
211  }
212 };
213 typedef services::SharedPtr<Result> ResultPtr;
215 } // namespace interface1
216 using interface1::Parameter;
217 using interface1::Input;
218 using interface1::Result;
219 using interface1::ResultPtr;
220 
221 } // namespace objective_function
222 } // namespace optimization_solver
223 } // namespace algorithm
224 } // namespace daal
225 #endif
daal::algorithms::optimization_solver::objective_function::argument
Definition: objective_function_types.h:57
daal::algorithms::optimization_solver::objective_function::value
Definition: objective_function_types.h:68
daal
Definition: algorithm_base_common.h:31
daal::algorithms::interface1::Result
Base class to represent final results of the computation. Algorithm-specific final results are repres...
Definition: algorithm_types.h:307
daal::algorithms::optimization_solver::objective_function::interface1::Parameter::resultsToCompute
DAAL_UINT64 resultsToCompute
Definition: objective_function_types.h:112
daal::algorithms::optimization_solver::objective_function::interface1::Result
Provides methods to access final results obtained with the compute() method of the Objective function...
Definition: objective_function_types.h:160
daal::algorithms::optimization_solver::objective_function::interface1::Result::~Result
virtual ~Result()
Definition: objective_function_types.h:168
daal_defines.h
daal::algorithms::optimization_solver::objective_function::gradientIdx
Definition: objective_function_types.h:78
daal::algorithms::optimization_solver::objective_function::ResultToComputeId
ResultToComputeId
Definition: objective_function_types.h:65
daal::algorithms::optimization_solver::objective_function::hessian
Definition: objective_function_types.h:69
daal::algorithms::optimization_solver::objective_function::interface1::Input
Input objects for the Objective function
Definition: objective_function_types.h:120
daal::algorithms::interface1::Parameter
Base class to represent computation parameters. Algorithm-specific parameters are represented as deri...
Definition: algorithm_types.h:60
daal::algorithms::optimization_solver::objective_function::hessianIdx
Definition: objective_function_types.h:80
daal::algorithms::optimization_solver::objective_function::valueIdx
Definition: objective_function_types.h:79
daal::algorithms::optimization_solver::objective_function::ResultId
ResultId
Definition: objective_function_types.h:76
daal::algorithms::optimization_solver::objective_function::gradient
Definition: objective_function_types.h:67
daal::algorithms::optimization_solver::objective_function::InputId
InputId
Definition: objective_function_types.h:55
daal::algorithms::optimization_solver::objective_function::interface1::Input::~Input
virtual ~Input()
Definition: objective_function_types.h:130
daal::algorithms::interface1::Input
Base class to represent computation input arguments. Algorithm-specific input arguments are represent...
Definition: algorithm_types.h:191
daal::algorithms::optimization_solver::objective_function::interface1::Parameter
Parameter for the Objective function
Definition: objective_function_types.h:96

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