29 #ifndef DOXYGEN_SHOULD_SKIP_THIS 32 # define GUM_OPERATOR_PATTERN_ALLOWED 1
34 # include <agrum/tools/multidim/utils/operators/operatorRegister4MultiDim.h> 43 # define GUM_MULTI_DIM_OPERATOR_NAME add2MultiDimArrays 44 # define GUM_MULTI_DIM_OPERATOR(x, y) (x) + (y) 45 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimArray.h> 46 # undef GUM_MULTI_DIM_OPERATOR_NAME 47 # undef GUM_MULTI_DIM_OPERATOR 49 # define GUM_MULTI_DIM_OPERATOR_IMPL2ARRAY_NAME add2MultiDimArrays 50 # define GUM_MULTI_DIM_OPERATOR(x, y) (x) + (y) 51 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimArray.h> 52 # undef GUM_MULTI_DIM_OPERATOR_IMPL2ARRAY_NAME 53 # undef GUM_MULTI_DIM_OPERATOR 55 # define GUM_MULTI_DIM_OPERATOR_POINTER_NAME add2MultiDimArrays4Pointers 56 # define GUM_MULTI_DIM_OPERATOR(x, y) new T((*x) + (*y)) 57 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimArray.h> 58 # undef GUM_MULTI_DIM_OPERATOR_POINTER_NAME 59 # undef GUM_MULTI_DIM_OPERATOR 61 # define GUM_MULTI_DIM_OPERATOR_POINTER_IMPL2ARRAY_NAME add2MultiDimArrays4Pointers 62 # define GUM_MULTI_DIM_OPERATOR(x, y) new T((*x) + (*y)) 63 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimArray.h> 64 # undef GUM_MULTI_DIM_OPERATOR_POINTER_IMPL2ARRAY_NAME 65 # undef GUM_MULTI_DIM_OPERATOR 69 # define GUM_MULTI_DIM_OPERATOR_NAME subtract2MultiDimArrays 70 # define GUM_MULTI_DIM_OPERATOR(x, y) (x) - (y) 71 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimArray.h> 72 # undef GUM_MULTI_DIM_OPERATOR_NAME 73 # undef GUM_MULTI_DIM_OPERATOR 75 # define GUM_MULTI_DIM_OPERATOR_IMPL2ARRAY_NAME subtract2MultiDimArrays 76 # define GUM_MULTI_DIM_OPERATOR(x, y) (x) - (y) 77 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimArray.h> 78 # undef GUM_MULTI_DIM_OPERATOR_IMPL2ARRAY_NAME 79 # undef GUM_MULTI_DIM_OPERATOR 81 # define GUM_MULTI_DIM_OPERATOR_POINTER_NAME subtract2MultiDimArrays4Pointers 82 # define GUM_MULTI_DIM_OPERATOR(x, y) new T((*x) - (*y)) 83 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimArray.h> 84 # undef GUM_MULTI_DIM_OPERATOR_POINTER_NAME 85 # undef GUM_MULTI_DIM_OPERATOR 87 # define GUM_MULTI_DIM_OPERATOR_POINTER_IMPL2ARRAY_NAME subtract2MultiDimArrays4Pointers 88 # define GUM_MULTI_DIM_OPERATOR(x, y) new T((*x) - (*y)) 89 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimArray.h> 90 # undef GUM_MULTI_DIM_OPERATOR_POINTER_IMPL2ARRAY_NAME 91 # undef GUM_MULTI_DIM_OPERATOR 95 # define GUM_MULTI_DIM_OPERATOR_NAME multiply2MultiDimArrays 96 # define GUM_MULTI_DIM_OPERATOR(x, y) (x) * (y) 97 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimArray.h> 98 # undef GUM_MULTI_DIM_OPERATOR_NAME 99 # undef GUM_MULTI_DIM_OPERATOR 101 # define GUM_MULTI_DIM_OPERATOR_IMPL2ARRAY_NAME multiply2MultiDimArrays 102 # define GUM_MULTI_DIM_OPERATOR(x, y) (x) * (y) 103 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimArray.h> 104 # undef GUM_MULTI_DIM_OPERATOR_IMPL2ARRAY_NAME 105 # undef GUM_MULTI_DIM_OPERATOR 107 # define GUM_MULTI_DIM_OPERATOR_POINTER_NAME multiply2MultiDimArrays4Pointers 108 # define GUM_MULTI_DIM_OPERATOR(x, y) new T((*x) * (*y)) 109 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimArray.h> 110 # undef GUM_MULTI_DIM_OPERATOR_POINTER_NAME 111 # undef GUM_MULTI_DIM_OPERATOR 113 # define GUM_MULTI_DIM_OPERATOR_POINTER_IMPL2ARRAY_NAME multiply2MultiDimArrays4Pointers 114 # define GUM_MULTI_DIM_OPERATOR(x, y) new T((*x) * (*y)) 115 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimArray.h> 116 # undef GUM_MULTI_DIM_OPERATOR_POINTER_IMPL2ARRAY_NAME 117 # undef GUM_MULTI_DIM_OPERATOR 121 # define GUM_MULTI_DIM_OPERATOR_NAME divide2MultiDimArrays 122 # define GUM_MULTI_DIM_OPERATOR(x, y) (x) / (y) 123 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimArray.h> 124 # undef GUM_MULTI_DIM_OPERATOR_NAME 125 # undef GUM_MULTI_DIM_OPERATOR 127 # define GUM_MULTI_DIM_OPERATOR_IMPL2ARRAY_NAME divide2MultiDimArrays 128 # define GUM_MULTI_DIM_OPERATOR(x, y) (x) / (y) 129 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimArray.h> 130 # undef GUM_MULTI_DIM_OPERATOR_IMPL2ARRAY_NAME 131 # undef GUM_MULTI_DIM_OPERATOR 133 # define GUM_MULTI_DIM_OPERATOR_POINTER_NAME divide2MultiDimArrays4Pointers 134 # define GUM_MULTI_DIM_OPERATOR(x, y) new T((*x) / (*y)) 135 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimArray.h> 136 # undef GUM_MULTI_DIM_OPERATOR_POINTER_NAME 137 # undef GUM_MULTI_DIM_OPERATOR 139 # define GUM_MULTI_DIM_OPERATOR_POINTER_IMPL2ARRAY_NAME divide2MultiDimArrays4Pointers 140 # define GUM_MULTI_DIM_OPERATOR(x, y) new T((*x) / (*y)) 141 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimArray.h> 142 # undef GUM_MULTI_DIM_OPERATOR_POINTER_IMPL2ARRAY_NAME 143 # undef GUM_MULTI_DIM_OPERATOR 153 # define GUM_MULTI_DIM_OPERATOR std::plus 155 # define GUM_MULTI_DIM_OPERATOR_NAME add2MultiDimFunctionGraphs 156 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimFunctionGraph.h> 157 # undef GUM_MULTI_DIM_OPERATOR_NAME 159 # define GUM_MULTI_DIM_OPERATOR_IMPL2DECISION_GRAPH_NAME add2MultiDimFunctionGraphs 160 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimFunctionGraph.h> 161 # undef GUM_MULTI_DIM_OPERATOR_IMPL2DECISION_GRAPH_NAME 163 # undef GUM_MULTI_DIM_OPERATOR 169 # define GUM_MULTI_DIM_OPERATOR std::minus 171 # define GUM_MULTI_DIM_OPERATOR_NAME subtract2MultiDimFunctionGraphs 172 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimFunctionGraph.h> 173 # undef GUM_MULTI_DIM_OPERATOR_NAME 175 # define GUM_MULTI_DIM_OPERATOR_IMPL2DECISION_GRAPH_NAME subtract2MultiDimFunctionGraphs 176 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimFunctionGraph.h> 177 # undef GUM_MULTI_DIM_OPERATOR_IMPL2DECISION_GRAPH_NAME 179 # undef GUM_MULTI_DIM_OPERATOR 185 # define GUM_MULTI_DIM_OPERATOR std::multiplies 187 # define GUM_MULTI_DIM_OPERATOR_NAME multiply2MultiDimFunctionGraphs 188 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimFunctionGraph.h> 189 # undef GUM_MULTI_DIM_OPERATOR_NAME 191 # define GUM_MULTI_DIM_OPERATOR_IMPL2DECISION_GRAPH_NAME multiply2MultiDimFunctionGraphs 192 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimFunctionGraph.h> 193 # undef GUM_MULTI_DIM_OPERATOR_IMPL2DECISION_GRAPH_NAME 195 # undef GUM_MULTI_DIM_OPERATOR 201 # define GUM_MULTI_DIM_OPERATOR std::divides 203 # define GUM_MULTI_DIM_OPERATOR_NAME divide2MultiDimFunctionGraphs 204 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimFunctionGraph.h> 205 # undef GUM_MULTI_DIM_OPERATOR_NAME 207 # define GUM_MULTI_DIM_OPERATOR_IMPL2DECISION_GRAPH_NAME divide2MultiDimFunctionGraphs 208 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimFunctionGraph.h> 209 # undef GUM_MULTI_DIM_OPERATOR_IMPL2DECISION_GRAPH_NAME 211 # undef GUM_MULTI_DIM_OPERATOR 217 # define GUM_MULTI_DIM_OPERATOR Maximizes 219 # define GUM_MULTI_DIM_OPERATOR_NAME maximize2MultiDimFunctionGraphs 220 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimFunctionGraph.h> 221 # undef GUM_MULTI_DIM_OPERATOR_NAME 223 # define GUM_MULTI_DIM_OPERATOR_IMPL2DECISION_GRAPH_NAME maximize2MultiDimFunctionGraphs 224 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimFunctionGraph.h> 225 # undef GUM_MULTI_DIM_OPERATOR_IMPL2DECISION_GRAPH_NAME 227 # undef GUM_MULTI_DIM_OPERATOR 233 # define GUM_MULTI_DIM_OPERATOR Minimizes 235 # define GUM_MULTI_DIM_OPERATOR_NAME minimize2MultiDimFunctionGraphs 236 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimFunctionGraph.h> 237 # undef GUM_MULTI_DIM_OPERATOR_NAME 239 # define GUM_MULTI_DIM_OPERATOR_IMPL2DECISION_GRAPH_NAME minimize2MultiDimFunctionGraphs 240 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimFunctionGraph.h> 241 # undef GUM_MULTI_DIM_OPERATOR_IMPL2DECISION_GRAPH_NAME 243 # undef GUM_MULTI_DIM_OPERATOR 247 # define GUM_MULTI_DIM_OPERATOR_NAME_F combine2MultiDimArrays 248 # define GUM_MULTI_DIM_OPERATOR(x, y) f((x), (y)) 249 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimArray.h> 250 # undef GUM_MULTI_DIM_OPERATOR_NAME_F 251 # undef GUM_MULTI_DIM_OPERATOR 257 # define GUM_MULTI_DIM_OPERATOR_NAME operator
+ 258 # define GUM_MULTI_DIM_OPERATOR_FUNC_NAME "+" 259 # define GUM_MULTI_DIM_SYMMETRIC_OPERATOR 260 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimImplementation.h> 261 # undef GUM_MULTI_DIM_OPERATOR_NAME 262 # undef GUM_MULTI_DIM_OPERATOR_FUNC_NAME 263 # undef GUM_MULTI_DIM_SYMMETRIC_OPERATOR 266 # define GUM_MULTI_DIM_OPERATOR_NAME operator
* 267 # define GUM_MULTI_DIM_OPERATOR_FUNC_NAME "*" 268 # define GUM_MULTI_DIM_SYMMETRIC_OPERATOR 269 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimImplementation.h> 270 # undef GUM_MULTI_DIM_OPERATOR_NAME 271 # undef GUM_MULTI_DIM_OPERATOR_FUNC_NAME 272 # undef GUM_MULTI_DIM_SYMMETRIC_OPERATOR 275 # define GUM_MULTI_DIM_OPERATOR_NAME operator
- 276 # define GUM_MULTI_DIM_OPERATOR_FUNC_NAME "-" 277 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimImplementation.h> 278 # undef GUM_MULTI_DIM_OPERATOR_NAME 279 # undef GUM_MULTI_DIM_OPERATOR_FUNC_NAME 282 # define GUM_MULTI_DIM_OPERATOR_NAME operator
/ 283 # define GUM_MULTI_DIM_OPERATOR_FUNC_NAME "/" 284 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimImplementation.h> 285 # undef GUM_MULTI_DIM_OPERATOR_NAME 286 # undef GUM_MULTI_DIM_OPERATOR_FUNC_NAME 290 # define GUM_MULTI_DIM_OPERATOR_NAME add2MultiDimImplementations 291 # define GUM_MULTI_DIM_OPERATOR(x, y) (x) + (y) 292 # include <agrum/tools/multidim/utils/patterns/operatorPattern4BaseName.h> 293 # undef GUM_MULTI_DIM_OPERATOR_NAME 294 # undef GUM_MULTI_DIM_OPERATOR 296 # define GUM_MULTI_DIM_OPERATOR_NAME subtract2MultiDimImplementations 297 # define GUM_MULTI_DIM_OPERATOR(x, y) (x) - (y) 298 # include <agrum/tools/multidim/utils/patterns/operatorPattern4BaseName.h> 299 # undef GUM_MULTI_DIM_OPERATOR_NAME 300 # undef GUM_MULTI_DIM_OPERATOR 302 # define GUM_MULTI_DIM_OPERATOR_NAME multiply2MultiDimImplementations 303 # define GUM_MULTI_DIM_OPERATOR(x, y) (x) * (y) 304 # include <agrum/tools/multidim/utils/patterns/operatorPattern4BaseName.h> 305 # undef GUM_MULTI_DIM_OPERATOR_NAME 306 # undef GUM_MULTI_DIM_OPERATOR 308 # define GUM_MULTI_DIM_OPERATOR_NAME divide2MultiDimImplementations 309 # define GUM_MULTI_DIM_OPERATOR(x, y) (x) / (y) 310 # include <agrum/tools/multidim/utils/patterns/operatorPattern4BaseName.h> 311 # undef GUM_MULTI_DIM_OPERATOR_NAME 312 # undef GUM_MULTI_DIM_OPERATOR 321 template <
typename GUM_SCALAR >
323 static bool first_init =
true;
328 std::string MultiDimArrayString(
"MultiDimArray");
329 std::string MultiDimFunctionGraphString(
"MultiDimFunctionGraph");
330 std::string BaseNameString(
"MultiDimImplementation");
333 registerOperator< GUM_SCALAR >(
"+",
336 &add2MultiDimArrays);
337 registerOperator< GUM_SCALAR >(
"-",
340 &subtract2MultiDimArrays);
341 registerOperator< GUM_SCALAR >(
"*",
344 &multiply2MultiDimArrays);
345 registerOperator< GUM_SCALAR >(
"/",
348 ÷2MultiDimArrays);
351 registerOperator< GUM_SCALAR >(
"+",
352 MultiDimFunctionGraphString,
353 MultiDimFunctionGraphString,
354 &add2MultiDimFunctionGraphs);
355 registerOperator< GUM_SCALAR >(
"-",
356 MultiDimFunctionGraphString,
357 MultiDimFunctionGraphString,
358 &subtract2MultiDimFunctionGraphs);
359 registerOperator< GUM_SCALAR >(
"*",
360 MultiDimFunctionGraphString,
361 MultiDimFunctionGraphString,
362 &multiply2MultiDimFunctionGraphs);
363 registerOperator< GUM_SCALAR >(
"/",
364 MultiDimFunctionGraphString,
365 MultiDimFunctionGraphString,
366 ÷2MultiDimFunctionGraphs);
369 registerOperator< GUM_SCALAR >(
"+",
372 &add2MultiDimImplementations);
373 registerOperator< GUM_SCALAR >(
"-",
376 &subtract2MultiDimImplementations);
377 registerOperator< GUM_SCALAR >(
"*",
380 &multiply2MultiDimImplementations);
381 registerOperator< GUM_SCALAR >(
"/",
384 ÷2MultiDimImplementations);
389 template <
typename GUM_SCALAR >
391 static bool first_init =
true;
396 std::string MultiDimArrayString(
"MultiDimArray");
397 std::string BaseNameString(
"MultiDimImplementation");
400 registerOperator< GUM_SCALAR* >(
"+",
403 &add2MultiDimArrays4Pointers);
404 registerOperator< GUM_SCALAR* >(
"-",
407 &subtract2MultiDimArrays4Pointers);
408 registerOperator< GUM_SCALAR* >(
"*",
411 &multiply2MultiDimArrays4Pointers);
412 registerOperator< GUM_SCALAR* >(
"/",
415 ÷2MultiDimArrays4Pointers);
422 # undef GUM_OPERATOR_PATTERN_ALLOWED void operators4MultiDimInit()
the function used to register all the operators on multidimImplementations over non-pointers types...
INLINE void emplace(Args &&... args)
void pointerOperators4MultiDimInit()
the function used to register all the operators on multidimImplementations over pointers types...