aGrUM  0.14.2
operatorPattern4MultiDimFunctionGraph.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  ***************************************************************************/
28 // check if we allowed these patterns to be used
29 #ifndef GUM_OPERATOR_PATTERN_ALLOWED
30 
31 // #warning To use operatorPattern4MultiDimFunctionGraph.h, you must define
32 // GUM_OPERATOR_PATTERN_ALLOWED
33 
34 #else
35 
36 # include <agrum/core/functors.h>
37 
41 
42 namespace gum {
43 
50 # ifdef GUM_MULTI_DIM_OPERATOR_NAME
51 # define GUM_MULTI_DIM_OPERATOR_TYPE GUM_SCALAR
52  template < typename GUM_SCALAR >
53  MultiDimFunctionGraph< GUM_SCALAR >* GUM_MULTI_DIM_OPERATOR_NAME(
56 # endif
57 
58  // clang-format off
59 
60 #ifdef GUM_MULTI_DIM_OPERATOR_IMPL2DECISION_GRAPH_NAME
61 #define GUM_MULTI_DIM_OPERATOR_TYPE GUM_SCALAR
62  template <typename GUM_SCALAR>
63  MultiDimImplementation<GUM_SCALAR>*
64  GUM_MULTI_DIM_OPERATOR_IMPL2DECISION_GRAPH_NAME(
65  const MultiDimImplementation<GUM_SCALAR>* tt1,
66  const MultiDimImplementation<GUM_SCALAR>* tt2 )
67 #endif
68 
69  // clang-format on
70 
71  {
72 
73 # ifdef GUM_MULTI_DIM_OPERATOR_IMPL2DECISION_GRAPH_NAME
75  reinterpret_cast< const MultiDimFunctionGraph< GUM_SCALAR >* >(tt1);
77  reinterpret_cast< const MultiDimFunctionGraph< GUM_SCALAR >* >(tt2);
78 # endif
79  MultiDimFunctionGraphOperator< GUM_MULTI_DIM_OPERATOR_TYPE,
80  GUM_MULTI_DIM_OPERATOR >
81  ope(dg1, dg2);
82 
83  return ope.compute();
84  }
85 # undef GUM_MULTI_DIM_OPERATOR_TYPE
86 
87 } // End of namespace gum
88 #endif /* GUM_OPERATOR_PATTERN_ALLOWED */
gum is the global namespace for all aGrUM entities
Definition: agrum.h:25
This files contains several function objects that are not (yet) defined in the STL.
Headers of gum::MultiDimImplementation.
Class used to compute the operation between two decision diagrams.
Headers of MultiDimFunctionGraph.