Processing math: 20%
mrf  v0.2.0
All Data Structures Files Functions Pages
mrf.h File Reference

Data Structures

struct  Factor1D
 A one-dimensional un-normalized mass function. More...
 
struct  Factor2D
 A two-dimensional un-normalized mass function. More...
 
struct  Message
 A nessage from node i to node j. More...
 
struct  Node
 A variable node. More...
 

Functions

void bp (struct Node **nodes, int num_nodes, int num_iterations)
 Loopy belief propagation. More...
 
void compute_message (struct Node *from, struct Node *to, struct Message *out_msg)
 Computes the message from node i to node j. More...
 
void compute_univariate_marginal (struct Node *node, struct Factor1D *out)
 Computes the univariate marginal probability distribution over the node's values. More...
 
void connect_factor1d (struct Node *n, struct Factor1D *fac)
 Connects a node with its prior. More...
 
void connect_nodes (struct Node *n1, struct Node *n2, struct Factor2D *fac)
 Connect two nodes with their joining bivariate factor. More...
 
void delete_factor1d (struct Factor1D *fac)
 Delete the Factor1D. More...
 
void delete_factor2d (struct Factor2D *fac)
 Delete the Factor2D. More...
 
void delete_message (struct Message *msg)
 Delete the message. More...
 
void delete_node (struct Node *node)
 Delete the node. More...
 
double factor1d_at (struct Factor1D *fac, int ix)
 Access the value in the factor at the specified index. More...
 
void factor1d_ix (struct Factor1D *fac, int ix, double value)
 Set the value in the factor at the specified index. More...
 
double factor2d_at (struct Factor2D *fac, int row, int col)
 Access the value in the factor at the specified row and column. More...
 
void factor2d_ix (struct Factor2D *fac, int row, int col, double value)
 Set the value in the factor at the specified row and column. More...
 
double message_at (struct Message *msg, int ix)
 Access the value in the message at the specified index. More...
 
void message_ix (struct Message *msg, int ix, double value)
 Set the value in the message at the specified index. More...
 
void message_product (struct Node *from, struct Node *to, struct Message *out_msg)
 Computes the product of messages incoming to a node. More...
 
struct Factor1Dnew_factor1d (int dim)
 Craete a new uninitialized Factor1D. More...
 
struct Factor1Dnew_factor1d_uniform_prior (int dim)
 Create a Factor1D with entries f_i(x_i) = 1/dim. More...
 
struct Factor2Dnew_factor2d (int rows, int cols)
 Create a new uninitialized Factor2D. More...
 
struct Factor2Dnew_factor2d_uniform_prior (int rows, int cols)
 Create a Factor2D with entries f_{ij}(x_i, x_j) = (rows * cols)^{-1}. More...
 
struct Messagenew_message (int dim, int from, int to)
 Create a new message and assign it the specified origin and destination. More...
 
struct Messagenew_message_unassigned (int dim)
 Create a new message that is not assigned to any node. More...
 
struct Messagenew_message_unit (int dim, int from, int to)
 Create a new message with values \mu_{ij}(x_i) = 1. More...
 
struct Nodenew_node (int id, int degree, int dim)
 Create a new node. More...
 
void reset_messages (struct Node *n)
 Resets all messages in the node's inbox to one. More...
 
void send_messages (struct Node *from)
 Sends messages from the node to all of its neighbors. More...
 
void set_evidence (struct Node *n, int value)
 Condition the variable to be equal to the value. More...
 

Detailed Description

Author
David Dewhurst (david.nosp@m.@drd.nosp@m.ewhur.nosp@m.st.c.nosp@m.om)
Version
0.1
Date
2024-01-13