AIToolbox
A library that offers tools for AI problem solving.
Core.hpp File Reference

Go to the source code of this file.

Classes

class  AIToolbox::Factored::PartialFactorsEnumerator
 This class enumerates all possible values for a PartialFactors. More...
 
class  AIToolbox::Factored::PartialIndexEnumerator
 This class enumerates the indeces of all combinations where a value is fixed. More...
 

Namespaces

 AIToolbox
 
 AIToolbox::Factored
 

Enumerations

enum  AIToolbox::Factored::TagErrors {
  AIToolbox::Factored::TagErrors::None, AIToolbox::Factored::TagErrors::NoElements, AIToolbox::Factored::TagErrors::TooManyElements, AIToolbox::Factored::TagErrors::IdTooHigh,
  AIToolbox::Factored::TagErrors::NotSorted, AIToolbox::Factored::TagErrors::Duplicates
}
 This enum contains all possible errors in a tag. More...
 

Functions

std::pair< TagErrors, size_t > AIToolbox::Factored::checkTag (const Factors &space, const PartialKeys &tag)
 This function verifies whether a tag is correct w.r.t. a space. More...
 
PartialFactors AIToolbox::Factored::removeFactor (const PartialFactors &pf, size_t f)
 This function removes the specified factor from the input PartialFactors. More...
 
template<typename Gen >
Factors AIToolbox::Factored::makeRandomValue (const Factors &space, Gen &rnd)
 This function randomly generates a valid value inside the provided space. More...
 
bool AIToolbox::Factored::match (const PartialFactors &lhs, const PartialFactors &rhs)
 This function returns whether the common factors in the inputs match in value. More...
 
bool AIToolbox::Factored::match (const Factors &lhs, const PartialFactors &rhs)
 This function returns whether the common factors in the inputs match in value. More...
 
bool AIToolbox::Factored::match (const PartialKeys &lhsK, const PartialValues &lhs, const PartialKeys &rhsK, const PartialValues &rhs)
 This function returns whether the common factors in the inputs match in value. More...
 
bool AIToolbox::Factored::match (const PartialKeys &keys, const Factors &lhs, const Factors &rhs)
 This function checks whether the two input Factors match at the specified ids. More...
 
bool AIToolbox::Factored::match (const std::vector< std::pair< size_t, size_t >> &matches, const Factors &lhs, const Factors &rhs)
 This function checks whether the two input Factors match at the specified ids. More...
 
void AIToolbox::Factored::join (size_t S, PartialFactors *lhs, const PartialFactors &rhs)
 This function appends the rhs to the lhs, assuming the original Factor for lhs has S elements. More...
 
Factors AIToolbox::Factored::join (const Factors &lhs, const Factors &rhs)
 This function creates a new Factor appending rhs to lhs. More...
 
PartialKeys AIToolbox::Factored::join (size_t S, const PartialKeys &lhs, const PartialKeys &rhs)
 This function appends rhs to lhs, assuming the full Factor for lhs has S elements. More...
 
PartialFactors AIToolbox::Factored::join (size_t S, const PartialFactors &lhs, const PartialFactors &rhs)
 This function appends rhs to lhs, assuming the full Factor for lhs has S elements. More...
 
void AIToolbox::Factored::unsafe_join (PartialFactors *lhs, const PartialFactors &rhs)
 This function appends the rhs to the lhs. More...
 
PartialFactors AIToolbox::Factored::merge (const PartialFactors &lhs, const PartialFactors &rhs)
 This function merges two PartialFactors together. More...
 
PartialValues AIToolbox::Factored::merge (const PartialKeys &lhsk, const PartialValues &lhs, const PartialKeys &rhsk, const PartialValues &rhs)
 This function merges two PartialValues together, using two PartialKeys as guides. More...
 
PartialKeys AIToolbox::Factored::merge (const PartialKeys &lhs, const PartialKeys &rhs, std::vector< std::pair< size_t, size_t >> *matches=nullptr)
 This function merges two PartialKeys together. More...
 
size_t AIToolbox::Factored::factorSpace (const Factors &space)
 This function returns the multiplication of all elements of the input factor. More...
 
size_t AIToolbox::Factored::factorSpacePartial (const PartialKeys &ids, const Factors &space)
 This function returns the multiplication of all elements of the input factor. More...
 
PartialFactors AIToolbox::Factored::toPartialFactors (const Factors &f)
 This function converts Factors into the equivalent PartialFactors structure. More...
 
Factors AIToolbox::Factored::toFactors (size_t F, const PartialFactors &pf)
 This function converts PartialFactors into the equivalent Factors structure. More...
 
Factors AIToolbox::Factored::toFactors (const Factors &space, size_t id)
 This function converts an index into the equivalent Factors, within the specified factor space. More...
 
void AIToolbox::Factored::toFactors (const Factors &space, size_t id, Factors *out)
 This function converts an index into the equivalent Factors, within the specified factor space. More...
 
PartialValues AIToolbox::Factored::toFactorsPartial (const PartialKeys &ids, const Factors &space, size_t id)
 This function converts an index into the equivalent PartialValues of the input keys, within the specified factor space. More...
 
template<typename It >
void AIToolbox::Factored::toFactorsPartial (It begin, const PartialKeys &ids, const Factors &space, size_t id)
 This function converts an index into the equivalent PartialValues of the input keys, within the specified factor space. More...
 
size_t AIToolbox::Factored::toIndex (const Factors &space, const Factors &f)
 This function converts the input factor in the input space to an unique index. More...
 
size_t AIToolbox::Factored::toIndex (const Factors &space, const PartialFactors &f)
 This function converts the input factor in the input space to an unique index. More...
 
size_t AIToolbox::Factored::toIndexPartial (const PartialKeys &ids, const Factors &space, const Factors &f)
 This function converts the input factor in the input space to an unique index. More...
 
size_t AIToolbox::Factored::toIndexPartial (const PartialKeys &ids, const Factors &space, const PartialFactors &pf)
 This function converts the input factor in the input space to an unique index. More...
 
size_t AIToolbox::Factored::toIndexPartial (const Factors &space, const PartialFactors &f)
 This function converts the input factor in the input space to an unique index. More...
 
std::pair< size_t, size_t > AIToolbox::Factored::toIndexPartialAndSkip (const PartialKeys &ids, const Factors &space, const Factors &f, size_t id)
 This function avoids computing indeces multiple times if only a single index is changing. More...