aGrUM  0.20.3
a C++ library for (probabilistic) graphical models
scheduleProjection.h File Reference

Copyright (c) 2005-2021 by Pierre-Henri WUILLEMIN() & Christophe GONZALES() info_at_agrum_dot_org. More...

+ Include dependency graph for scheduleProjection.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  gum::ScheduleProjection< GUM_SCALAR >
 

Namespaces

 gum
 Copyright (c) 2005-2021 by Pierre-Henri WUILLEMIN() & Christophe GONZALES() info_at_agrum_dot_org.
 

Detailed Description

Copyright (c) 2005-2021 by Pierre-Henri WUILLEMIN() & Christophe GONZALES() info_at_agrum_dot_org.

This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library. If not, see http://www.gnu.org/licenses/. A generic class to project efficiently a ScheduleMultiDim over a subset of its variables

ScheduleProjection is a generic wrapper designed to project efficiently a multidimensional schedule object over a subset of its variables.

To be quite generic, the ScheduleProjection takes in argument the function that produces the result of the projection of the multidimensional object. The following code gives an example of the usage of ScheduleProjection:

// a function used to project a MultiDimImplementation<float>:
MultiDimImplementation<float>*
MinPot ( const MultiDimImplementation<float>& table,
const Set<const DiscreteVariable*>& del_vars ) {
return new MultiDimImplementation<float> (...);
}
// another function used to project a MultiDimImplementation<float>:
MultiDimImplementation<float>*
MaxPot ( const Potential<float>& table,
const Set<const DiscreteVariable*>& del_vars ) {
return new Potential<float> (...);
}
Schedule<float> schedule;
ScheduleMultiDim<float> t1, t2;
Set<const DiscreteVariable*> set1, set2;
ScheduleProjectionBasic<float> Proj ( MinPot );
ScheduleMultiDim<float> proj_table1 = Proj.project ( t1, set1, schedule );
// change the operator to apply
Proj.setProjectFunction ( MaxPot );
ScheduleMultiDim<float> proj_table2 = Proj.project ( t2, set2, schedule );
Author
Christophe GONZALES() and Pierre-Henri WUILLEMIN()

Definition in file scheduleProjection.h.