aGrUM 3.1.1
a C++ library for (probabilistic) graphical models
completeProjections4MultiDim.h
Go to the documentation of this file.
1/****************************************************************************
2 * This file is part of the aGrUM/pyAgrum library. *
3 * *
4 * Copyright (c) 2005-2026 by *
5 * - Pierre-Henri WUILLEMIN(_at_LIP6) *
6 * - Christophe GONZALES(_at_AMU) *
7 * *
8 * The aGrUM/pyAgrum library is free software; you can redistribute it *
9 * and/or modify it under the terms of either : *
10 * *
11 * - the GNU Lesser General Public License as published by *
12 * the Free Software Foundation, either version 3 of the License, *
13 * or (at your option) any later version, *
14 * - the MIT license (MIT), *
15 * - or both in dual license, as here. *
16 * *
17 * (see https://agrum.gitlab.io/articles/dual-licenses-lgplv3mit.html) *
18 * *
19 * This aGrUM/pyAgrum library is distributed in the hope that it will be *
20 * useful, but WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, *
21 * INCLUDING BUT NOT LIMITED TO THE WARRANTIES MERCHANTABILITY or FITNESS *
22 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE *
23 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
24 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
25 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR *
26 * OTHER DEALINGS IN THE SOFTWARE. *
27 * *
28 * See LICENCES for more details. *
29 * *
30 * SPDX-FileCopyrightText: Copyright 2005-2026 *
31 * - Pierre-Henri WUILLEMIN(_at_LIP6) *
32 * - Christophe GONZALES(_at_AMU) *
33 * SPDX-License-Identifier: LGPL-3.0-or-later OR MIT *
34 * *
35 * Contact : info_at_agrum_dot_org *
36 * homepage : http://agrum.gitlab.io *
37 * gitlab : https://gitlab.com/agrumery/agrum *
38 * *
39 ****************************************************************************/
40
41
49
50#ifndef GUM_COMPLETE_PROJECTIONS_4_MULTI_DIM_H
51#define GUM_COMPLETE_PROJECTIONS_4_MULTI_DIM_H
52
53// Workaround for GCC 14 on RHEL: atomic_wait.h uses syscall() without including
54// <sys/syscall.h>; <unistd.h> must be included first to declare syscall.
55#if !defined(_WIN32) && !defined(_WIN64)
56# include <unistd.h>
57#endif
58
59#include <atomic>
60#include <mutex>
61
63
64namespace gum {
65
66 // ==========================================================================
68 // ==========================================================================
70
92 template < typename GUM_ELEMENT >
94 Instantiation* instantiation = 0);
95
117 template < typename GUM_ELEMENT >
119 Instantiation* instantiation = 0);
120
142 template < typename GUM_ELEMENT >
144 Instantiation* instantiation = 0);
145
167 template < typename GUM_ELEMENT >
169 Instantiation* instantiation = 0);
170
172 // ==========================================================================
174 // ==========================================================================
176
198 template < typename GUM_ELEMENT >
200 Instantiation* instantiation = 0);
201
223 template < typename GUM_ELEMENT >
225 Instantiation* instantiation = 0);
226
248 template < typename GUM_ELEMENT >
250 Instantiation* instantiation = 0);
251
273 template < typename GUM_ELEMENT >
275 Instantiation* instantiation = 0);
276
278 // ==========================================================================
280 // ==========================================================================
282
305 template < typename GUM_ELEMENT >
307 Instantiation* instantiation = 0);
308
331 template < typename GUM_ELEMENT >
333 Instantiation* instantiation = 0);
334
357 template < typename GUM_ELEMENT >
359 Instantiation* instantiation = 0);
360
383 template < typename GUM_ELEMENT >
385 Instantiation* instantiation = 0);
386
388 // ==========================================================================
390 // ==========================================================================
392
414 template < typename GUM_ELEMENT >
416 Instantiation* instantiation = 0);
417
439 template < typename GUM_ELEMENT >
441 Instantiation* instantiation = 0);
442
464 template < typename GUM_ELEMENT >
466 Instantiation* instantiation = 0);
467
489 template < typename GUM_ELEMENT >
490 GUM_ELEMENT*
492 Instantiation* instantiation = 0);
493
495
497 template < typename GUM_ELEMENT >
499 Instantiation* instantiation = 0);
500
502 template < typename GUM_ELEMENT >
504 Instantiation* instantiation = 0);
505
507 template < typename GUM_ELEMENT >
509 Instantiation* instantiation = 0);
510
513 template < typename GUM_ELEMENT >
515 Instantiation* instantiation = 0);
516
517 // ==========================================================================
518 // DO NOT FORGET TO REGISTER YOUR PROJECTION FUNCTIONS AT THE END OF FILE
519 // completeProjections4MultiDim_tpl.h
520 // ==========================================================================
521
527 template < typename GUM_ELEMENT >
529
535 template < typename GUM_ELEMENT >
537
553 template < typename GUM_ELEMENT >
557
573 template < typename GUM_ELEMENT >
575 void init();
576 };
577
578} /* namespace gum */
579
580// always include the templatized implementations
582
583#endif /* GUM_COMPLETE_PROJECTIONS_4_MULTI_DIM_H */
Class for assigning/browsing values to tuples of discrete variables.
Multidimensional matrix stored as an array in memory.
<agrum/base/multidim/multiDimImplementation.h>
Efficient functionals for projecting multidim tables over all their variables.
GUM_ELEMENT projectMaxMultiDimArray(const MultiDimArray< GUM_ELEMENT > *table, Instantiation *instantiation=0)
A specialized function for projecting a multiDimArray using a Max operator.
void pointerCompleteProjections4MultiDimInit()
The function used to register all the complete projections on multidimImplementations over pointers t...
GUM_ELEMENT * projectSumMultiDimArray4Pointers(const MultiDimArray< GUM_ELEMENT * > *table, Instantiation *instantiation=0)
a specialized function for projecting a multiDimArray using a Sum operator
GUM_ELEMENT * projectMaxMultiDimArray4Pointers(const MultiDimArray< GUM_ELEMENT * > *table, Instantiation *instantiation=0)
A specialized function for projecting a multiDimArray using a Max operator.
GUM_ELEMENT projectMinMultiDimArray(const MultiDimArray< GUM_ELEMENT > *table, Instantiation *instantiation=0)
A specialized function for projecting a multiDimArray using a Min operator.
void completeProjections4MultiDimInit()
the function used to register all the complete projection operators on multidimImplementations over n...
GUM_ELEMENT * projectMinMultiDimArray4Pointers(const MultiDimArray< GUM_ELEMENT * > *table, Instantiation *instantiation=0)
A specialized function for projecting a multiDimArray using a Min operator.
GUM_ELEMENT * projectProductMultiDimArray4Pointers(const MultiDimArray< GUM_ELEMENT * > *table, Instantiation *instantiation=0)
a function for projecting a multiDimArray using a Product operator
GUM_ELEMENT projectProductMultiDimArray(const MultiDimArray< GUM_ELEMENT > *table, Instantiation *instantiation=0)
a function for projecting a multiDimArray using a Product operator
GUM_ELEMENT projectSumMultiDimArray(const MultiDimArray< GUM_ELEMENT > *table, Instantiation *instantiation=0)
a specialized function for projecting a multiDimArray using a Sum operator
Header of the MultiDimArray class.
gum is the global namespace for all aGrUM entities
Definition agrum.h:46
GUM_ELEMENT projectProduct(const MultiDimImplementation< GUM_ELEMENT > &table, Instantiation *instantiation=0)
the function to be used to project a MultiDimImplementation using a Product
GUM_ELEMENT projectSum(const MultiDimImplementation< GUM_ELEMENT > &table, Instantiation *instantiation=0)
the function to be used to project a MultiDimImplementation using a sum
GUM_ELEMENT projectMin(const MultiDimImplementation< GUM_ELEMENT > &table, Instantiation *instantiation=0)
the function to be used to project a MultiDimImplementation using a Min
GUM_ELEMENT projectMax(const MultiDimImplementation< GUM_ELEMENT > &table, Instantiation *instantiation=0)
the function to be used to project a MultiDimImplementation using a Max
a class used to register complete projections over non-pointers types