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/Factor.h
2011-05-17 12:00:33 +01:00

46 lines
1.3 KiB
C++
Executable File

#ifndef BP_FACTOR_H
#define BP_FACTOR_H
#include <vector>
#include "CptEntry.h"
using namespace std;
class FgVarNode;
class Factor
{
public:
Factor (FgVarNode*);
Factor (const FgVarSet&);
Factor (FgVarNode*, const ParamSet&);
Factor (const FgVarSet&, const ParamSet&);
const FgVarSet& getFgVarNodes (void) const;
FgVarSet& getFgVarNodes (void);
const ParamSet& getParameters (void) const;
ParamSet& getParameters (void);
void setParameters (const ParamSet&);
Factor& operator= (const Factor& f);
Factor& operator*= (const Factor& f);
void insertVariable (FgVarNode* index);
void marginalizeVariable (const FgVarNode* var);
void marginalizeVariable (unsigned);
string getLabel (void) const;
string toString (void) const;
private:
vector<CptEntry> getCptEntries() const;
int getIndexOf (const FgVarNode*) const;
FgVarSet vs_;
ParamSet ps_;
int id_;
static int indexCount_;
};
Factor operator* (const Factor&, const Factor&);
#endif