/* ================================================================================ RPL/2 (R) version 4.1.32 Copyright (C) 1989-2020 Dr. BERTRAND Joël This file is part of RPL/2. RPL/2 is free software; you can redistribute it and/or modify it under the terms of the CeCILL V2 License as published by the french CEA, CNRS and INRIA. RPL/2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the CeCILL V2 License for more details. You should have received a copy of the CeCILL License along with RPL/2. If not, write to info@cecill.info. ================================================================================ */ #include "rpl-conv.h" void initialisation_generateur_aleatoire(struct_processus *s_etat_processus, logical1 initialisation_automatique, integer8 racine) { struct timeval horodatage; if ((*s_etat_processus).type_generateur_aleatoire == NULL) { (*s_etat_processus).type_generateur_aleatoire = gsl_rng_ranlux389; } if (((*s_etat_processus).generateur_aleatoire = gsl_rng_alloc((*s_etat_processus).type_generateur_aleatoire)) == NULL) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; return; } if (initialisation_automatique == d_vrai) { gettimeofday(&horodatage, NULL); gsl_rng_set((*s_etat_processus).generateur_aleatoire, (unsigned long int) (horodatage.tv_usec ^ horodatage.tv_sec)); } else { gsl_rng_set((*s_etat_processus).generateur_aleatoire, (unsigned long int) racine); } return; } void liberation_generateur_aleatoire(struct_processus *s_etat_processus) { gsl_rng_free((*s_etat_processus).generateur_aleatoire); (*s_etat_processus).generateur_aleatoire = NULL; (*s_etat_processus).type_generateur_aleatoire = NULL; return; } // vim: ts=4