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

objective_function_types.h
1 /* file: objective_function_types.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 interface.
21 //--
22 */
23 
24 #ifndef __OBJECTIVE_FUNCTION_TYPES_H__
25 #define __OBJECTIVE_FUNCTION_TYPES_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 
32 namespace daal
33 {
34 namespace algorithms
35 {
39 namespace optimization_solver
40 {
50 namespace objective_function
51 {
52 
57 enum InputId
58 {
59  argument,
60  lastInputId = argument
61 };
62 
67 enum ResultToComputeId
68 {
69  gradient = 0x00000001ULL,
70  value = 0x00000002ULL,
71  hessian = 0x00000004ULL,
72  nonSmoothTermValue = 0x00000008ULL,
73  proximalProjection = 0x00000010ULL,
74  lipschitzConstant = 0x00000020ULL,
75  componentOfGradient = 0x00000040ULL,
76  componentOfHessianDiagonal = 0x00000080ULL,
77  componentOfProximalProjection = 0x00000100ULL,
78 };
79 
84 enum ResultId
85 {
86  gradientIdx,
87  valueIdx,
88  hessianIdx,
89  nonSmoothTermValueIdx,
90  proximalProjectionIdx,
91  lipschitzConstantIdx,
92  componentOfGradientIdx,
93  componentOfHessianDiagonalIdx,
94  componentOfProximalProjectionIdx,
95  lastResultId = componentOfProximalProjectionIdx
96 };
97 
101 namespace interface1
102 {
109 /* [Parameter source code] */
110 struct DAAL_EXPORT Parameter : public daal::algorithms::Parameter
111 {
116  Parameter(const DAAL_UINT64 resultsToCompute = gradient);
117 
122  Parameter(const Parameter &other);
123 
124  virtual ~Parameter() {}
125 
126  DAAL_UINT64 resultsToCompute;
127 };
128 /* [Parameter source code] */
129 
134 class DAAL_EXPORT Input : public daal::algorithms::Input
135 {
136 public:
138  Input(size_t n = 1);
139 
141  Input(const Input& other);
142 
144  virtual ~Input() {}
145 
151  void set(InputId id, const data_management::NumericTablePtr &ptr);
152 
158  data_management::NumericTablePtr get(InputId id) const;
159 
167  services::Status check(const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
168 };
169 
174 class DAAL_EXPORT Result: public daal::algorithms::Result
175 {
176 public:
177  DECLARE_SERIALIZABLE_CAST(Result);
179  Result();
180 
182  virtual ~Result() {};
183 
192  template <typename algorithmFPType>
193  DAAL_EXPORT services::Status allocate(const daal::algorithms::Input *input, const daal::algorithms::Parameter *parameter, const int method);
194 
200  void set(ResultId id, const data_management::NumericTablePtr &ptr);
201 
207  data_management::NumericTablePtr get(ResultId id) const;
208 
217  virtual services::Status check(const daal::algorithms::Input *input, const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
218 
219 protected:
220 
221  template<typename Archive, bool onDeserialize>
222  services::Status serialImpl(Archive *arch)
223  {
224  return daal::algorithms::Result::serialImpl<Archive, onDeserialize>(arch);
225  }
226 };
227 typedef services::SharedPtr<Result> ResultPtr;
229 } // namespace interface1
230 using interface1::Parameter;
231 using interface1::Input;
232 using interface1::Result;
233 using interface1::ResultPtr;
234 
235 } // namespace objective_function
236 } // namespace optimization_solver
237 } // namespace algorithm
238 } // namespace daal
239 #endif
daal::algorithms::optimization_solver::objective_function::proximalProjectionIdx
Definition: objective_function_types.h:90
daal::algorithms::optimization_solver::objective_function::lipschitzConstantIdx
Definition: objective_function_types.h:91
daal::algorithms::optimization_solver::objective_function::interface1::Parameter
Parameter for the Objective function
Definition: objective_function_types.h:110
daal::algorithms::optimization_solver::objective_function::value
Definition: objective_function_types.h:70
daal::algorithms::optimization_solver::objective_function::nonSmoothTermValue
Definition: objective_function_types.h:72
daal::algorithms::optimization_solver::objective_function::componentOfGradientIdx
Definition: objective_function_types.h:92
daal::algorithms::interface1::Result
Base class to represent final results of the computation. Algorithm-specific final results are repres...
Definition: algorithm_types.h:309
daal::algorithms::optimization_solver::objective_function::hessian
Definition: objective_function_types.h:71
daal::algorithms::optimization_solver::objective_function::lipschitzConstant
Definition: objective_function_types.h:74
daal::algorithms::optimization_solver::objective_function::ResultToComputeId
ResultToComputeId
Definition: objective_function_types.h:67
daal::algorithms::optimization_solver::objective_function::interface1::Input
Input objects for the Objective function
Definition: objective_function_types.h:134
daal::algorithms::optimization_solver::objective_function::InputId
InputId
Definition: objective_function_types.h:57
daal_defines.h
daal::algorithms::optimization_solver::objective_function::gradientIdx
Definition: objective_function_types.h:86
daal::algorithms::optimization_solver::objective_function::valueIdx
Definition: objective_function_types.h:87
daal::algorithms::interface1::Input
Base class to represent computation input arguments. Algorithm-specific input arguments are represent...
Definition: algorithm_types.h:193
daal::algorithms::optimization_solver::objective_function::nonSmoothTermValueIdx
Definition: objective_function_types.h:89
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:174
daal::algorithms::interface1::Parameter
Base class to represent computation parameters. Algorithm-specific parameters are represented as deri...
Definition: algorithm_types.h:62
daal::algorithms::optimization_solver::objective_function::proximalProjection
Definition: objective_function_types.h:73
daal::algorithms::optimization_solver::objective_function::componentOfProximalProjection
Definition: objective_function_types.h:77
daal::algorithms::optimization_solver::objective_function::interface1::Result::~Result
virtual ~Result()
Definition: objective_function_types.h:182
daal::algorithms::optimization_solver::objective_function::componentOfProximalProjectionIdx
Definition: objective_function_types.h:94
daal::algorithms::optimization_solver::objective_function::componentOfHessianDiagonal
Definition: objective_function_types.h:76
daal::algorithms::optimization_solver::objective_function::componentOfHessianDiagonalIdx
Definition: objective_function_types.h:93
daal::algorithms::optimization_solver::objective_function::argument
Definition: objective_function_types.h:59
daal::algorithms::optimization_solver::objective_function::gradient
Definition: objective_function_types.h:69
daal::algorithms::optimization_solver::objective_function::hessianIdx
Definition: objective_function_types.h:88
daal::algorithms::optimization_solver::objective_function::interface1::Parameter::resultsToCompute
DAAL_UINT64 resultsToCompute
Definition: objective_function_types.h:126
daal::algorithms::optimization_solver::objective_function::interface1::Input::~Input
virtual ~Input()
Definition: objective_function_types.h:144
daal::algorithms::optimization_solver::objective_function::ResultId
ResultId
Definition: objective_function_types.h:84
daal::algorithms::optimization_solver::objective_function::componentOfGradient
Definition: objective_function_types.h:75

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