GOBNILP
f164d83
|
Implements the functions needed to perform model averaging over the n best Bayesian networks. More...
Functions | |
static int | indexOf (MA_info *ma_info, SCIP_VAR *var) |
Find the index of ma_info->vars and ma_info->average_scores relating to a variable. More... | |
SCIP_RETCODE | MA_addAveragingParameters (SCIP *scip, MA_info *ma_info) |
Adds parameters for controlling the model averaging. More... | |
SCIP_RETCODE | MA_createAverageDataStructure (SCIP *scip, MA_info *ma_info) |
Allocates memory for the data structures used for model averaging. More... | |
SCIP_RETCODE | MA_destroyAverageDataStructure (SCIP *scip, MA_info *ma_info) |
Frees memory used for the data structures used for model averaging. More... | |
SCIP_Real | MA_getAverageValue (MA_info *ma_info, SCIP_VAR *variable) |
Returns the model average value of a given variable. More... | |
SCIP_Real | MA_getTotalAveragesScore (MA_info *ma_info) |
Returns the total likelihood of all the solutions included in the model average. More... | |
SCIP_Real | MA_getTotalAveragesTime (MA_info *ma_info) |
Returns the total time spent solving for all the solutions included in the model average. More... | |
SCIP_RETCODE | MA_updateAverageDataStructure (SCIP *scip, MA_info *ma_info, SCIP_SOL *sol) |
Updates the average scores based on a newly found solution. More... | |
Implements the functions needed to perform model averaging over the n best Bayesian networks.
|
static |
Find the index of ma_info->vars and ma_info->average_scores relating to a variable.
var | The variable of interest. |
ma_info | Model averaging information. |
References MA_info::num_vars, and MA_info::vars.
Referenced by MA_getAverageValue().
SCIP_RETCODE MA_addAveragingParameters | ( | SCIP * | scip, |
MA_info * | ma_info | ||
) |
Adds parameters for controlling the model averaging.
scip | The SCIP instance to which the parameter is to be added. |
ma_info | Model averaging information. |
References MA_info::is_log_score.
Referenced by main().
SCIP_RETCODE MA_createAverageDataStructure | ( | SCIP * | scip, |
MA_info * | ma_info | ||
) |
Allocates memory for the data structures used for model averaging.
scip | The SCIP instance on which the model averaging will be performed. |
ma_info | Model averaging information. |
References MA_info::average_scores, MA_info::first_score, MA_info::is_first_score, MA_info::normalising_constant, MA_info::num_vars, MA_info::total_score, MA_info::total_time, and MA_info::vars.
Referenced by main().
SCIP_RETCODE MA_destroyAverageDataStructure | ( | SCIP * | scip, |
MA_info * | ma_info | ||
) |
Frees memory used for the data structures used for model averaging.
scip | The SCIP instance on which the model averaging was performed. |
ma_info | Model averaging information. |
References MA_info::average_scores, and MA_info::vars.
Referenced by main().
SCIP_Real MA_getAverageValue | ( | MA_info * | ma_info, |
SCIP_VAR * | variable | ||
) |
Returns the model average value of a given variable.
If the variable is not part of this model averaging, the value -1 will be returned.
ma_info | Model averaging information. |
variable | The variable to get the model averaging score for. |
References MA_info::average_scores, indexOf(), MA_info::is_log_score, MA_info::normalising_constant, and MA_info::total_score.
Referenced by printAverages().
SCIP_Real MA_getTotalAveragesScore | ( | MA_info * | ma_info | ) |
Returns the total likelihood of all the solutions included in the model average.
ma_info | Model averaging information. |
References MA_info::total_score.
Referenced by printAverages().
SCIP_Real MA_getTotalAveragesTime | ( | MA_info * | ma_info | ) |
Returns the total time spent solving for all the solutions included in the model average.
ma_info | Model averaging information. |
References MA_info::total_time.
Referenced by printAverages().
SCIP_RETCODE MA_updateAverageDataStructure | ( | SCIP * | scip, |
MA_info * | ma_info, | ||
SCIP_SOL * | sol | ||
) |
Updates the average scores based on a newly found solution.
scip | The SCIP instance to which the solution belongs. |
ma_info | Model averaging information. |
sol | The new solution to incorporate in to the averages. |
References MA_info::average_scores, MA_info::first_score, MA_info::is_first_score, MA_info::is_log_score, MA_info::normalising_constant, MA_info::num_vars, MA_info::total_score, MA_info::total_time, and MA_info::vars.
Referenced by main().