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

sum_of_functions_batch.h
1 /* file: sum_of_functions_batch.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 Sum of functions types.
19 //--
20 */
21 
22 #ifndef __SUM_OF_FUNCTIONS_BATCH_H__
23 #define __SUM_OF_FUNCTIONS_BATCH_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 #include "objective_function_batch.h"
30 #include "sum_of_functions_types.h"
31 
32 namespace daal
33 {
34 namespace algorithms
35 {
36 namespace optimization_solver
37 {
38 namespace sum_of_functions
39 {
40 
41 namespace interface1
42 {
61 class DAAL_EXPORT Batch : public objective_function::Batch
62 {
63 public:
64  typedef objective_function::Batch super;
65 
66  typedef algorithms::optimization_solver::sum_of_functions::interface1::Input InputType;
67  typedef algorithms::optimization_solver::sum_of_functions::interface1::Parameter ParameterType;
68  typedef super::ResultType ResultType;
69 
73  Batch(size_t numberOfTerms, InputType *sumOfFunctionsInput, ParameterType *sumOfFunctionsParameter) :
74  sumOfFunctionsInput(sumOfFunctionsInput),
75  sumOfFunctionsParameter(sumOfFunctionsParameter)
76  {
77  initialize();
78  if(sumOfFunctionsParameter != NULL) {sumOfFunctionsParameter->numberOfTerms = numberOfTerms;}
79  }
80 
87  Batch(const Batch &other) : sumOfFunctionsInput(other.sumOfFunctionsInput),
88  sumOfFunctionsParameter(other.sumOfFunctionsParameter)
89  {
90  initialize();
91  }
92 
93  virtual ~Batch() {}
94 
100  services::SharedPtr<Batch> clone() const
101  {
102  return services::SharedPtr<Batch>(cloneImpl());
103  }
104 
105  ParameterType *sumOfFunctionsParameter;
106  InputType *sumOfFunctionsInput;
108 protected:
109  virtual Batch *cloneImpl() const DAAL_C11_OVERRIDE = 0;
110 
111  void initialize()
112  {}
113 };
114 typedef services::SharedPtr<Batch> BatchPtr;
115 
117 } // namespace interface1
118 
119 namespace interface2
120 {
139 class DAAL_EXPORT Batch : public objective_function::Batch
140 {
141 public:
142  typedef objective_function::Batch super;
143 
144  typedef algorithms::optimization_solver::sum_of_functions::Input InputType;
145  typedef algorithms::optimization_solver::sum_of_functions::Parameter ParameterType;
146  typedef super::ResultType ResultType;
147 
151  Batch(size_t numberOfTerms, InputType *sumOfFunctionsInput, ParameterType *sumOfFunctionsParameter) :
152  sumOfFunctionsInput(sumOfFunctionsInput),
153  sumOfFunctionsParameter(sumOfFunctionsParameter)
154  {
155  initialize();
156  if(sumOfFunctionsParameter != NULL) {sumOfFunctionsParameter->numberOfTerms = numberOfTerms;}
157  }
158 
165  Batch(const Batch &other) : sumOfFunctionsInput(other.sumOfFunctionsInput),
166  sumOfFunctionsParameter(other.sumOfFunctionsParameter)
167  {
168  initialize();
169  }
170 
171  virtual ~Batch() {}
172 
178  services::SharedPtr<Batch> clone() const
179  {
180  return services::SharedPtr<Batch>(cloneImpl());
181  }
182 
183  ParameterType *sumOfFunctionsParameter;
184  InputType *sumOfFunctionsInput;
186 protected:
187  virtual Batch *cloneImpl() const DAAL_C11_OVERRIDE = 0;
188 
189  void initialize()
190  {}
191 };
192 typedef services::SharedPtr<Batch> BatchPtr;
193 
195 } // namespace interface2
196 using interface2::Batch;
197 using interface2::BatchPtr;
198 
199 } // namespace sum_of_functions
200 } // namespace optimization_solver
201 } // namespace algorithm
202 } // namespace daal
203 #endif
daal::algorithms::optimization_solver::sum_of_functions::interface1::Input
Input objects for the Sum of functions
Definition: sum_of_functions_types.h:111
daal
Definition: algorithm_base_common.h:31
daal::algorithms::optimization_solver::sum_of_functions::interface1::Batch::Batch
Batch(const Batch &other)
Definition: sum_of_functions_batch.h:87
daal::algorithms::optimization_solver::sum_of_functions::interface1::Batch::clone
services::SharedPtr< Batch > clone() const
Definition: sum_of_functions_batch.h:100
daal_defines.h
daal::algorithms::optimization_solver::sum_of_functions::interface2::Batch
Interface for computing the Sum of functions in the batch processing mode.
Definition: sum_of_functions_batch.h:139
daal::algorithms::optimization_solver::sum_of_functions::interface1::Batch
Interface for computing the Sum of functions in the batch processing mode.
Definition: sum_of_functions_batch.h:61
daal::algorithms::optimization_solver::sum_of_functions::interface2::Batch::Batch
Batch(size_t numberOfTerms, InputType *sumOfFunctionsInput, ParameterType *sumOfFunctionsParameter)
Definition: sum_of_functions_batch.h:151
daal::algorithms::optimization_solver::sum_of_functions::interface1::Parameter
Parameter for the Sum of functions
Definition: sum_of_functions_types.h:69
daal::algorithms::optimization_solver::sum_of_functions::interface2::Batch::sumOfFunctionsParameter
ParameterType * sumOfFunctionsParameter
Definition: sum_of_functions_batch.h:183
daal::algorithms::optimization_solver::sum_of_functions::interface1::Batch::sumOfFunctionsInput
InputType * sumOfFunctionsInput
Definition: sum_of_functions_batch.h:106
daal::algorithms::optimization_solver::sum_of_functions::interface1::Parameter::numberOfTerms
size_t numberOfTerms
Definition: sum_of_functions_types.h:99
daal::algorithms::optimization_solver::sum_of_functions::interface2::Batch::sumOfFunctionsInput
InputType * sumOfFunctionsInput
Definition: sum_of_functions_batch.h:184
daal::algorithms::optimization_solver::sum_of_functions::interface1::Batch::Batch
Batch(size_t numberOfTerms, InputType *sumOfFunctionsInput, ParameterType *sumOfFunctionsParameter)
Definition: sum_of_functions_batch.h:73
daal::algorithms::optimization_solver::sum_of_functions::interface2::Batch::clone
services::SharedPtr< Batch > clone() const
Definition: sum_of_functions_batch.h:178
daal::algorithms::optimization_solver::sum_of_functions::interface1::Batch::sumOfFunctionsParameter
ParameterType * sumOfFunctionsParameter
Definition: sum_of_functions_batch.h:105
daal::algorithms::optimization_solver::sum_of_functions::interface2::Batch::Batch
Batch(const Batch &other)
Definition: sum_of_functions_batch.h:165

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