added getFunctionProb in the Java and C API

This commit is contained in:
krasimir
2016-05-30 11:25:59 +00:00
parent a00532d5e4
commit 3381ae1aa0
4 changed files with 32 additions and 0 deletions

View File

@@ -165,6 +165,17 @@ pgf_function_type(PgfPGF* pgf, PgfCId funname)
return absfun->type;
}
double
pgf_function_prob(PgfPGF* pgf, PgfCId funname)
{
PgfAbsFun* absfun =
gu_seq_binsearch(pgf->abstract.funs, pgf_absfun_order, PgfAbsFun, funname);
if (absfun == NULL)
return INFINITY;
return absfun->ep.prob;
}
GuString
pgf_print_name(PgfConcr* concr, PgfCId id)
{

View File

@@ -66,6 +66,9 @@ pgf_iter_functions_by_cat(PgfPGF* pgf, PgfCId catname,
PgfType*
pgf_function_type(PgfPGF* pgf, PgfCId funname);
double
pgf_function_prob(PgfPGF* pgf, PgfCId funname);
GuString
pgf_print_name(PgfConcr*, PgfCId id);