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

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  componentOfGradient = 0x00000040ULL,
74  componentOfHessianDiagonal = 0x00000080ULL,
75  componentOfProximalProjection = 0x00000100ULL,
76 };
77 
82 enum ResultId
83 {
84  gradientIdx,
85  valueIdx,
86  hessianIdx,
87  nonSmoothTermValueIdx,
88  proximalProjectionIdx,
89  lipschitzConstantIdx,
90  componentOfGradientIdx,
91  componentOfHessianDiagonalIdx,
92  componentOfProximalProjectionIdx,
93  lastResultId = componentOfProximalProjectionIdx
94 };
95 
99 namespace interface1
100 {
107 /* [Parameter source code] */
108 struct DAAL_EXPORT Parameter : public daal::algorithms::Parameter
109 {
114  Parameter(const DAAL_UINT64 resultsToCompute = gradient);
115 
120  Parameter(const Parameter &other);
121 
122  virtual ~Parameter() {}
123 
124  DAAL_UINT64 resultsToCompute;
125 };
126 /* [Parameter source code] */
127 
132 class DAAL_EXPORT Input : public daal::algorithms::Input
133 {
134 public:
136  Input(size_t n = 1);
137 
139  Input(const Input& other);
140 
142  virtual ~Input() {}
143 
149  void set(InputId id, const data_management::NumericTablePtr &ptr);
150 
156  data_management::NumericTablePtr get(InputId id) const;
157 
165  services::Status check(const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
166 };
167 
172 class DAAL_EXPORT Result: public daal::algorithms::Result
173 {
174 public:
175  DECLARE_SERIALIZABLE_CAST(Result);
177  Result();
178 
180  virtual ~Result() {};
181 
190  template <typename algorithmFPType>
191  DAAL_EXPORT services::Status allocate(const daal::algorithms::Input *input, const daal::algorithms::Parameter *parameter, const int method);
192 
198  void set(ResultId id, const data_management::NumericTablePtr &ptr);
199 
205  data_management::NumericTablePtr get(ResultId id) const;
206 
215  virtual services::Status check(const daal::algorithms::Input *input, const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
216 
217 protected:
218 
219  template<typename Archive, bool onDeserialize>
220  services::Status serialImpl(Archive *arch)
221  {
222  return daal::algorithms::Result::serialImpl<Archive, onDeserialize>(arch);
223  }
224 };
225 typedef services::SharedPtr<Result> ResultPtr;
227 } // namespace interface1
228 using interface1::Parameter;
229 using interface1::Input;
230 using interface1::Result;
231 using interface1::ResultPtr;
232 
233 } // namespace objective_function
234 } // namespace optimization_solver
235 } // namespace algorithm
236 } // namespace daal
237 #endif
daal::algorithms::optimization_solver::objective_function::argument
Definition: objective_function_types.h:57
daal::algorithms::optimization_solver::objective_function::lipschitzConstantIdx
Definition: objective_function_types.h:89
daal::algorithms::optimization_solver::objective_function::value
Definition: objective_function_types.h:68
daal::algorithms::optimization_solver::objective_function::componentOfHessianDiagonalIdx
Definition: objective_function_types.h:91
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::componentOfHessianDiagonal
Definition: objective_function_types.h:74
daal::algorithms::optimization_solver::objective_function::interface1::Parameter::resultsToCompute
DAAL_UINT64 resultsToCompute
Definition: objective_function_types.h:124
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:172
daal::algorithms::optimization_solver::objective_function::nonSmoothTermValue
Definition: objective_function_types.h:70
daal::algorithms::optimization_solver::objective_function::componentOfProximalProjection
Definition: objective_function_types.h:75
daal::algorithms::optimization_solver::objective_function::interface1::Result::~Result
virtual ~Result()
Definition: objective_function_types.h:180
daal_defines.h
daal::algorithms::optimization_solver::objective_function::gradientIdx
Definition: objective_function_types.h:84
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::lipschitzConstant
Definition: objective_function_types.h:72
daal::algorithms::optimization_solver::objective_function::interface1::Input
Input objects for the Objective function
Definition: objective_function_types.h:132
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:86
daal::algorithms::optimization_solver::objective_function::valueIdx
Definition: objective_function_types.h:85
daal::algorithms::optimization_solver::objective_function::ResultId
ResultId
Definition: objective_function_types.h:82
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::componentOfGradientIdx
Definition: objective_function_types.h:90
daal::algorithms::optimization_solver::objective_function::nonSmoothTermValueIdx
Definition: objective_function_types.h:87
daal::algorithms::optimization_solver::objective_function::componentOfGradient
Definition: objective_function_types.h:73
daal::algorithms::optimization_solver::objective_function::interface1::Input::~Input
virtual ~Input()
Definition: objective_function_types.h:142
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::componentOfProximalProjectionIdx
Definition: objective_function_types.h:92
daal::algorithms::optimization_solver::objective_function::proximalProjection
Definition: objective_function_types.h:71
daal::algorithms::optimization_solver::objective_function::interface1::Parameter
Parameter for the Objective function
Definition: objective_function_types.h:108
daal::algorithms::optimization_solver::objective_function::proximalProjectionIdx
Definition: objective_function_types.h:88

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