aGrUM
3.2.0
a C++ library for (probabilistic) graphical models
Toggle main menu visibility
multiDimCompleteProjection.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
47
48
#ifndef GUM_MULTI_DIM_COMPLETE_PROJECTION_H
49
#define GUM_MULTI_DIM_COMPLETE_PROJECTION_H
50
51
#include <utility>
52
53
#include <
agrum/base/multidim/instantiation.h
>
54
55
namespace
gum
{
56
57
// clang-format off
65
// clang-format on
66
67
template
<
typename
GUM_ELEMENT,
template
<
typename
>
class
TABLE >
68
class
MultiDimCompleteProjection
final {
69
public
:
70
// ========================================================================
72
// ========================================================================
74
76
MultiDimCompleteProjection
(GUM_ELEMENT (*proj)(
const
TABLE< GUM_ELEMENT >&,
Instantiation
*));
77
79
MultiDimCompleteProjection
(
const
MultiDimCompleteProjection< GUM_ELEMENT, TABLE >
&);
80
82
virtual
~MultiDimCompleteProjection
();
83
90
[[nodiscard]]
virtual
MultiDimCompleteProjection< GUM_ELEMENT, TABLE >
*
newFactory
()
const
;
91
93
// ========================================================================
95
// ========================================================================
97
99
GUM_ELEMENT
project
(
const
TABLE< GUM_ELEMENT >& table,
Instantiation
* instantiation = 0);
100
102
void
setProjectFunction
(GUM_ELEMENT (*proj)(
const
TABLE< GUM_ELEMENT >&,
Instantiation
*));
103
105
GUM_ELEMENT(*projectFunction())
106
(
const
TABLE< GUM_ELEMENT >&,
Instantiation
*);
107
109
110
protected
:
112
GUM_ELEMENT (*
proj_
)(
const
TABLE< GUM_ELEMENT >&,
Instantiation
*);
113
114
private
:
116
MultiDimCompleteProjection< GUM_ELEMENT, TABLE >
&
117
operator=
(
const
MultiDimCompleteProjection< GUM_ELEMENT, TABLE >
&);
118
};
119
120
}
/* namespace gum */
121
122
// always include the template implementation
123
#include <
agrum/base/multidim/utils/operators/multiDimCompleteProjection_tpl.h
>
124
125
#endif
/* GUM_MULTI_DIM_COMPLETE_PROJECTION_H */
gum::Instantiation
Class for assigning/browsing values to tuples of discrete variables.
Definition
instantiation.h:102
gum::MultiDimCompleteProjection::proj_
GUM_ELEMENT(*) proj_(const TABLE< GUM_ELEMENT > &, Instantiation *)
The projection function actually used.
Definition
multiDimCompleteProjection.h:112
gum::MultiDimCompleteProjection::project
GUM_ELEMENT project(const TABLE< GUM_ELEMENT > &table, Instantiation *instantiation=0)
Creates and returns the projection of the table over all of its vars.
gum::MultiDimCompleteProjection::~MultiDimCompleteProjection
virtual ~MultiDimCompleteProjection()
Destructor.
gum::MultiDimCompleteProjection::MultiDimCompleteProjection
MultiDimCompleteProjection(GUM_ELEMENT(*proj)(const TABLE< GUM_ELEMENT > &, Instantiation *))
Default constructor.
gum::MultiDimCompleteProjection::MultiDimCompleteProjection
MultiDimCompleteProjection(const MultiDimCompleteProjection< GUM_ELEMENT, TABLE > &)
Copy constructor.
gum::MultiDimCompleteProjection::newFactory
virtual MultiDimCompleteProjection< GUM_ELEMENT, TABLE > * newFactory() const
Virtual constructor.
gum::MultiDimCompleteProjection::operator=
MultiDimCompleteProjection< GUM_ELEMENT, TABLE > & operator=(const MultiDimCompleteProjection< GUM_ELEMENT, TABLE > &)
Forbid copy operators.
gum::MultiDimCompleteProjection::setProjectFunction
void setProjectFunction(GUM_ELEMENT(*proj)(const TABLE< GUM_ELEMENT > &, Instantiation *))
Changes the function used for projecting TABLES.
instantiation.h
Header files of gum::Instantiation.
multiDimCompleteProjection_tpl.h
A generic class to project efficiently a MultiDim table over all of its variables.
gum
gum is the global namespace for all aGrUM entities
Definition
agrum.h:46
aGrUM
3.2.0
© PHW&CG&others - 2022
DoXyGeN 1.18.0