2012-03-22 11:33:24 +00:00
|
|
|
#ifndef HORUS_HORUS_H
|
|
|
|
#define HORUS_HORUS_H
|
|
|
|
|
|
|
|
#include <limits>
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
|
|
|
|
TypeName(const TypeName&); \
|
|
|
|
void operator=(const TypeName&)
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
2012-04-05 23:00:48 +01:00
|
|
|
class Var;
|
2012-03-22 11:33:24 +00:00
|
|
|
class Factor;
|
2012-04-05 23:00:48 +01:00
|
|
|
class VarNode;
|
2012-04-10 11:51:56 +01:00
|
|
|
class FacNode;
|
2012-03-22 11:33:24 +00:00
|
|
|
|
2012-05-04 14:28:07 +01:00
|
|
|
typedef vector<double> Params;
|
|
|
|
typedef unsigned VarId;
|
|
|
|
typedef vector<VarId> VarIds;
|
|
|
|
typedef vector<Var*> Vars;
|
|
|
|
typedef vector<VarNode*> VarNodes;
|
|
|
|
typedef vector<FacNode*> FacNodes;
|
|
|
|
typedef vector<Factor*> Factors;
|
|
|
|
typedef vector<string> States;
|
|
|
|
typedef vector<unsigned> Ranges;
|
|
|
|
typedef Params::size_type psize_t;
|
|
|
|
typedef unsigned long long ullong;
|
2012-03-22 11:33:24 +00:00
|
|
|
|
|
|
|
|
2012-03-31 23:27:37 +01:00
|
|
|
enum InfAlgorithms
|
|
|
|
{
|
2012-04-05 23:00:48 +01:00
|
|
|
VE, // variable elimination
|
|
|
|
BP, // belief propagation
|
|
|
|
CBP // counting belief propagation
|
2012-03-22 11:33:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2012-03-31 23:27:37 +01:00
|
|
|
namespace Globals {
|
2012-03-22 11:33:24 +00:00
|
|
|
|
2012-03-31 23:27:37 +01:00
|
|
|
extern bool logDomain;
|
2012-03-22 11:33:24 +00:00
|
|
|
|
2012-04-30 14:50:14 +01:00
|
|
|
// level of debug information
|
2012-04-29 20:07:09 +01:00
|
|
|
extern unsigned verbosity;
|
|
|
|
|
2012-03-31 23:27:37 +01:00
|
|
|
extern InfAlgorithms infAlgorithm;
|
2012-03-22 11:33:24 +00:00
|
|
|
|
2012-03-31 23:27:37 +01:00
|
|
|
};
|
2012-03-22 11:33:24 +00:00
|
|
|
|
|
|
|
|
2012-03-31 23:27:37 +01:00
|
|
|
namespace Constants {
|
2012-03-22 11:33:24 +00:00
|
|
|
|
2012-04-30 14:50:14 +01:00
|
|
|
// show message calculation for belief propagation
|
2012-04-29 20:07:09 +01:00
|
|
|
const bool SHOW_BP_CALCS = false;
|
2012-03-22 11:33:24 +00:00
|
|
|
|
2012-03-31 23:27:37 +01:00
|
|
|
const int NO_EVIDENCE = -1;
|
|
|
|
|
|
|
|
// number of digits to show when printing a parameter
|
2012-04-29 20:07:09 +01:00
|
|
|
const unsigned PRECISION = 6;
|
2012-03-31 23:27:37 +01:00
|
|
|
|
|
|
|
const bool COLLECT_STATS = false;
|
2012-03-22 11:33:24 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
namespace BpOptions
|
|
|
|
{
|
|
|
|
enum Schedule {
|
|
|
|
SEQ_FIXED,
|
|
|
|
SEQ_RANDOM,
|
|
|
|
PARALLEL,
|
|
|
|
MAX_RESIDUAL
|
|
|
|
};
|
|
|
|
extern Schedule schedule;
|
|
|
|
extern double accuracy;
|
|
|
|
extern unsigned maxIter;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // HORUS_HORUS_H
|
|
|
|
|