aGrUM  0.14.2
scheduleProjection_tpl.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 #ifndef DOXYGEN_SHOULD_SKIP_THIS
29 
30 # include <agrum/agrum.h>
31 
32 namespace gum {
33 
35  template < typename GUM_SCALAR >
38  GUM_CONSTRUCTOR(ScheduleProjection);
39  }
40 
42  template < typename GUM_SCALAR >
44  const ScheduleProjection< GUM_SCALAR >& from) {
46  GUM_CONS_CPY(ScheduleProjection);
47  }
48 
50  template < typename GUM_SCALAR >
53  GUM_DESTRUCTOR(ScheduleProjection);
54  }
55 
57  template < typename GUM_SCALAR >
58  INLINE ScheduleMultiDim< GUM_SCALAR > ScheduleProjection< GUM_SCALAR >::project(
59  const MultiDimImplementation< GUM_SCALAR >& table,
60  const Set< const DiscreteVariable* >& del_vars,
61  Schedule< GUM_SCALAR >& schedule) {
62  ScheduleMultiDim< GUM_SCALAR > sched_table(table);
63  return project(sched_table, del_vars, schedule);
64  }
65 
67  template < typename GUM_SCALAR >
68  template < template < typename > class TABLE >
69  INLINE ScheduleMultiDim< GUM_SCALAR > ScheduleProjection< GUM_SCALAR >::project(
70  const TABLE< GUM_SCALAR >& table,
71  const Set< const DiscreteVariable* >& del_vars,
72  Schedule< GUM_SCALAR >& schedule) {
73  ScheduleMultiDim< GUM_SCALAR > sched_table(*(table.content()));
74  return project(sched_table, del_vars, schedule);
75  }
76 
79  template < typename GUM_SCALAR >
81  const MultiDimImplementation< GUM_SCALAR >& table,
82  const Set< const DiscreteVariable* >& del_vars,
83  const Schedule< GUM_SCALAR >& schedule) {
84  ScheduleMultiDim< GUM_SCALAR > sched_table(table);
85  return nbOperations(sched_table, del_vars, schedule);
86  }
87 
90  template < typename GUM_SCALAR >
91  template < template < typename > class TABLE >
93  const TABLE< GUM_SCALAR >& table,
94  const Set< const DiscreteVariable* >& del_vars,
95  const Schedule< GUM_SCALAR >& schedule) {
96  ScheduleMultiDim< GUM_SCALAR > sched_table(*(table.content()));
97  return nbOperations(sched_table, del_vars, schedule);
98  }
99 
101  template < typename GUM_SCALAR >
102  INLINE std::pair< long, long > ScheduleProjection< GUM_SCALAR >::memoryUsage(
103  const MultiDimImplementation< GUM_SCALAR >& table,
104  const Set< const DiscreteVariable* >& del_vars,
105  const Schedule< GUM_SCALAR >& schedule) {
106  ScheduleMultiDim< GUM_SCALAR > sched_table(table);
107  return memoryUsage(sched_table, del_vars, schedule);
108  }
109 
111  template < typename GUM_SCALAR >
112  template < template < typename > class TABLE >
113  INLINE std::pair< long, long > ScheduleProjection< GUM_SCALAR >::memoryUsage(
114  const TABLE< GUM_SCALAR >& table,
115  const Set< const DiscreteVariable* >& del_vars,
116  const Schedule< GUM_SCALAR >& schedule) {
117  ScheduleMultiDim< GUM_SCALAR > sched_table(*(table.content()));
118  return memoryUsage(sched_table, del_vars, schedule);
119  }
120 
121 } /* namespace gum */
122 
123 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
ScheduleProjection()
default constructor
virtual ~ScheduleProjection()
destructor
gum is the global namespace for all aGrUM entities
Definition: agrum.h:25
virtual float nbOperations(const ScheduleMultiDim< GUM_SCALAR > &table, const Set< const DiscreteVariable * > &del_vars, const Schedule< GUM_SCALAR > &schedule)=0
returns a rough estimate of the number of operations that will be performed to compute the projection...
virtual std::pair< long, long > memoryUsage(const ScheduleMultiDim< GUM_SCALAR > &table, const Set< const DiscreteVariable * > &del_vars, const Schedule< GUM_SCALAR > &schedule)=0
returns the memory consumption used during the projection
virtual ScheduleMultiDim< GUM_SCALAR > project(const ScheduleMultiDim< GUM_SCALAR > &table, const Set< const DiscreteVariable * > &del_vars, Schedule< GUM_SCALAR > &schedule)=0
creates and returns the projection of the table over a subset of its vars