You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
d5ee87b7ed
Example Markov : simulation of a Markov chain. Use of a Random module, external call to C rand() function. |
9 years ago | |
---|---|---|
.. | ||
README | 9 years ago | |
markov.ept | 9 years ago | |
mathext.c | 9 years ago | |
mathext.epi | 9 years ago | |
mathext.h | 9 years ago | |
random.c | 9 years ago | |
random.epi | 9 years ago | |
random.h | 9 years ago |
README
Simple Markov chain simulation by external call to random() C function : - random.epi : Heptagon interface containing the declaration of random() function - random.h, random.c : "glue" between actual random() C function and function calls generated by Heptagon - markov.ept : contains node "process", simulating a two-state Markov chain, with probability p (constant) at each step to go from one state to the other Function "random" and node "process" are declared unsafe to avoid optimization removing calls to "random" ("random" has side effects). Compilation and simulation : heptc random.epi heptc -target c -s process -hepts markov.ept gcc -I . -I markov_c -I /usr/local/lib/heptagon/c random.c markov_c/_main.c markov_c/markov.c markov_c/markov_types.c -o markov hepts -mod Markov -node process -exec ./markov