This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
yap-6.3/packages/CLPBN/clpbn/bp/Horus.h

77 lines
1.2 KiB
C
Raw Normal View History

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
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;
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-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-03-31 23:27:37 +01:00
// level of debug information
const unsigned DEBUG = 0;
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
const unsigned PRECISION = 5;
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