space_types.cxx
#include <vector>
#include <opengm/graphicalmodel/graphicalmodel.hxx>
#include <opengm/operations/adder.hxx>
#include <opengm/graphicalmodel/space/discretespace.hxx>
#include <opengm/graphicalmodel/space/simplediscretespace.hxx>
#include <opengm/graphicalmodel/space/grid_space.hxx>
using namespace std;
int main() {
typedef float ValueType;
typedef opengm::UInt32Type IndexType;
typedef opengm::UInt8Type LabelType;
typedef opengm::Adder OperationType;
typedef opengm::ExplicitFunction<ValueType> FunctionType;
{
typedef opengm::DiscreteSpace<IndexType,LabelType> SpaceType;
typedef opengm::GraphicalModel<
ValueType,
OperationType,
FunctionType,
SpaceType
> GraphicalModelType;
const LabelType numbersOfLabels[] = {2,4,6,4,3};
GraphicalModelType gm(SpaceType(numbersOfLabels, numbersOfLabels + 4));
}
{
typedef opengm::SimpleDiscreteSpace<IndexType,LabelType> SpaceType;
typedef opengm::GraphicalModel<
ValueType,
OperationType,
FunctionType,
SpaceType
> GraphicalModelType;
const IndexType numberOfVariables = 5;
const LabelType numberOfLabels = 4;
GraphicalModelType gm(SpaceType(numberOfVariables, numberOfLabels));
}
return 0;
}