- Main Page
- Namespaces
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# tut::BFIGHelper Class Reference

`#include <BFIGHelper.h>`

Inheritance diagram for tut::BFIGHelper:

[legend]
Collaboration diagram for tut::BFIGHelper:

[legend]
List of all members.

## Public Member Functions
| BFIGHelper ()
virtual | ~BFIGHelper ()
## Protected Member Functions
void | initBFIGData (unsigned int numDomains, const struct BFIGDomainEntry *domains, unsigned int numVariables, const struct BFIGVariableEntry *variables) throw ()
void | initBFIGVariables (bool isProbabilities) throw ()
template<int n>
void | loadAssignments (std::vector< Mers::Models::Base::BaseModelAssignmentArray * > &assignments, unsigned int numAssignments, const unsigned int assignmentsData[][n])
void | loadAssignments (std::vector< Mers::Generators::BFIG::BFIGAssignment * > &assignments, const unsigned int assignmentsData[])
void | loadAssignments (std::vector< Mers::Generators::BFIG::BFIGAssignment const * > &assignments, const unsigned int assignmentsData[])
void | loadConstraints (std::vector< Mers::Generators::BFIG::BFIGConstraint * > &constraints, const unsigned int constraintValues[], const bool constraintParity[])
void | loadConstraints (std::vector< Mers::Generators::BFIG::BFIGConstraint const * > &constraints, const unsigned int constraintValues[], const bool constraintParity[])
template<class T>
void | convertVector (std::vector< const T * > &constVect, const std::vector< T * > &vect)
## Protected Attributes
Mers::Models::Base::BaseModelVariableArray | mBFIGVariables
| The set of BFIG variables.
Mers::Models::Base::BaseModelVariableArray | mAllVariables
| The set of all variables, including BFIG variables.
Mers::Models::Base::BaseModelDomainArray | mDomains
| The set of all domains.
Mers::Utils::Containers::IntegerArray | mValueMap
std::vector< double > | mProbabilities
| The list of all probabilities.
std::vector< Mers::Generators::BFIG::BFIGVariable * > | mBFIGVarList
## Classes
struct | BFIGDomainEntry
struct | BFIGVariableEntry

## Detailed Description

This class describes the basic building blocks for any BFIG set of objects (namely variables and domains). It also provides basic mechanisms to load said items.

Definition at line 30 of file BFIGHelper.h.

## Constructor & Destructor Documentation

tut::BFIGHelper::BFIGHelper | ( |  | ) |

Creates a new BFIG helper object.

Definition at line 29 of file BFIGHelper.cpp.

tut::BFIGHelper::~BFIGHelper | ( |  | ) | `[virtual]`

Destroys this object.

Definition at line 37 of file BFIGHelper.cpp.

References mBFIGVarList.

## Member Function Documentation

void tut::BFIGHelper::initBFIGData | ( | unsigned int | numDomains,
|  | const struct BFIGDomainEntry * | domains,
|  | unsigned int | numVariables,
|  | const struct BFIGVariableEntry * | variables |
| ) |  |  | throw ()`[protected]`

Creates a BFIG data structure for use with further testing.

Parameters:

  | numDomains | The number of domains being passed into this function.
  | domains | The list of domains used to initialize BFIG.
  | numVariables | The number of variables being passed into this function.
  | variables | The list of variables used to initialize BFIG.

Load our domains

Definition at line 48 of file BFIGHelper.cpp.

Referenced by tut::BFIGImplicant1Data::BFIGImplicant1Data().

void tut::BFIGHelper::initBFIGVariables | ( | bool | isProbabilities | ) | throw ()`[protected]`

Initializes a set of BFIGVariable objects based on the other initialized data. initBFIGData must have previously been called to end up with any BFIGVariable objects.

Parameters:

  | isProbabilities | True if the probsOrCosts field of the variables should be considered probabilities. False if they should be considered costs.

Definition at line 93 of file BFIGHelper.cpp.

References Mers::Utils::Containers::DynamicArray::getLength(), and vector< _Tp, _Alloc >::resize().

Referenced by tut::BFIGImplicant1Data::BFIGImplicant1Data().

Here is the call graph for this function:

template<int n>

void tut::BFIGHelper::loadAssignments | ( | std::vector< Mers::Models::Base::BaseModelAssignmentArray * > & | assignments,
|  | unsigned int | numAssignments,
|  | const unsigned int | assignmentsData[][n] |
| ) |  |  | `[inline, protected]`

Loads the specified assignmentData into the assignment list.

Parameters:

  | assignments | The set of assignments loaded will be placed here.
  | numAssignments | The number of sets of assignments present in the data.
  | assignmentsData | The set of assignment data being used to load the assignments. This array is an array of indexes corresponding to values. The value assignmentsData[a][v] is the index of the value to assign to the variable v in the assignment set a. Hence, this allows one to specify compactly the assignments expected. The variables are matched against the mBFIGVariables list in the order they appear in this list. A value of ((unsigned int)-1) indicates that the variable has not value in this assignment. Thus any partial assignment is also possible. Typically this parameter is specified by something like: const unsigned int noVal = (unsigned int)-1; const unsigned int assignments[2][3] = { {1, 0, noVal}, {0, 3, 1} };

Definition at line 125 of file BFIGHelper.h.

References Mers::Utils::Containers::DynamicArray::getLength(), Mers::Models::Base::BaseModelVariable::getValue(), and mBFIGVariables.

Referenced by tut::BFIGGeneratorTester::testBFIG().

Here is the call graph for this function:

void tut::BFIGHelper::loadAssignments | ( | std::vector< Mers::Generators::BFIG::BFIGAssignment * > & | assignments,
|  | const unsigned int | assignmentsData[] |
| ) |  |  | `[protected]`

Loads the specified assignmentData into the assignment list for use with BFIG.

Parameters:

  | assignments | The set of assignments loaded will be placed here.
  | assignmentsData | The set of assignment data being used to load the assignments. This array is an array of indexes corresponding to values. The value assignmentsData[v] is the index of the value to assign to the variable v. Hence, this allows one to specify compactly the assignments expected. The variables are matched against the mBFIGVariables list in the order they appear in this list, hence the list must be of same length as mBFIGVariables. A value of ((unsigned int)-1) indicates that the variable has not value in this assignment. Thus any partial assignment is also possible. Typically this parameter is specified by something like: const unsigned int noVal = (unsigned int)-1; const unsigned int assignments[3] = {1, 0, noVal};

void tut::BFIGHelper::loadAssignments | ( | std::vector< Mers::Generators::BFIG::BFIGAssignment const * > & | assignments,
|  | const unsigned int | assignmentsData[] |
| ) |  |  | `[protected]`

Loads the specified assignmentData into the assignment list for use with BFIG.

Parameters:

  | assignments | The set of assignments loaded will be placed here.
  | assignmentsData | The set of assignment data being used to load the assignments. This array is an array of indexes corresponding to values. The value assignmentsData[v] is the index of the value to assign to the variable v. Hence, this allows one to specify compactly the assignments expected. The variables are matched against the mBFIGVariables list in the order they appear in this list, hence the list must be of same length as mBFIGVariables. A value of ((unsigned int)-1) indicates that the variable has not value in this assignment. Thus any partial assignment is also possible. Typically this parameter is specified by something like: const unsigned int noVal = (unsigned int)-1; const unsigned int assignments[3] = {1, 0, noVal};

void tut::BFIGHelper::loadConstraints | ( | std::vector< Mers::Generators::BFIG::BFIGConstraint * > & | constraints,
|  | const unsigned int | constraintValues[],
|  | const bool | constraintParity[] |
| ) |  |  | `[protected]`

Loads the specified constraint data into the constraints list for use with BFIG.

Parameters:

  | constraints | The set of assignments loaded will be placed here.
  | constraintValues | Part of the set of constraint data being used to load the constraints. This array is an array of indexes corresponding to values. The value assignmentsData[v] is the index of the value to assign to the variable v. Hence, this allows one to specify compactly the assignments expected. The variables are matched against the mBFIGVariables list in the order they appear in this list, hence the list must be of same length as mBFIGVariables. A value of ((unsigned int)-1) indicates that the variable has not value in this assignment. Thus any partial assignment is also possible. Typically this parameter is specified by something like: const unsigned int noVal = (unsigned int)-1; const unsigned int assignments[3] = {1, 0, noVal};
  | constriantParity | Part of the set of constriant data being used to load the constraints. Each of these entries correspond to a constraintValues entry. If constraintValues[v] is -1, then this value is ignored. Otherwise, if true, then the constraint (var = val) is inserted into the constraint. Otherwise, if false, then the constraint !(var = val) is inserted into the constraint.

void tut::BFIGHelper::loadConstraints | ( | std::vector< Mers::Generators::BFIG::BFIGConstraint const * > & | constraints,
|  | const unsigned int | constraintValues[],
|  | const bool | constraintParity[] |
| ) |  |  | `[protected]`

Loads the specified constraint data into the constraints list for use with BFIG.

Parameters:

  | constraints | The set of assignments loaded will be placed here.
  | constraintValues | Part of the set of constraint data being used to load the constraints. This array is an array of indexes corresponding to values. The value assignmentsData[v] is the index of the value to assign to the variable v. Hence, this allows one to specify compactly the assignments expected. The variables are matched against the mBFIGVariables list in the order they appear in this list, hence the list must be of same length as mBFIGVariables. A value of ((unsigned int)-1) indicates that the variable has not value in this assignment. Thus any partial assignment is also possible. Typically this parameter is specified by something like: const unsigned int noVal = (unsigned int)-1; const unsigned int assignments[3] = {1, 0, noVal};
  | constriantParity | Part of the set of constriant data being used to load the constraints. Each of these entries correspond to a constraintValues entry. If constraintValues[v] is -1, then this value is ignored. Otherwise, if true, then the constraint (var = val) is inserted into the constraint. Otherwise, if false, then the constraint !(var = val) is inserted into the constraint.

template<class T>

void tut::BFIGHelper::convertVector | ( | std::vector< const T * > & | constVect,
|  | const std::vector< T * > & | vect |
| ) |  |  | `[inline, protected]`

Converts a non-constant vector to a constant vector.

Parameters:

  | constVect | the constant vector into which the data is being placed.
  | vect | the non-constant vector from which the data is being taken.

Definition at line 276 of file BFIGHelper.h.

## Member Data Documentation

Mers::Utils::Containers::IntegerArray tut::BFIGHelper::mValueMap`[protected]`

The a map from variable UIDs to base indices for that variable in the probabilities.

Definition at line 294 of file BFIGHelper.h.

std::vector<Mers::Generators::BFIG::BFIGVariable *> tut::BFIGHelper::mBFIGVarList`[protected]`

The set of all BFIG variables. Note that these are only created by a call to initBFIGVars()

Definition at line 299 of file BFIGHelper.h.

Referenced by ~BFIGHelper().

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

- /Users/fpy/titan-1-5-MBARI/Mers/Generators/BFIG/unit-tests/BFIGHelper.h
- /Users/fpy/titan-1-5-MBARI/Mers/Generators/BFIG/unit-tests/BFIGHelper.cpp