This code was primarily written by Marina Polubelova (INRIA). An earlier version was written by Jean Karim Zinzindohoue (INRIA).