aGrUM  0.14.2
projections4MultiDim.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  ***************************************************************************/
27 #ifndef GUM_PROJECTIONS_4_MULTI_DIM_H
28 #define GUM_PROJECTIONS_4_MULTI_DIM_H
29 
30 #include <agrum/core/set.h>
34 
35 namespace gum {
36 
37  // ==========================================================================
39  // ==========================================================================
41 
59  template < typename GUM_SCALAR >
60  MultiDimArray< GUM_SCALAR >*
61  projectMaxMultiDimArray(const MultiDimArray< GUM_SCALAR >* table,
62  const Set< const DiscreteVariable* >& del_vars);
63 
81  template < typename GUM_SCALAR >
82  MultiDimImplementation< GUM_SCALAR >*
83  projectMaxMultiDimArray(const MultiDimImplementation< GUM_SCALAR >* table,
84  const Set< const DiscreteVariable* >& del_vars);
85 
103  template < typename GUM_SCALAR >
104  MultiDimArray< GUM_SCALAR* >* projectMaxMultiDimArray4Pointers(
105  const MultiDimArray< GUM_SCALAR* >* table,
106  const Set< const DiscreteVariable* >& del_vars);
107 
125  template < typename GUM_SCALAR >
126  MultiDimImplementation< GUM_SCALAR* >* projectMaxMultiDimArray4Pointers(
127  const MultiDimImplementation< GUM_SCALAR* >* table,
128  const Set< const DiscreteVariable* >& del_vars);
129 
130  // @}
131  // ==========================================================================
133  // ==========================================================================
135 
153  template < typename GUM_SCALAR >
154  MultiDimArray< GUM_SCALAR >*
155  projectMinMultiDimArray(const MultiDimArray< GUM_SCALAR >* table,
156  const Set< const DiscreteVariable* >& del_vars);
157 
175  template < typename GUM_SCALAR >
176  MultiDimImplementation< GUM_SCALAR >*
177  projectMinMultiDimArray(const MultiDimImplementation< GUM_SCALAR >* table,
178  const Set< const DiscreteVariable* >& del_vars);
179 
197  template < typename GUM_SCALAR >
198  MultiDimArray< GUM_SCALAR* >* projectMinMultiDimArray4Pointers(
199  const MultiDimArray< GUM_SCALAR* >* table,
200  const Set< const DiscreteVariable* >& del_vars);
201 
219  template < typename GUM_SCALAR >
220  MultiDimImplementation< GUM_SCALAR* >* projectMinMultiDimArray4Pointers(
221  const MultiDimImplementation< GUM_SCALAR* >* table,
222  const Set< const DiscreteVariable* >& del_vars);
223 
224  // @}
225  // ==========================================================================
227  // ==========================================================================
229 
247  template < typename GUM_SCALAR >
248  MultiDimArray< GUM_SCALAR >*
249  projectSumMultiDimArray(const MultiDimArray< GUM_SCALAR >* table,
250  const Set< const DiscreteVariable* >& del_vars);
251 
269  template < typename GUM_SCALAR >
270  MultiDimImplementation< GUM_SCALAR >*
271  projectSumMultiDimArray(const MultiDimImplementation< GUM_SCALAR >* table,
272  const Set< const DiscreteVariable* >& del_vars);
273 
291  template < typename GUM_SCALAR >
292  MultiDimArray< GUM_SCALAR* >* projectSumMultiDimArray4Pointers(
293  const MultiDimArray< GUM_SCALAR* >* table,
294  const Set< const DiscreteVariable* >& del_vars);
295 
313  template < typename GUM_SCALAR >
314  MultiDimImplementation< GUM_SCALAR* >* projectSumMultiDimArray4Pointers(
315  const MultiDimImplementation< GUM_SCALAR* >* table,
316  const Set< const DiscreteVariable* >& del_vars);
317 
318  // @}
319  // ==========================================================================
321  // ==========================================================================
323 
341  template < typename GUM_SCALAR >
342  MultiDimArray< GUM_SCALAR >*
343  projectProductMultiDimArray(const MultiDimArray< GUM_SCALAR >* table,
344  const Set< const DiscreteVariable* >& del_vars);
345 
363  template < typename GUM_SCALAR >
364  MultiDimImplementation< GUM_SCALAR >*
365  projectProductMultiDimArray(const MultiDimImplementation< GUM_SCALAR >* table,
366  const Set< const DiscreteVariable* >& del_vars);
367 
385  template < typename GUM_SCALAR >
386  MultiDimArray< GUM_SCALAR* >* projectProductMultiDimArray4Pointers(
387  const MultiDimArray< GUM_SCALAR* >* table,
388  const Set< const DiscreteVariable* >& del_vars);
389 
407  template < typename GUM_SCALAR >
408  MultiDimImplementation< GUM_SCALAR* >* projectProductMultiDimArray4Pointers(
409  const MultiDimImplementation< GUM_SCALAR* >* table,
410  const Set< const DiscreteVariable* >& del_vars);
411 
412  // @}
413  // ==========================================================================
415  // ==========================================================================
417 
429  template < typename GUM_SCALAR >
430  MultiDimArray< GUM_SCALAR >* ProjectFuncMultiDimArray(
431  const MultiDimArray< GUM_SCALAR >* t1,
432  const MultiDimArray< GUM_SCALAR >* t2,
433  const GUM_SCALAR (*f)(const GUM_SCALAR&, const GUM_SCALAR&));
434 
446  template < typename GUM_SCALAR >
447  MultiDimImplementation< GUM_SCALAR >* combine2MultiDimArrays(
448  const MultiDimImplementation< GUM_SCALAR >* t1,
449  const MultiDimImplementation< GUM_SCALAR >* t2,
450  const GUM_SCALAR (*f)(const GUM_SCALAR&, const GUM_SCALAR&));
451 
452  // @}
453  // ==========================================================================
455  // ==========================================================================
457 
476  template < typename GUM_SCALAR >
479  const Set< const DiscreteVariable* >& del_vars);
480 
499  template < typename GUM_SCALAR >
500  MultiDimImplementation< GUM_SCALAR >* projectMaxMultiDimFunctionGraph(
501  const MultiDimImplementation< GUM_SCALAR >* table,
502  const Set< const DiscreteVariable* >& del_vars);
503 
504 
523  template < typename GUM_SCALAR >
526  const Set< const DiscreteVariable* >& del_vars);
527 
546  template < typename GUM_SCALAR >
547  MultiDimImplementation< GUM_SCALAR >* projectMinMultiDimFunctionGraph(
548  const MultiDimImplementation< GUM_SCALAR >* table,
549  const Set< const DiscreteVariable* >& del_vars);
550 
551 
570  template < typename GUM_SCALAR >
573  const Set< const DiscreteVariable* >& del_vars);
574 
593  template < typename GUM_SCALAR >
594  MultiDimImplementation< GUM_SCALAR >* projectSumMultiDimFunctionGraph(
595  const MultiDimImplementation< GUM_SCALAR >* table,
596  const Set< const DiscreteVariable* >& del_vars);
597 
598 
617  template < typename GUM_SCALAR >
620  const Set< const DiscreteVariable* >& del_vars);
621 
640  template < typename GUM_SCALAR >
641  MultiDimImplementation< GUM_SCALAR >* projectProductMultiDimFunctionGraph(
642  const MultiDimImplementation< GUM_SCALAR >* table,
643  const Set< const DiscreteVariable* >& del_vars);
644 
646 
648  template < typename GUM_SCALAR >
649  MultiDimImplementation< GUM_SCALAR >*
650  projectMax(const MultiDimImplementation< GUM_SCALAR >& table,
651  const Set< const DiscreteVariable* >& del_vars);
652 
654  template < typename GUM_SCALAR >
655  MultiDimImplementation< GUM_SCALAR >*
656  projectMin(const MultiDimImplementation< GUM_SCALAR >& table,
657  const Set< const DiscreteVariable* >& del_vars);
658 
660  template < typename GUM_SCALAR >
661  MultiDimImplementation< GUM_SCALAR >*
662  projectSum(const MultiDimImplementation< GUM_SCALAR >& table,
663  const Set< const DiscreteVariable* >& del_vars);
664 
667  template < typename GUM_SCALAR >
668  MultiDimImplementation< GUM_SCALAR >*
669  projectProduct(const MultiDimImplementation< GUM_SCALAR >& table,
670  const Set< const DiscreteVariable* >& del_vars);
671 
672 
673  // ==========================================================================
674  // DO NOT FORGET TO REGISTER YOUR PROJECTION FUNCTIONS AT THE END OF FILE
675  // projections4MultiDim_tpl.h
676  // ==========================================================================
677 
682  template < typename GUM_SCALAR >
684 
689  template < typename GUM_SCALAR >
691 
705  template < typename GUM_SCALAR >
707  void init() { projections4MultiDimInit< GUM_SCALAR >(); };
708  };
709 
724  template < typename GUM_SCALAR >
725  struct Projections4MultiDimInitialize< GUM_SCALAR* > {
726  void init() { pointerProjections4MultiDimInit< GUM_SCALAR >(); };
727  };
728 
729 } /* namespace gum */
730 
731 // always include the templatized implementations
733 
734 #endif /* GUM_PROJECTIONS_4_MULTI_DIM_H */
GUM_SCALAR * projectMinMultiDimArray4Pointers(const MultiDimArray< GUM_SCALAR * > *table, Instantiation *instantiation=0)
A specialized function for projecting a multiDimArray using a Min operator.
a class used to register projections over non-pointers types
GUM_SCALAR projectProduct(const MultiDimImplementation< GUM_SCALAR > &table, Instantiation *instantiation=0)
the function to be used to project a MultiDimImplementation using a Product
MultiDimFunctionGraph< GUM_SCALAR > * projectMinMultiDimFunctionGraph(const MultiDimFunctionGraph< GUM_SCALAR > *table, const Set< const DiscreteVariable * > &del_vars)
a specialized function for projecting a multiDimFunctionGraph using a Min operator ...
Sets of elements (i.e.
gum is the global namespace for all aGrUM entities
Definition: agrum.h:25
Headers of gum::MultiDimImplementation.
GUM_SCALAR projectMinMultiDimArray(const MultiDimArray< GUM_SCALAR > *table, Instantiation *instantiation=0)
A specialized function for projecting a multiDimArray using a Min operator.
GUM_SCALAR projectMaxMultiDimArray(const MultiDimArray< GUM_SCALAR > *table, Instantiation *instantiation=0)
A specialized function for projecting a multiDimArray using a Max operator.
MultiDimFunctionGraph< GUM_SCALAR > * projectSumMultiDimFunctionGraph(const MultiDimFunctionGraph< GUM_SCALAR > *table, const Set< const DiscreteVariable * > &del_vars)
a specialized function for projecting a multiDimFunctionGraph using a summation
MultiDimImplementation< GUM_SCALAR > * combine2MultiDimArrays(const MultiDimImplementation< GUM_SCALAR > *t1, const MultiDimImplementation< GUM_SCALAR > *t2, const GUM_SCALAR(*f)(const GUM_SCALAR &, const GUM_SCALAR &))
a specialized function for functionally projecting a multiDimArray
GUM_SCALAR * projectMaxMultiDimArray4Pointers(const MultiDimArray< GUM_SCALAR * > *table, Instantiation *instantiation=0)
A specialized function for projecting a multiDimArray using a Max operator.
void projections4MultiDimInit()
the function used to register all the projection operators on multidimImplementations over non-pointe...
MultiDimArray< GUM_SCALAR > * ProjectFuncMultiDimArray(const MultiDimArray< GUM_SCALAR > *t1, const MultiDimArray< GUM_SCALAR > *t2, const GUM_SCALAR(*f)(const GUM_SCALAR &, const GUM_SCALAR &))
a specialized function for functionally projecting a multiDimArray
MultiDimFunctionGraph< GUM_SCALAR > * projectProductMultiDimFunctionGraph(const MultiDimFunctionGraph< GUM_SCALAR > *table, const Set< const DiscreteVariable * > &del_vars)
a specialized function for projecting a multiDimFunctionGraph using products
Headers of MultiDimFunctionGraph.
GUM_SCALAR projectProductMultiDimArray(const MultiDimArray< GUM_SCALAR > *table, Instantiation *instantiation=0)
a function for projecting a multiDimArray using a Product operatorThe function projects a table over ...
GUM_SCALAR projectSum(const MultiDimImplementation< GUM_SCALAR > &table, Instantiation *instantiation=0)
the function to be used to project a MultiDimImplementation using a sum
MultiDimFunctionGraph< GUM_SCALAR > * projectMaxMultiDimFunctionGraph(const MultiDimFunctionGraph< GUM_SCALAR > *table, const Set< const DiscreteVariable * > &del_vars)
a specialized function for projecting a multiDimFunctionGraph using a Max operator ...
GUM_SCALAR projectSumMultiDimArray(const MultiDimArray< GUM_SCALAR > *table, Instantiation *instantiation=0)
a specialized function for projecting a multiDimArray using a Sum operatorThe function projects a tab...
GUM_SCALAR projectMin(const MultiDimImplementation< GUM_SCALAR > &table, Instantiation *instantiation=0)
the function to be used to project a MultiDimImplementation using a Min
Efficient functionals for projecting multiDimensional tables.
GUM_SCALAR projectMax(const MultiDimImplementation< GUM_SCALAR > &table, Instantiation *instantiation=0)
the function to be used to project a MultiDimImplementation using a Max
GUM_SCALAR * projectProductMultiDimArray4Pointers(const MultiDimArray< GUM_SCALAR * > *table, Instantiation *instantiation=0)
a function for projecting a multiDimArray using a Product operatorThe function projects a table over ...
GUM_SCALAR * projectSumMultiDimArray4Pointers(const MultiDimArray< GUM_SCALAR * > *table, Instantiation *instantiation=0)
a specialized function for projecting a multiDimArray using a Sum operatorThe function projects a tab...
void pointerProjections4MultiDimInit()
the function used to register all the projections on multidimImplementations over pointers types...
Header of the MultiDimArray class.