aGrUM  0.16.0
scheduleProjection_tpl.h
Go to the documentation of this file.
1 
31 #ifndef DOXYGEN_SHOULD_SKIP_THIS
32 
33 # include <agrum/agrum.h>
34 
35 namespace gum {
36 
38  template < typename GUM_SCALAR >
41  GUM_CONSTRUCTOR(ScheduleProjection);
42  }
43 
45  template < typename GUM_SCALAR >
47  const ScheduleProjection< GUM_SCALAR >& from) {
49  GUM_CONS_CPY(ScheduleProjection);
50  }
51 
53  template < typename GUM_SCALAR >
56  GUM_DESTRUCTOR(ScheduleProjection);
57  }
58 
60  template < typename GUM_SCALAR >
61  INLINE ScheduleMultiDim< GUM_SCALAR > ScheduleProjection< GUM_SCALAR >::project(
62  const MultiDimImplementation< GUM_SCALAR >& table,
63  const Set< const DiscreteVariable* >& del_vars,
64  Schedule< GUM_SCALAR >& schedule) {
65  ScheduleMultiDim< GUM_SCALAR > sched_table(table);
66  return project(sched_table, del_vars, schedule);
67  }
68 
70  template < typename GUM_SCALAR >
71  template < template < typename > class TABLE >
72  INLINE ScheduleMultiDim< GUM_SCALAR > ScheduleProjection< GUM_SCALAR >::project(
73  const TABLE< GUM_SCALAR >& table,
74  const Set< const DiscreteVariable* >& del_vars,
75  Schedule< GUM_SCALAR >& schedule) {
76  ScheduleMultiDim< GUM_SCALAR > sched_table(*(table.content()));
77  return project(sched_table, del_vars, schedule);
78  }
79 
82  template < typename GUM_SCALAR >
84  const MultiDimImplementation< GUM_SCALAR >& table,
85  const Set< const DiscreteVariable* >& del_vars,
86  const Schedule< GUM_SCALAR >& schedule) {
87  ScheduleMultiDim< GUM_SCALAR > sched_table(table);
88  return nbOperations(sched_table, del_vars, schedule);
89  }
90 
93  template < typename GUM_SCALAR >
94  template < template < typename > class TABLE >
96  const TABLE< GUM_SCALAR >& table,
97  const Set< const DiscreteVariable* >& del_vars,
98  const Schedule< GUM_SCALAR >& schedule) {
99  ScheduleMultiDim< GUM_SCALAR > sched_table(*(table.content()));
100  return nbOperations(sched_table, del_vars, schedule);
101  }
102 
104  template < typename GUM_SCALAR >
105  INLINE std::pair< long, long > ScheduleProjection< GUM_SCALAR >::memoryUsage(
106  const MultiDimImplementation< GUM_SCALAR >& table,
107  const Set< const DiscreteVariable* >& del_vars,
108  const Schedule< GUM_SCALAR >& schedule) {
109  ScheduleMultiDim< GUM_SCALAR > sched_table(table);
110  return memoryUsage(sched_table, del_vars, schedule);
111  }
112 
114  template < typename GUM_SCALAR >
115  template < template < typename > class TABLE >
116  INLINE std::pair< long, long > ScheduleProjection< GUM_SCALAR >::memoryUsage(
117  const TABLE< GUM_SCALAR >& table,
118  const Set< const DiscreteVariable* >& del_vars,
119  const Schedule< GUM_SCALAR >& schedule) {
120  ScheduleMultiDim< GUM_SCALAR > sched_table(*(table.content()));
121  return memoryUsage(sched_table, del_vars, schedule);
122  }
123 
124 } /* namespace gum */
125 
126 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
ScheduleProjection()
default constructor
virtual ~ScheduleProjection()
destructor
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
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