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

objective_function_types.h
1 /* file: objective_function_types.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 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  nonSmoothTermValue = 0x00000008ULL,
71  proximalProjection = 0x00000010ULL,
72  lipschitzConstant = 0x00000020ULL
73 };
74 
79 enum ResultId
80 {
81  gradientIdx,
82  valueIdx,
83  hessianIdx,
84  nonSmoothTermValueIdx,
85  proximalProjectionIdx,
86  lipschitzConstantIdx,
87  lastResultId = lipschitzConstantIdx
88 };
89 
93 namespace interface1
94 {
101 /* [Parameter source code] */
102 struct DAAL_EXPORT Parameter : public daal::algorithms::Parameter
103 {
108  Parameter(const DAAL_UINT64 resultsToCompute = gradient);
109 
114  Parameter(const Parameter &other);
115 
116  virtual ~Parameter() {}
117 
118  DAAL_UINT64 resultsToCompute;
119 };
120 /* [Parameter source code] */
121 
126 class DAAL_EXPORT Input : public daal::algorithms::Input
127 {
128 public:
130  Input(size_t n = 1);
131 
133  Input(const Input& other);
134 
136  virtual ~Input() {}
137 
143  void set(InputId id, const data_management::NumericTablePtr &ptr);
144 
150  data_management::NumericTablePtr get(InputId id) const;
151 
159  services::Status check(const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
160 };
161 
166 class DAAL_EXPORT Result: public daal::algorithms::Result
167 {
168 public:
169  DECLARE_SERIALIZABLE_CAST(Result);
171  Result();
172 
174  virtual ~Result() {};
175 
184  template <typename algorithmFPType>
185  DAAL_EXPORT services::Status allocate(const daal::algorithms::Input *input, const daal::algorithms::Parameter *parameter, const int method);
186 
192  void set(ResultId id, const data_management::NumericTablePtr &ptr);
193 
199  data_management::NumericTablePtr get(ResultId id) const;
200 
209  virtual services::Status check(const daal::algorithms::Input *input, const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
210 
211 protected:
212 
213  template<typename Archive, bool onDeserialize>
214  services::Status serialImpl(Archive *arch)
215  {
216  return daal::algorithms::Result::serialImpl<Archive, onDeserialize>(arch);
217  }
218 };
219 typedef services::SharedPtr<Result> ResultPtr;
221 } // namespace interface1
222 using interface1::Parameter;
223 using interface1::Input;
224 using interface1::Result;
225 using interface1::ResultPtr;
226 
227 } // namespace objective_function
228 } // namespace optimization_solver
229 } // namespace algorithm
230 } // namespace daal
231 #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:118
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:166
daal::algorithms::optimization_solver::objective_function::interface1::Result::~Result
virtual ~Result()
Definition: objective_function_types.h:174
daal_defines.h
daal::algorithms::optimization_solver::objective_function::gradientIdx
Definition: objective_function_types.h:81
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:126
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:83
daal::algorithms::optimization_solver::objective_function::valueIdx
Definition: objective_function_types.h:82
daal::algorithms::optimization_solver::objective_function::ResultId
ResultId
Definition: objective_function_types.h:79
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:136
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:102

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