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 62 add2MultiDimArrays4Pointers 63 # define GUM_MULTI_DIM_OPERATOR(x, y) new T((*x) + (*y)) 64 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimArray.h> 65 # undef GUM_MULTI_DIM_OPERATOR_POINTER_IMPL2ARRAY_NAME 66 # undef GUM_MULTI_DIM_OPERATOR 70 # define GUM_MULTI_DIM_OPERATOR_NAME subtract2MultiDimArrays 71 # define GUM_MULTI_DIM_OPERATOR(x, y) (x) - (y) 72 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimArray.h> 73 # undef GUM_MULTI_DIM_OPERATOR_NAME 74 # undef GUM_MULTI_DIM_OPERATOR 76 # define GUM_MULTI_DIM_OPERATOR_IMPL2ARRAY_NAME subtract2MultiDimArrays 77 # define GUM_MULTI_DIM_OPERATOR(x, y) (x) - (y) 78 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimArray.h> 79 # undef GUM_MULTI_DIM_OPERATOR_IMPL2ARRAY_NAME 80 # undef GUM_MULTI_DIM_OPERATOR 82 # define GUM_MULTI_DIM_OPERATOR_POINTER_NAME subtract2MultiDimArrays4Pointers 83 # define GUM_MULTI_DIM_OPERATOR(x, y) new T((*x) - (*y)) 84 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimArray.h> 85 # undef GUM_MULTI_DIM_OPERATOR_POINTER_NAME 86 # undef GUM_MULTI_DIM_OPERATOR 88 # define GUM_MULTI_DIM_OPERATOR_POINTER_IMPL2ARRAY_NAME 89 subtract2MultiDimArrays4Pointers 90 # define GUM_MULTI_DIM_OPERATOR(x, y) new T((*x) - (*y)) 91 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimArray.h> 92 # undef GUM_MULTI_DIM_OPERATOR_POINTER_IMPL2ARRAY_NAME 93 # undef GUM_MULTI_DIM_OPERATOR 97 # define GUM_MULTI_DIM_OPERATOR_NAME multiply2MultiDimArrays 98 # define GUM_MULTI_DIM_OPERATOR(x, y) (x) * (y) 99 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimArray.h> 100 # undef GUM_MULTI_DIM_OPERATOR_NAME 101 # undef GUM_MULTI_DIM_OPERATOR 103 # define GUM_MULTI_DIM_OPERATOR_IMPL2ARRAY_NAME multiply2MultiDimArrays 104 # define GUM_MULTI_DIM_OPERATOR(x, y) (x) * (y) 105 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimArray.h> 106 # undef GUM_MULTI_DIM_OPERATOR_IMPL2ARRAY_NAME 107 # undef GUM_MULTI_DIM_OPERATOR 109 # define GUM_MULTI_DIM_OPERATOR_POINTER_NAME multiply2MultiDimArrays4Pointers 110 # define GUM_MULTI_DIM_OPERATOR(x, y) new T((*x) * (*y)) 111 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimArray.h> 112 # undef GUM_MULTI_DIM_OPERATOR_POINTER_NAME 113 # undef GUM_MULTI_DIM_OPERATOR 115 # define GUM_MULTI_DIM_OPERATOR_POINTER_IMPL2ARRAY_NAME 116 multiply2MultiDimArrays4Pointers 117 # define GUM_MULTI_DIM_OPERATOR(x, y) new T((*x) * (*y)) 118 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimArray.h> 119 # undef GUM_MULTI_DIM_OPERATOR_POINTER_IMPL2ARRAY_NAME 120 # undef GUM_MULTI_DIM_OPERATOR 124 # define GUM_MULTI_DIM_OPERATOR_NAME divide2MultiDimArrays 125 # define GUM_MULTI_DIM_OPERATOR(x, y) (x) / (y) 126 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimArray.h> 127 # undef GUM_MULTI_DIM_OPERATOR_NAME 128 # undef GUM_MULTI_DIM_OPERATOR 130 # define GUM_MULTI_DIM_OPERATOR_IMPL2ARRAY_NAME divide2MultiDimArrays 131 # define GUM_MULTI_DIM_OPERATOR(x, y) (x) / (y) 132 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimArray.h> 133 # undef GUM_MULTI_DIM_OPERATOR_IMPL2ARRAY_NAME 134 # undef GUM_MULTI_DIM_OPERATOR 136 # define GUM_MULTI_DIM_OPERATOR_POINTER_NAME divide2MultiDimArrays4Pointers 137 # define GUM_MULTI_DIM_OPERATOR(x, y) new T((*x) / (*y)) 138 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimArray.h> 139 # undef GUM_MULTI_DIM_OPERATOR_POINTER_NAME 140 # undef GUM_MULTI_DIM_OPERATOR 142 # define GUM_MULTI_DIM_OPERATOR_POINTER_IMPL2ARRAY_NAME 143 divide2MultiDimArrays4Pointers 144 # define GUM_MULTI_DIM_OPERATOR(x, y) new T((*x) / (*y)) 145 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimArray.h> 146 # undef GUM_MULTI_DIM_OPERATOR_POINTER_IMPL2ARRAY_NAME 147 # undef GUM_MULTI_DIM_OPERATOR 157 # define GUM_MULTI_DIM_OPERATOR std::plus 159 # define GUM_MULTI_DIM_OPERATOR_NAME add2MultiDimFunctionGraphs 160 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimFunctionGraph.h> 161 # undef GUM_MULTI_DIM_OPERATOR_NAME 163 # define GUM_MULTI_DIM_OPERATOR_IMPL2DECISION_GRAPH_NAME 164 add2MultiDimFunctionGraphs 165 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimFunctionGraph.h> 166 # undef GUM_MULTI_DIM_OPERATOR_IMPL2DECISION_GRAPH_NAME 168 # undef GUM_MULTI_DIM_OPERATOR 174 # define GUM_MULTI_DIM_OPERATOR std::minus 176 # define GUM_MULTI_DIM_OPERATOR_NAME subtract2MultiDimFunctionGraphs 177 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimFunctionGraph.h> 178 # undef GUM_MULTI_DIM_OPERATOR_NAME 180 # define GUM_MULTI_DIM_OPERATOR_IMPL2DECISION_GRAPH_NAME 181 subtract2MultiDimFunctionGraphs 182 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimFunctionGraph.h> 183 # undef GUM_MULTI_DIM_OPERATOR_IMPL2DECISION_GRAPH_NAME 185 # undef GUM_MULTI_DIM_OPERATOR 191 # define GUM_MULTI_DIM_OPERATOR std::multiplies 193 # define GUM_MULTI_DIM_OPERATOR_NAME multiply2MultiDimFunctionGraphs 194 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimFunctionGraph.h> 195 # undef GUM_MULTI_DIM_OPERATOR_NAME 197 # define GUM_MULTI_DIM_OPERATOR_IMPL2DECISION_GRAPH_NAME 198 multiply2MultiDimFunctionGraphs 199 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimFunctionGraph.h> 200 # undef GUM_MULTI_DIM_OPERATOR_IMPL2DECISION_GRAPH_NAME 202 # undef GUM_MULTI_DIM_OPERATOR 208 # define GUM_MULTI_DIM_OPERATOR std::divides 210 # define GUM_MULTI_DIM_OPERATOR_NAME divide2MultiDimFunctionGraphs 211 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimFunctionGraph.h> 212 # undef GUM_MULTI_DIM_OPERATOR_NAME 214 # define GUM_MULTI_DIM_OPERATOR_IMPL2DECISION_GRAPH_NAME 215 divide2MultiDimFunctionGraphs 216 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimFunctionGraph.h> 217 # undef GUM_MULTI_DIM_OPERATOR_IMPL2DECISION_GRAPH_NAME 219 # undef GUM_MULTI_DIM_OPERATOR 225 # define GUM_MULTI_DIM_OPERATOR Maximizes 227 # define GUM_MULTI_DIM_OPERATOR_NAME maximize2MultiDimFunctionGraphs 228 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimFunctionGraph.h> 229 # undef GUM_MULTI_DIM_OPERATOR_NAME 231 # define GUM_MULTI_DIM_OPERATOR_IMPL2DECISION_GRAPH_NAME 232 maximize2MultiDimFunctionGraphs 233 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimFunctionGraph.h> 234 # undef GUM_MULTI_DIM_OPERATOR_IMPL2DECISION_GRAPH_NAME 236 # undef GUM_MULTI_DIM_OPERATOR 242 # define GUM_MULTI_DIM_OPERATOR Minimizes 244 # define GUM_MULTI_DIM_OPERATOR_NAME minimize2MultiDimFunctionGraphs 245 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimFunctionGraph.h> 246 # undef GUM_MULTI_DIM_OPERATOR_NAME 248 # define GUM_MULTI_DIM_OPERATOR_IMPL2DECISION_GRAPH_NAME 249 minimize2MultiDimFunctionGraphs 250 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimFunctionGraph.h> 251 # undef GUM_MULTI_DIM_OPERATOR_IMPL2DECISION_GRAPH_NAME 253 # undef GUM_MULTI_DIM_OPERATOR 257 # define GUM_MULTI_DIM_OPERATOR_NAME_F combine2MultiDimArrays 258 # define GUM_MULTI_DIM_OPERATOR(x, y) f((x), (y)) 259 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimArray.h> 260 # undef GUM_MULTI_DIM_OPERATOR_NAME_F 261 # undef GUM_MULTI_DIM_OPERATOR 267 # define GUM_MULTI_DIM_OPERATOR_NAME operator
+ 268 # define GUM_MULTI_DIM_OPERATOR_FUNC_NAME "+" 269 # define GUM_MULTI_DIM_SYMMETRIC_OPERATOR 270 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimImplementation.h> 271 # undef GUM_MULTI_DIM_OPERATOR_NAME 272 # undef GUM_MULTI_DIM_OPERATOR_FUNC_NAME 273 # undef GUM_MULTI_DIM_SYMMETRIC_OPERATOR 276 # define GUM_MULTI_DIM_OPERATOR_NAME operator
* 277 # define GUM_MULTI_DIM_OPERATOR_FUNC_NAME "*" 278 # define GUM_MULTI_DIM_SYMMETRIC_OPERATOR 279 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimImplementation.h> 280 # undef GUM_MULTI_DIM_OPERATOR_NAME 281 # undef GUM_MULTI_DIM_OPERATOR_FUNC_NAME 282 # undef GUM_MULTI_DIM_SYMMETRIC_OPERATOR 285 # define GUM_MULTI_DIM_OPERATOR_NAME operator
- 286 # define GUM_MULTI_DIM_OPERATOR_FUNC_NAME "-" 287 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimImplementation.h> 288 # undef GUM_MULTI_DIM_OPERATOR_NAME 289 # undef GUM_MULTI_DIM_OPERATOR_FUNC_NAME 292 # define GUM_MULTI_DIM_OPERATOR_NAME operator
/ 293 # define GUM_MULTI_DIM_OPERATOR_FUNC_NAME "/" 294 # include <agrum/tools/multidim/utils/patterns/operatorPattern4MultiDimImplementation.h> 295 # undef GUM_MULTI_DIM_OPERATOR_NAME 296 # undef GUM_MULTI_DIM_OPERATOR_FUNC_NAME 300 # define GUM_MULTI_DIM_OPERATOR_NAME add2MultiDimImplementations 301 # define GUM_MULTI_DIM_OPERATOR(x, y) (x) + (y) 302 # include <agrum/tools/multidim/utils/patterns/operatorPattern4BaseName.h> 303 # undef GUM_MULTI_DIM_OPERATOR_NAME 304 # undef GUM_MULTI_DIM_OPERATOR 306 # define GUM_MULTI_DIM_OPERATOR_NAME subtract2MultiDimImplementations 307 # define GUM_MULTI_DIM_OPERATOR(x, y) (x) - (y) 308 # include <agrum/tools/multidim/utils/patterns/operatorPattern4BaseName.h> 309 # undef GUM_MULTI_DIM_OPERATOR_NAME 310 # undef GUM_MULTI_DIM_OPERATOR 312 # define GUM_MULTI_DIM_OPERATOR_NAME multiply2MultiDimImplementations 313 # define GUM_MULTI_DIM_OPERATOR(x, y) (x) * (y) 314 # include <agrum/tools/multidim/utils/patterns/operatorPattern4BaseName.h> 315 # undef GUM_MULTI_DIM_OPERATOR_NAME 316 # undef GUM_MULTI_DIM_OPERATOR 318 # define GUM_MULTI_DIM_OPERATOR_NAME divide2MultiDimImplementations 319 # define GUM_MULTI_DIM_OPERATOR(x, y) (x) / (y) 320 # include <agrum/tools/multidim/utils/patterns/operatorPattern4BaseName.h> 321 # undef GUM_MULTI_DIM_OPERATOR_NAME 322 # undef GUM_MULTI_DIM_OPERATOR 331 template <
typename GUM_SCALAR >
333 static bool first_init =
true;
338 std::string MultiDimArrayString(
"MultiDimArray");
339 std::string MultiDimFunctionGraphString(
"MultiDimFunctionGraph");
340 std::string BaseNameString(
"MultiDimImplementation");
343 registerOperator< GUM_SCALAR >(
"+",
346 &add2MultiDimArrays);
347 registerOperator< GUM_SCALAR >(
"-",
350 &subtract2MultiDimArrays);
351 registerOperator< GUM_SCALAR >(
"*",
354 &multiply2MultiDimArrays);
355 registerOperator< GUM_SCALAR >(
"/",
358 ÷2MultiDimArrays);
361 registerOperator< GUM_SCALAR >(
"+",
362 MultiDimFunctionGraphString,
363 MultiDimFunctionGraphString,
364 &add2MultiDimFunctionGraphs);
365 registerOperator< GUM_SCALAR >(
"-",
366 MultiDimFunctionGraphString,
367 MultiDimFunctionGraphString,
368 &subtract2MultiDimFunctionGraphs);
369 registerOperator< GUM_SCALAR >(
"*",
370 MultiDimFunctionGraphString,
371 MultiDimFunctionGraphString,
372 &multiply2MultiDimFunctionGraphs);
373 registerOperator< GUM_SCALAR >(
"/",
374 MultiDimFunctionGraphString,
375 MultiDimFunctionGraphString,
376 ÷2MultiDimFunctionGraphs);
379 registerOperator< GUM_SCALAR >(
"+",
382 &add2MultiDimImplementations);
383 registerOperator< GUM_SCALAR >(
"-",
386 &subtract2MultiDimImplementations);
387 registerOperator< GUM_SCALAR >(
"*",
390 &multiply2MultiDimImplementations);
391 registerOperator< GUM_SCALAR >(
"/",
394 ÷2MultiDimImplementations);
399 template <
typename GUM_SCALAR >
401 static bool first_init =
true;
406 std::string MultiDimArrayString(
"MultiDimArray");
407 std::string BaseNameString(
"MultiDimImplementation");
410 registerOperator< GUM_SCALAR* >(
"+",
413 &add2MultiDimArrays4Pointers);
414 registerOperator< GUM_SCALAR* >(
"-",
417 &subtract2MultiDimArrays4Pointers);
418 registerOperator< GUM_SCALAR* >(
"*",
421 &multiply2MultiDimArrays4Pointers);
422 registerOperator< GUM_SCALAR* >(
"/",
425 ÷2MultiDimArrays4Pointers);
432 # 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...