Evaluate a L-system at the n-th generation.
A L-system is first compressed before being iterated on. This compression allows far better performances.
One of the steps of compression is to transform string symbols into int. To be allowed to transform back and forth a lstream, the
compress_lstream function provides an environment from string symbols to int. This environment can be used by
uncompress_lstream for O(n) compression/uncompression. The laziness of
Lstream is respected.
type 'a lstream = ('a * float array) Lstream.t
apply rules lstream will apply rules once to
lstream. The optional argument
n can be used to apply more than once.
apply but with a complete mapping. Symbols without rules are suppressed.
val eval_lsys_uncompress : int -> ('a * string Calc.t list) lsystem -> (string * float array) Lstream.t
eval_lsys , but will ignore post rules and uncompress the stream instead.
val iter_complete : ( ( float array -> float ) array -> float array -> unit ) crules -> int lstream -> unit
Take a rule composed of unit functions and apply it to the stream.