Public Member Functions | |
BPNode (int predId, SuperPred *const &superPred, Array< int > *const &constants, Domain *const &domain) | |
~BPNode () | |
int | getPredId () |
int | getSuperPredId () |
int | getParentSuperPredId () |
SuperPred * | getSuperPred () |
Array< int > * | getConstants () |
int | getGroundNodeCount () |
int | getNumLinks () |
BPLink * | getLink (int index) |
void | getMessage (int index, double msgs[]) |
void | addLink (BPLink *link, double inpMsgs[2]) |
add the link (factor along with all the relevant information about counts etc. | |
void | addFactors (Array< BPFactor * > *const &allFactors, LinkIdToTwoWayMessageMap *const &lidToTWMsg) |
void | receiveMessage (double *inpMsgs, BPLink *const &link) |
double | getExp () |
double * | getProbs (double *const &probs) |
Gets the probabilities for this node - it is simply the product of messages coming at this node. | |
void | sendMessage () |
void | moveToNextStep () |
ostream & | print (ostream &out) |
Definition at line 86 of file bpnode.h.
void BPNode::addLink | ( | BPLink * | link, | |
double | inpMsgs[2] | |||
) | [inline] |
add the link (factor along with all the relevant information about counts etc.
).
Definition at line 161 of file bpnode.h.
References Array< Type >::append(), and BPLink::getCount().
Referenced by addFactors().
00162 { 00163 links_->append(link); 00164 double *msgs; 00165 msgs = new double[2]; 00166 00167 double cnt = link->getCount(); 00168 for (int i = 0; i < 2; i++) 00169 { 00170 if (inpMsgs) 00171 { 00172 msgs[i] = inpMsgs[i]; 00173 } 00174 else 00175 { 00176 msgs[i] = 0; 00177 } 00178 msgProds_[i] = msgProds_[i] + cnt*msgs[i]; 00179 } 00180 00181 msgsArr_->append(msgs); 00182 msgs = new double[2]; 00183 nextMsgsArr_->append(msgs); 00184 }