BPNode Class Reference

List of all members.

Public Member Functions

 BPNode (int predId, SuperPred *const &superPred, Array< int > *const &constants, Domain *const &domain)
 ~BPNode ()
int getPredId ()
int getSuperPredId ()
int getParentSuperPredId ()
SuperPredgetSuperPred ()
Array< int > * getConstants ()
int getGroundNodeCount ()
int getNumLinks ()
BPLinkgetLink (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)

Detailed Description

Definition at line 86 of file bpnode.h.


Member Function Documentation

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   }


The documentation for this class was generated from the following files:
Generated on Sun Jun 7 11:55:22 2009 for Alchemy by  doxygen 1.5.1