aGrUM  0.20.3
a C++ library for (probabilistic) graphical models
gum::SimpleUTGenerator Class Reference

Class for generating Utility Tables. More...

#include <simpleUTGenerator.h>

+ Inheritance diagram for gum::SimpleUTGenerator:
+ Collaboration diagram for gum::SimpleUTGenerator:

Public Member Functions

Constructors / Destructor
 SimpleUTGenerator ()
 Default constructor. More...
 
virtual ~SimpleUTGenerator ()
 Destructor. More...
 
UT generation methods
virtual void generateUT (const Idx &varId, const Potential< float > &ut)
 Generates a UT using floats. More...
 
virtual void generateUT (const Idx &varId, const Potential< double > &ut)
 Generates a UT using doubles. More...
 

Detailed Description

Class for generating Utility Tables.

This class implements a CPTGenerator UT generation algorithm.

Definition at line 43 of file simpleUTGenerator.h.

Constructor & Destructor Documentation

◆ SimpleUTGenerator()

gum::SimpleUTGenerator::SimpleUTGenerator ( )

Default constructor.

Definition at line 34 of file simpleUTGenerator.cpp.

References gum::Set< Key, Alloc >::emplace().

34  {
35  GUM_CONSTRUCTOR(SimpleUTGenerator);
36  ;
37  }
SimpleUTGenerator()
Default constructor.
+ Here is the call graph for this function:

◆ ~SimpleUTGenerator()

gum::SimpleUTGenerator::~SimpleUTGenerator ( )
virtual

Destructor.

Definition at line 40 of file simpleUTGenerator.cpp.

References gum::Set< Key, Alloc >::emplace().

40  {
41  GUM_DESTRUCTOR(SimpleUTGenerator);
42  ;
43  }
SimpleUTGenerator()
Default constructor.
+ Here is the call graph for this function:

Member Function Documentation

◆ generateUT() [1/2]

void gum::SimpleUTGenerator::generateUT ( const Idx varId,
const Potential< float > &  ut 
)
virtual

Generates a UT using floats.

Parameters
varIdThe variable id of the UT owner.
utA reference on the UT to fill.

Implements gum::UTGenerator.

Definition at line 48 of file simpleUTGenerator.cpp.

References gum::Set< Key, Alloc >::emplace().

48  {
49  std::vector< float > v;
50 
51  for (Size i = 0; i < ut.domainSize(); ++i)
52  v.push_back((float)rand() * 1000);
53 
54  ut.populate(v);
55  }
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Definition: types.h:47
+ Here is the call graph for this function:

◆ generateUT() [2/2]

void gum::SimpleUTGenerator::generateUT ( const Idx varId,
const Potential< double > &  ut 
)
virtual

Generates a UT using doubles.

Parameters
varIdThe variable id of the UT owner.
utA reference on the UT to fill.

Implements gum::UTGenerator.

Definition at line 60 of file simpleUTGenerator.cpp.

References gum::Set< Key, Alloc >::emplace().

60  {
61  std::vector< double > v;
62 
63  for (Size i = 0; i < ut.domainSize(); ++i)
64  v.push_back((double)rand() * 1000);
65 
66  ut.populate(v);
67  }
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Definition: types.h:47
+ Here is the call graph for this function:

The documentation for this class was generated from the following files: