2012-03-31 23:27:37 +01:00
|
|
|
/*******************************************************
|
|
|
|
|
2012-05-23 19:15:23 +01:00
|
|
|
Horus Interface
|
2012-12-20 23:19:10 +00:00
|
|
|
|
2012-03-31 23:27:37 +01:00
|
|
|
********************************************************/
|
|
|
|
|
2012-03-22 19:10:15 +00:00
|
|
|
:- module(clpbn_horus,
|
2013-01-07 14:04:44 +00:00
|
|
|
[set_horus_flag/2,
|
2012-12-17 12:13:08 +00:00
|
|
|
cpp_create_lifted_network/3,
|
|
|
|
cpp_create_ground_network/4,
|
2012-12-18 22:47:43 +00:00
|
|
|
cpp_set_parfactors_params/3,
|
|
|
|
cpp_set_factors_params/3,
|
2012-12-17 12:13:08 +00:00
|
|
|
cpp_run_lifted_solver/3,
|
|
|
|
cpp_run_ground_solver/3,
|
|
|
|
cpp_set_vars_information/2,
|
|
|
|
cpp_set_horus_flag/2,
|
|
|
|
cpp_free_lifted_network/1,
|
|
|
|
cpp_free_ground_network/1
|
|
|
|
]).
|
2012-03-31 23:27:37 +01:00
|
|
|
|
2012-12-18 22:47:43 +00:00
|
|
|
|
|
|
|
:- catch(load_foreign_files([horus], [], init_predicates), _, patch_things_up)
|
|
|
|
-> true ; warning.
|
2012-03-22 19:10:15 +00:00
|
|
|
|
2012-04-11 19:15:52 +01:00
|
|
|
|
2012-04-03 15:01:35 +01:00
|
|
|
patch_things_up :-
|
2012-12-17 12:13:08 +00:00
|
|
|
assert_static(clpbn_horus:cpp_set_horus_flag(_,_)).
|
2012-04-03 15:01:35 +01:00
|
|
|
|
|
|
|
|
|
|
|
warning :-
|
2012-12-18 22:47:43 +00:00
|
|
|
format(user_error,"Horus library not installed: cannot use hve, bp, cbp, lve, lkc and lbp~n.",[]).
|
2012-04-03 15:01:35 +01:00
|
|
|
|
|
|
|
|
2012-05-23 20:34:57 +01:00
|
|
|
set_horus_flag(K,V) :- cpp_set_horus_flag(K,V).
|
2012-03-31 23:27:37 +01:00
|
|
|
|
|
|
|
|
2012-12-27 23:21:32 +00:00
|
|
|
:- cpp_set_horus_flag(verbosity, 0).
|
2012-03-31 23:27:37 +01:00
|
|
|
|
2013-01-04 19:48:31 +00:00
|
|
|
%:- cpp_set_horus_flag(use_logarithms, false).
|
|
|
|
:- cpp_set_horus_flag(use_logarithms, true).
|
2012-03-31 23:27:37 +01:00
|
|
|
|
2012-12-27 23:21:32 +00:00
|
|
|
%:- cpp_set_horus_flag(hve_elim_heuristic, sequential).
|
|
|
|
%:- cpp_set_horus_flag(hve_elim_heuristic, min_neighbors).
|
|
|
|
%:- cpp_set_horus_flag(hve_elim_heuristic, min_weight).
|
|
|
|
%:- cpp_set_horus_flag(hve_elim_heuristic, min_fill).
|
|
|
|
:- cpp_set_horus_flag(hve_elim_heuristic, weighted_min_fill).
|
2012-03-31 23:27:37 +01:00
|
|
|
|
2012-12-27 23:21:32 +00:00
|
|
|
:- cpp_set_horus_flag(bp_msg_schedule, seq_fixed).
|
|
|
|
%:- cpp_set_horus_flag(bp_msg_schedule, seq_random).
|
|
|
|
%:- cpp_set_horus_flag(bp_msg_schedule, parallel).
|
|
|
|
%:- cpp_set_horus_flag(bp_msg_schedule, max_residual).
|
|
|
|
|
|
|
|
:- cpp_set_horus_flag(bp_accuracy, 0.0001).
|
|
|
|
|
|
|
|
:- cpp_set_horus_flag(bp_max_iter, 1000).
|
2012-03-31 23:27:37 +01:00
|
|
|
|