40#include "util/ytData.h"
41#include "util/ytKeyValues.h"
42#include "net/ytNetwork.h"
43#include "net/ytNode.h"
44#include "net/ytEdge.h"
48#define BNRC_DEFAULT_MAX_MEM 1000
49#define BNRC_DEF {"BNRC",\
57 BNRC_partialResidual,\
91 double log_det_K_plus;
101 double ** logDetLambda;
106 double ** LambdaInvBt;
116 double ** tmp_LambdaInvBt;
117 double ** tmp_logDetLambda;
121 double * dsytrf_work;
122 int dsytrf_work_size;
128 double * tmp_B_gamma;
131 double * LambdaInvBtWork;
132 double * logDetLambdaWork;
151double BNRC_score(
void * buff,
const int j,
const int * parents,
const int q);
152void BNRC_edgeProp(
void * buff,
const int j,
const int * parents,
const int q,
153 const int k,
ytEdge * edge);
154void BNRC_nodeProp(
void * buff,
int j,
ytNode * node);
155void BNRC_finalize(
void * buff);
156void BNRC_partialResidual(
void * buff,
const int j,
const int * parents,
const int q,
157 FILE ** fp,
double * ll);
158void BNRC_setEdgeProp(
void * buff,
const int j,
const int * parents,
const int q,
159 const int k,
const ytEdge * edge);
160void BNRC_setNodeProp(
void * buff,
const int j,
const ytNode * node);
161void BNRC_status(
void * buff);
162int BNRC_debug(
int argc,
char * argv[]);
166 double * beta,
double * log_beta,
int verbose);
168size_t BNRC_Data_alloc(
BNRC_Data * D,
int p,
int n,
169 int allocXY,
int dynamic,
int level,
int dry);
172size_t BNRC_Global_alloc(
BNRC_Global * G,
int p,
int n,
int mp,
int level,
177 int M,
int level,
int T1_size,
int dry);
180size_t BNRC_Model_alloc(
BNRC_Model * P,
int mp,
int M,
int dry);
185 const char * type,
double outer);
186void BNRC_proc_mv(
BNRC_Data * D,
int level);
190 const char * type,
BNRC_Work * W,
int level);
195size_t BNRC_get_T1_size(
int n,
int M);
197void BNRC_setParam(
void * buff,
const char * key,
ytObject * value);
size_t BNRC_Work_alloc(BNRC_Work *W, int p, int n, int mp, int H, int M, int level, int T1_size, int dry)
Allocates memory for BNRC_Work.
Definition: BNRC.c:580
void BNRC_range(BNRC_Data *D, const ytDoubleArray *xlar, const ytDoubleArray *xrar, const char *type, double outer)
Sets the value range xl and xr.
Definition: BNRC.c:1602
void BNRC_calc_B(BNRC_Data *D, int ofs, const char *type, int n, int M, BNRC_Work *W)
Calculates B-spline design matrices for all the variables.
Definition: BNRC.c:915
void * BNRC_init(ytData *data, ytKeyValues *args)
Initializes the BNRC score.
Definition: BNRC.c:194
void BNRC_prepare_beta(double hyper_bg, double hyper_inc, int hyper_num, double *beta, double *log_beta, int verbose)
Prepares the hyperparamters.
Definition: BNRC.c:817
double BNRC_calc(BNRC_Data *D, int ofs, int j, const int *parents, int q, int n, int nn, int level, BNRC_Work *W, BNRC_Model *P, BNRC_Global *G)
Calculates BNRC score.
Definition: BNRC.c:1115
double BNRC_score(void *buff, const int j, const int *parents, const int q)
BNRC score function.
Definition: BNRC.c:354
void BNRC_calc_Lambda(BNRC_Data *D, BNRC_Global *G, int p, int n, const char *type, BNRC_Work *W, int level)
Calculates Λ related values for all the variables.
Definition: BNRC.c:1012
void BNRC_setEdgeProp(void *buff, const int j, const int *parents, const int q, const int k, const ytEdge *edge)
Sets parameters from ytEdge.
Definition: BNRC.c:1465
void BNRC_Data_finalize(BNRC_Data *D, int allocXY)
Releases memory allocated by BNRC_Data_alloc().
Definition: BNRC.c:453
void BNRC_reinit(void *buff, ytData *data)
Re-initializes the score function.
Definition: BNRC.c:308
Model parameters for a single node.
Definition: BNRC.h:140
Structure for working memory.
Definition: BNRC.h:115
General data container.
Definition: ytData.h:73
Network node.
Definition: ytNode.h:42