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

sum_of_functions_batch.h
1 /* file: sum_of_functions_batch.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 Sum of functions types.
21 //--
22 */
23 
24 #ifndef __SUM_OF_FUNCTIONS_BATCH_H__
25 #define __SUM_OF_FUNCTIONS_BATCH_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 #include "objective_function_batch.h"
32 #include "sum_of_functions_types.h"
33 
34 namespace daal
35 {
36 namespace algorithms
37 {
38 namespace optimization_solver
39 {
40 namespace sum_of_functions
41 {
42 
43 namespace interface1
44 {
63 class DAAL_EXPORT Batch : public objective_function::Batch
64 {
65 public:
66  typedef objective_function::Batch super;
67 
68  typedef algorithms::optimization_solver::sum_of_functions::interface1::Input InputType;
69  typedef algorithms::optimization_solver::sum_of_functions::interface1::Parameter ParameterType;
70  typedef super::ResultType ResultType;
71 
75  Batch(size_t numberOfTerms, InputType *sumOfFunctionsInput, ParameterType *sumOfFunctionsParameter) :
76  sumOfFunctionsInput(sumOfFunctionsInput),
77  sumOfFunctionsParameter(sumOfFunctionsParameter)
78  {
79  initialize();
80  if(sumOfFunctionsParameter != NULL) {sumOfFunctionsParameter->numberOfTerms = numberOfTerms;}
81  }
82 
89  Batch(const Batch &other) : sumOfFunctionsInput(other.sumOfFunctionsInput),
90  sumOfFunctionsParameter(other.sumOfFunctionsParameter)
91  {
92  initialize();
93  }
94 
95  virtual ~Batch() {}
96 
102  services::SharedPtr<Batch> clone() const
103  {
104  return services::SharedPtr<Batch>(cloneImpl());
105  }
106 
107  ParameterType *sumOfFunctionsParameter;
108  InputType *sumOfFunctionsInput;
110 protected:
111  virtual Batch *cloneImpl() const DAAL_C11_OVERRIDE = 0;
112 
113  void initialize()
114  {}
115 };
116 typedef services::SharedPtr<Batch> BatchPtr;
117 
119 } // namespace interface1
120 
121 namespace interface2
122 {
141 class DAAL_EXPORT Batch : public objective_function::Batch
142 {
143 public:
144  typedef objective_function::Batch super;
145 
146  typedef algorithms::optimization_solver::sum_of_functions::Input InputType;
147  typedef algorithms::optimization_solver::sum_of_functions::Parameter ParameterType;
148  typedef super::ResultType ResultType;
149 
153  Batch(size_t numberOfTerms, InputType *sumOfFunctionsInput, ParameterType *sumOfFunctionsParameter) :
154  sumOfFunctionsInput(sumOfFunctionsInput),
155  sumOfFunctionsParameter(sumOfFunctionsParameter)
156  {
157  initialize();
158  if(sumOfFunctionsParameter != NULL) {sumOfFunctionsParameter->numberOfTerms = numberOfTerms;}
159  }
160 
167  Batch(const Batch &other) : sumOfFunctionsInput(other.sumOfFunctionsInput),
168  sumOfFunctionsParameter(other.sumOfFunctionsParameter)
169  {
170  initialize();
171  }
172 
173  virtual ~Batch() {}
174 
180  services::SharedPtr<Batch> clone() const
181  {
182  return services::SharedPtr<Batch>(cloneImpl());
183  }
184 
185  ParameterType *sumOfFunctionsParameter;
186  InputType *sumOfFunctionsInput;
188 protected:
189  virtual Batch *cloneImpl() const DAAL_C11_OVERRIDE = 0;
190 
191  void initialize()
192  {}
193 };
194 typedef services::SharedPtr<Batch> BatchPtr;
195 
197 } // namespace interface2
198 using interface2::Batch;
199 using interface2::BatchPtr;
200 
201 } // namespace sum_of_functions
202 } // namespace optimization_solver
203 } // namespace algorithm
204 } // namespace daal
205 #endif
daal::algorithms::optimization_solver::sum_of_functions::interface1::Batch::sumOfFunctionsInput
InputType * sumOfFunctionsInput
Definition: sum_of_functions_batch.h:108
daal::algorithms::optimization_solver::sum_of_functions::interface1::Batch::Batch
Batch(size_t numberOfTerms, InputType *sumOfFunctionsInput, ParameterType *sumOfFunctionsParameter)
Definition: sum_of_functions_batch.h:75
daal::algorithms::optimization_solver::sum_of_functions::interface1::Batch::clone
services::SharedPtr< Batch > clone() const
Definition: sum_of_functions_batch.h:102
daal::algorithms::optimization_solver::sum_of_functions::interface1::Batch::Batch
Batch(const Batch &other)
Definition: sum_of_functions_batch.h:89
daal::algorithms::optimization_solver::sum_of_functions::interface1::Input
Input objects for the Sum of functions
Definition: sum_of_functions_types.h:113
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:141
daal::algorithms::optimization_solver::sum_of_functions::interface2::Batch::sumOfFunctionsInput
InputType * sumOfFunctionsInput
Definition: sum_of_functions_batch.h:186
daal::algorithms::optimization_solver::sum_of_functions::interface2::Batch::clone
services::SharedPtr< Batch > clone() const
Definition: sum_of_functions_batch.h:180
daal::algorithms::optimization_solver::sum_of_functions::interface2::Batch::Batch
Batch(size_t numberOfTerms, InputType *sumOfFunctionsInput, ParameterType *sumOfFunctionsParameter)
Definition: sum_of_functions_batch.h:153
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:63
daal::algorithms::optimization_solver::sum_of_functions::interface1::Parameter
Parameter for the Sum of functions
Definition: sum_of_functions_types.h:71
daal::algorithms::optimization_solver::sum_of_functions::interface2::Batch::sumOfFunctionsParameter
ParameterType * sumOfFunctionsParameter
Definition: sum_of_functions_batch.h:185
daal_defines.h
daal::algorithms::optimization_solver::sum_of_functions::interface1::Batch::sumOfFunctionsParameter
ParameterType * sumOfFunctionsParameter
Definition: sum_of_functions_batch.h:107
daal::algorithms::optimization_solver::sum_of_functions::interface1::Parameter::numberOfTerms
size_t numberOfTerms
Definition: sum_of_functions_types.h:101
daal::algorithms::optimization_solver::sum_of_functions::interface2::Batch::Batch
Batch(const Batch &other)
Definition: sum_of_functions_batch.h:167

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