16#include "util/ytData.h"
17#include "util/ytKeyValues.h"
18#include "net/ytNetwork.h"
19#include "net/ytNode.h"
20#include "net/ytEdge.h"
24#define BNRC_DEFAULT_MAX_MEM 1000
26#define BNRC_DEF {"BNRC",\
34 BNRC_partialResidual,\
42#define BNRC_DEF {"BNRC",\
50 BNRC_partialResidual,\
51 BNRC_calcEdgeContrib,\
86 double log_det_K_plus;
96 double ** logDetLambda;
101 double ** LambdaInvBt;
111 double ** tmp_LambdaInvBt;
112 double ** tmp_logDetLambda;
117 double * dsytrf_work;
118 int dsytrf_work_size;
124 double * tmp_B_gamma;
127 double * LambdaInvBtWork;
128 double * logDetLambdaWork;
146void BNRC_reinit(
void * buff,
ytData * data);
147double BNRC_score(
void * buff,
const int j,
const int * parents,
const int q);
148void BNRC_edgeProp(
void * buff,
const int j,
const int * parents,
const int q,
149 const int k,
ytEdge * edge);
150void BNRC_nodeProp(
void * buff,
int j,
ytNode * node);
151void BNRC_finalize(
void * buff);
152void BNRC_partialResidual(
void * buff,
const int j,
const int * parents,
const int q,
153 FILE ** fp,
double * ll);
154void BNRC_setEdgeProp(
void * buff,
const int j,
const int * parents,
const int q,
155 const int k,
const ytEdge * edge);
156void BNRC_setNodeProp(
void * buff,
const int j,
const ytNode * node);
157void BNRC_calcRelContrib(
void * buff,
int j,
158 const int * parents,
int q,
double * ar);
160void BNRC_calcEdgeContrib(
void * buff,
ytNetwork * network,
int j,
161 const int * parents,
int q,
162 int mode,
double * ar);
164void BNRC_status(
void * buff);
165int BNRC_debug(
int argc,
char * argv[]);
168void BNRC_prepare_beta(
double hyper_bg,
double hyper_inc,
int hyper_num,
169 double * beta,
double * log_beta,
int verbose);
171size_t BNRC_Data_alloc(
BNRC_Data * D,
int p,
int n,
172 int allocXY,
int dynamic,
int level,
int dry);
173void BNRC_Data_finalize(
BNRC_Data * D,
int allocXY);
175size_t BNRC_Global_alloc(
BNRC_Global * G,
int p,
int n,
int mp,
int level,
179size_t BNRC_Work_alloc(
BNRC_Work * W,
int p,
int n,
int mp,
int H,
180 int M,
int level,
int T1_size,
int dry);
183size_t BNRC_Model_alloc(
BNRC_Model * P,
int mp,
int M,
int dry);
188 const char * type,
double outer);
189void BNRC_proc_mv(
BNRC_Data * D,
int level);
190void BNRC_calc_B(
BNRC_Data * D,
int ofs,
const char * type,
193 const char * type,
BNRC_Work * W,
int level);
195double BNRC_calc(
BNRC_Data * D,
int ofs,
int j,
const int * parents,
int q,
198size_t BNRC_get_T1_size(
int n,
int M);
200void BNRC_setParam(
void * buff,
const char * key,
ytObject * value);
Model parameters for a single node.
Definition BNRC.h:136
Structure for working memory.
Definition BNRC.h:110
General data container.
Definition ytData.h:46
Network node.
Definition ytNode.h:15