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.
Gwenaël Delaval d5ee87b7ed Added example Markov
Example Markov : simulation of a Markov chain.

Use of a Random module, external call to C rand() function.
9 years ago
..
README Added example Markov 9 years ago
markov.ept Added example Markov 9 years ago
mathext.c Added example Markov 9 years ago
mathext.epi Added example Markov 9 years ago
mathext.h Added example Markov 9 years ago
random.c Added example Markov 9 years ago
random.epi Added example Markov 9 years ago
random.h Added example Markov 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