aGrUM  0.14.2
multiDimCompleteProjection.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2005 by Pierre-Henri WUILLEMIN et Christophe GONZALES *
3  * {prenom.nom}_at_lip6.fr *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19  ***************************************************************************/
26 #ifndef GUM_MULTI_DIM_COMPLETE_PROJECTION_H
27 #define GUM_MULTI_DIM_COMPLETE_PROJECTION_H
28 
29 #include <agrum/core/set.h>
32 #include <utility>
33 
34 namespace gum {
35 
36  // clang-format off
44  // clang-format on
45  template < typename GUM_SCALAR, template < typename > class TABLE >
47  public:
48  // ========================================================================
50  // ========================================================================
52 
54  MultiDimCompleteProjection(GUM_SCALAR (*proj)(const TABLE< GUM_SCALAR >&,
55  Instantiation*));
56 
60 
63 
71 
73  // ========================================================================
75  // ========================================================================
77 
79  GUM_SCALAR project(const TABLE< GUM_SCALAR >& table,
80  Instantiation* instantiation = 0);
81 
83  void setProjectFunction(GUM_SCALAR (*proj)(const TABLE< GUM_SCALAR >&,
84  Instantiation*));
85 
87  GUM_SCALAR(*projectFunction())
88  (const TABLE< GUM_SCALAR >&, Instantiation*);
89 
91 
92  protected:
94  GUM_SCALAR (*_proj)(const TABLE< GUM_SCALAR >&, Instantiation*);
95 
96  private:
100  };
101 
102 } /* namespace gum */
103 
104 // always include the template implementation
106 
107 #endif /* GUM_MULTI_DIM_COMPLETE_PROJECTION_H */
A generic class to project efficiently a MultiDim table over all of its variables.
Base class for discrete random variable.
virtual MultiDimCompleteProjection< GUM_SCALAR, TABLE > * newFactory() const
Virtual constructor.
Sets of elements (i.e.
MultiDimCompleteProjection< GUM_SCALAR, TABLE > & operator=(const MultiDimCompleteProjection< GUM_SCALAR, TABLE > &)
Forbid copy operators.
gum is the global namespace for all aGrUM entities
Definition: agrum.h:25
virtual ~MultiDimCompleteProjection()
Destructor.
Header files of gum::Instantiation.
GUM_SCALAR(* _proj)(const TABLE< GUM_SCALAR > &, Instantiation *)
The projection function actually used.
A generic class to project efficiently a MultiDim table over all of its variables.
Class for assigning/browsing values to tuples of discrete variables.
Definition: instantiation.h:80
GUM_SCALAR project(const TABLE< GUM_SCALAR > &table, Instantiation *instantiation=0)
Creates and returns the projection of the table over all of its vars.
void setProjectFunction(GUM_SCALAR(*proj)(const TABLE< GUM_SCALAR > &, Instantiation *))
Changes the function used for projecting TABLES.
MultiDimCompleteProjection(GUM_SCALAR(*proj)(const TABLE< GUM_SCALAR > &, Instantiation *))
Default constructor.