fix factor joint
This commit is contained in:
parent
86b57e961e
commit
febb17d753
@ -118,20 +118,19 @@ BeliefProp::getJointDistributionOf (const VarIds& jointVarIds)
|
||||
if (idx == facNodes.size()) {
|
||||
return getJointByConditioning (jointVarIds);
|
||||
}
|
||||
return getFactorJoint (idx, jointVarIds);
|
||||
return getFactorJoint (facNodes[idx], jointVarIds);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Params
|
||||
BeliefProp::getFactorJoint (
|
||||
size_t fnIdx,
|
||||
FacNode* fn,
|
||||
const VarIds& jointVarIds)
|
||||
{
|
||||
if (runned_ == false) {
|
||||
runSolver();
|
||||
}
|
||||
FacNode* fn = fg.facNodes()[fnIdx];
|
||||
Factor res (fn->factor());
|
||||
const BpLinks& links = ninf(fn)->getLinks();
|
||||
for (size_t i = 0; i < links.size(); i++) {
|
||||
|
@ -112,7 +112,7 @@ class BeliefProp : public Solver
|
||||
virtual Params getJointByConditioning (const VarIds&) const;
|
||||
|
||||
public:
|
||||
Params getFactorJoint (size_t fnIdx, const VarIds&);
|
||||
Params getFactorJoint (FacNode* fn, const VarIds&);
|
||||
|
||||
protected:
|
||||
SPNodeInfo* ninf (const VarNode* var) const
|
||||
|
@ -49,7 +49,7 @@ LiftedBp::solveQuery (const Grounds& query)
|
||||
for (unsigned i = 0; i < groups.size(); i++) {
|
||||
queryVids.push_back (groups[i]);
|
||||
}
|
||||
res = solver_->getFactorJoint (idx, queryVids);
|
||||
res = solver_->getFactorJoint (fg_->facNodes()[idx], queryVids);
|
||||
}
|
||||
}
|
||||
return res;
|
||||
|
Reference in New Issue
Block a user