summaryrefslogtreecommitdiff
path: root/src/runtime/c/pgf/pgf.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/c/pgf/pgf.c')
-rw-r--r--src/runtime/c/pgf/pgf.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/runtime/c/pgf/pgf.c b/src/runtime/c/pgf/pgf.c
index 0070e5f48..370b9411b 100644
--- a/src/runtime/c/pgf/pgf.c
+++ b/src/runtime/c/pgf/pgf.c
@@ -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)
{