Move BpLink to inside of BeliefProp

This commit is contained in:
Tiago Gomes
2013-02-20 23:59:03 +00:00
parent 6b0e125e3b
commit f0572e3cfb
4 changed files with 146 additions and 129 deletions

View File

@@ -8,6 +8,16 @@
namespace Horus {
WeightedBp::WeightedBp (
const FactorGraph& fg,
const std::vector<std::vector<unsigned>>& weights)
: BeliefProp (fg), weights_(weights)
{
}
WeightedBp::~WeightedBp (void)
{
for (size_t i = 0; i < links_.size(); i++) {
@@ -53,6 +63,19 @@ WeightedBp::getPosterioriOf (VarId vid)
WeightedBp::WeightedLink::WeightedLink (
FacNode* fn,
VarNode* vn,
size_t idx,
unsigned weight)
: BpLink (fn, vn), index_(idx), weight_(weight),
pwdMsg_(vn->range(), LogAware::one())
{
}
void
WeightedBp::createLinks (void)
{