/*************************************************************************************************************************************/ /* */ /* N O R M A L I S A T I O N D E C H A Q U E E L E M E N T D ' U N F I C H I E R N U M E R I Q U E */ /* P A R R A P P O R T A U X E X T R E M A D E C E L U I - C I : */ /* */ /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * * * ** * * * * * ** * */ /* * * * * * * * * * * * * * * * */ /* * * * * * * * * * * * * * */ /* * * * * * * * * * * * * * * * */ /* * * * * * * * * * * * * * * * */ /* * * * * * * * * * * * * * * * * * */ /* * * * * * * * * * * * * * */ /* * * * * * * * * * * * * * * * */ /* * * * * ** * * * * * ** */ /* * * * * * * * * * * * * * * * * * * * * * * */ /* */ /* */ /* ATTENTION : */ /* */ /* Je note le 20180618162923 que la normalisation */ /* a lieu dans [0,1] par defaut, alors que des outils */ /* tel 'v $xci/valeurs_imag$K' donnent des coordonnees */ /* dans [0,1[. On aura donc interet a s'inspirer de */ /* 'v $xiirv/.PUZZ.11.1.$U 20180618161323' si necessaire... */ /* */ /* On pourra faire ('v $xiak/$Fnota .xci.coordonnees.X') : */ /* */ /* set MiNiMuM_X=`$xci/coordonnees$X eX=VRAI eY=FAUX normaliser=VRAI X=$Xmin` */ /* set MaXiMuM_X=`$xci/coordonnees$X eX=VRAI eY=FAUX normaliser=VRAI X=$Xmax` */ /* */ /* origine=$MiNiMuM_X extremite=$MaXiMuM_X */ /* */ /* ou : */ /* */ /* */ /* set MiNiMuM_Y=`$xci/coordonnees$X eX=FAUX eY=VRAI normaliser=VRAI Y=$Ymin` */ /* set MaXiMuM_Y=`$xci/coordonnees$X eX=FAUX eY=VRAI normaliser=VRAI Y=$Ymax` */ /* */ /* origine=$MiNiMuM_Y extremite=$MaXiMuM_Y */ /* */ /* */ /* Author of '$xrv/normalise.01$K' : */ /* */ /* Jean-Francois COLONNA (LACTAMME, 20011017090058). */ /* */ /*************************************************************************************************************************************/ /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* I N T E R F A C E ' listG ' : */ /* */ /* */ /* :Debut_listG: */ /* :Fin_listG: */ /* */ /*************************************************************************************************************************************/ /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* D I R E C T I V E S S P E C I F I Q U E S D E C O M P I L A T I O N : */ /* */ /*************************************************************************************************************************************/ /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* F I C H I E R S D ' I N C L U D E S : */ /* */ /*************************************************************************************************************************************/ #include INCLUDES_BASE /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* V A L E U R S I M P L I C I T E S D E S P A R A M E T R E S : */ /* */ /*************************************************************************************************************************************/ #define COMPATIBILITE_20230217 \ FAUX \ /* Permet de faire des calculs compatibles a ceux faits anterieurement au 20230217185440... */ #define NORMALISER \ VRAI \ /* Faut-il normaliser ('VRAI') ou pas ('FAUX') ? Ce dispositif a ete introduit le */ \ /* 20020708131036 pour etre utilise dans 'v $xiirf/.ETC2.61.2.$U normalise.01'. */ #define FAIRE_UN_AXPB \ FAUX \ /* Dans le cas ou 'IL_NE_FAUT_PAS(normaliser)' doit-on simplement renvoyer la valeur */ \ /* ('FAUX') ou bien lui faire subir un 'AXPB(...)' ('VRAI'). Ce dispositif a ete */ \ /* introduit le 20150604131549 pour 'v $xiirv/.MAIL.11.1.$U .xrv.normalise.01.X'... */ #define FORCER_LES_EXTREMA \ FAUX #define MINIMUM_ANCIEN \ COORDONNEE_BARYCENTRIQUE_MINIMALE #define MAXIMUM_ANCIEN \ COORDONNEE_BARYCENTRIQUE_MAXIMALE /* Afin de pouvoir forcer les extrema du fichier. Ceci fut introduit le 20080313092005... */ #define MINIMUM_NOUVEAU \ COORDONNEE_BARYCENTRIQUE_MINIMALE #define MAXIMUM_NOUVEAU \ COORDONNEE_BARYCENTRIQUE_MAXIMALE /* Pour definir le facteur d'homothetie et la constante de translation... */ #define IGNORER_L_UNIFORMITE_DU_FICHER \ VRAI #define VALEUR_A_FORCER_DANS_LE_CAS_DE_L_UNIFORMITE_DU_FICHER \ COORDONNEE_BARYCENTRIQUE_CENTRALE /* Introduit le 20130626090323... */ #define CONSERVER_UNE_VALEUR_PARTICULIERE \ FAUX #define VALEUR_PARTICULIERE_A_CONSERVER \ FZERO /* Introduit le 20131101100526 pour 'v $xiirv/.PRIM.4.12.$U conserver'... */ /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* D E F I N I T I O N D U F I C H I E R : */ /* */ /*************************************************************************************************************************************/ #include xrv/ARITHMET.1d.I" /* Passage a l'allocation dynamique le 20060214192606... */ #define NOMBRE_DE_DECIMALES \ SEIZE #include xrv/ARITHMET.21.I" #include xrv/champs_5.41.I" #define VALEUR_IMPLICITE \ FZERO gGENERATION_D_UN_FICHIER(fichier_des_valeurs,liste_des_valeurs); /* Definition en memoire du fichier. */ #define ELEMENT_DU_FICHIER(index) \ gELEMENT_DU_FICHIER(liste_des_valeurs,index) \ /* Acces a un element courant du fichier. */ /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* D E F I N I T I O N D E S E D I T I O N S : */ /* */ /*************************************************************************************************************************************/ #define FORMAT_EFFECTIF_D_EDITION(message) \ Cara(chain_Aconcaten5(message,INTRODUCTION_FORMAT,valeurs_signees,".*",format_d_edition)) \ /* Format effectif de certaines editions... */ /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* N O R M A L I S A T I O N D E C H A Q U E E L E M E N T D ' U N F I C H I E R N U M E R I Q U E */ /* P A R R A P P O R T A U X E X T R E M A D E C E L U I - C I : */ /* */ /*************************************************************************************************************************************/ BCommande(nombre_d_arguments,arguments) /*-----------------------------------------------------------------------------------------------------------------------------------*/ Bblock DEFV(Logical,INIT(compatibilite_20230217,COMPATIBILITE_20230217)); /* Permet de faire des calculs compatibles a ceux faits anterieurement au 20230217185440... */ DEFV(Logical,INIT(normaliser,NORMALISER)); /* Faut-il normaliser ('VRAI') ou pas ('FAUX') ? Ce dispositif a ete introduit le */ /* 20020708131036 pour etre utilise dans 'v $xiirf/.ETC2.61.2.$U normalise.01'. */ DEFV(Logical,INIT(faire_un_AXPB,FAIRE_UN_AXPB)); /* Dans le cas ou 'IL_NE_FAUT_PAS(normaliser)' doit-on simplement renvoyer la valeur */ /* ('FAUX') ou bien lui faire subir un 'AXPB(...)' ('VRAI'). Ce dispositif a ete */ /* introduit le 20150604131549 pour 'v $xiirv/.MAIL.11.1.$U .xrv.normalise.01.X'... */ DEFV(Logical,INIT(forcer_les_extrema,FORCER_LES_EXTREMA)); DEFV(Float,INIT(minimum_ancien,MINIMUM_ANCIEN)); DEFV(Float,INIT(maximum_ancien,MAXIMUM_ANCIEN)); /* Afin de pouvoir forcer les extrema du fichier. Ceci fut introduit le 20080313092005... */ DEFV(Float,INIT(minimum_nouveau,MINIMUM_NOUVEAU)); DEFV(Float,INIT(maximum_nouveau,MAXIMUM_NOUVEAU)); /* Pour definir l'intervalle de normalisation... */ DEFV(Float,INIT(minimum_courant,F_INFINI)); DEFV(Float,INIT(maximum_courant,F_MOINS_L_INFINI)); /* Pour extraire les extrema du fichier. */ DEFV(Logical,INIT(ignorer_l_uniformite_du_ficher,IGNORER_L_UNIFORMITE_DU_FICHER)); DEFV(Float,INIT(valeur_a_forcer_dans_le_cas_de_l_uniformite_du_ficher,VALEUR_A_FORCER_DANS_LE_CAS_DE_L_UNIFORMITE_DU_FICHER)); /* Introduit le 20130626090323... */ DEFV(Logical,INIT(conserver_une_valeur_particuliere,CONSERVER_UNE_VALEUR_PARTICULIERE)); DEFV(Float,INIT(valeur_particuliere_a_conserver,VALEUR_PARTICULIERE_A_CONSERVER)); /* Introduit le 20131101100526 pour 'v $xiirv/.PRIM.4.12.$U conserver'... */ #include xrv/ARITHMET.22.I" #include xci/valeurs.03.I" /*..............................................................................................................................*/ #include xrv/champs_5.1A.I" /* Ceci fut introduit le 20070103174050... */ GET_ARGUMENTS_(nombre_d_arguments ,BLOC(GET_ARGUMENT_L("compatibilite_20230217=",compatibilite_20230217); /* Argument introduits le 20230217185440... */ PROCESS_ARGUMENT_I("nombre_elements=""ne=",nombre_d_elements ,BLOC(VIDE;) ,BLOC(Bblock PRINT_AVERTISSEMENT("'ne=' doit etre defini avant toute entree de fichiers"); Eblock ) ); PROCESS_ARGUMENTS_DE_DEFINITION_DES_FICHIERS_01; PROKESF_ARGUMENT_FICHIER("fichier=" ,fichier_des_valeurs ,liste_des_valeurs ,VALEUR_IMPLICITE ,lTRANSFORMAT_0d ,iGENERATION_D_UN_FICHIER ); GET_ARGUMENT_L("normaliser=",normaliser); GET_ARGUMENT_L("AXPB=",faire_un_AXPB); /* Argument introduits le 20150604131549... */ GET_ARGUMENT_L("forcer_extrema=""forcer=""fe=",forcer_les_extrema); GET_ARGUMENT_F("minimum_force=""mA=",minimum_ancien); GET_ARGUMENT_F("maximum_force=""MA=",maximum_ancien); GET_ARGUMENT_F("minimum=""m=""mR=""origine=",minimum_nouveau); GET_ARGUMENT_F("maximum=""M=""MR=""extremite=",maximum_nouveau); /* Les arguments "origine=" et "extremite=" ont ete introduits le 20111114101052 */ /* par "symetrie" avec 'v $xci/normalise.01$K .origine=..o=.' en notant que l'on ne peut */ /* definir "o=" et "e=" car ce dernier l'est deja dans 'v $xci/valeurs.02$I .entier=..e=.'. */ GET_ARGUMENT_L("ignorer_uniformite=""iu=",ignorer_l_uniformite_du_ficher); GET_ARGUMENT_F("valeur_uniforme=""vu=",valeur_a_forcer_dans_le_cas_de_l_uniformite_du_ficher); /* Arguments introduits le 20130626090323... */ GET_ARGUMENT_L("conserver_valeur=""cv=",conserver_une_valeur_particuliere); GET_ARGUMENT_F("valeur_a_conserver=""vac=",valeur_particuliere_a_conserver); /* Arguments introduits le 20131101100526... */ PROCESS_ARGUMENTS_DE_PARAMETRAGE_DE_LA_GENERATION_DE_SUITE_DE_VALEURS_3; /* Cette procedure fut introduite le 20070103174050... */ PROCESS_ARGUMENTS_DE_PARAMETRAGE_DE_LA_GENERATION_DE_SUITE_DE_VALEURS_1; /* Cette procedure fut introduite le 20061226192610... */ PROCESS_ARGUMENTS_DE_PARAMETRAGE_DE_LA_GENERATION_DE_SUITE_DE_VALEURS_5; /* Cette procedure fut introduite le 20211005105734... */ ) ); #include xrv/normalise.01.I" /* Ceci fut introduit le 20230220110055... */ RECHERCHE_DES_EXTREMA(forcer_les_extrema ,compatibilite_20230217 ,minimum_ancien,maximum_ancien ,minimum_courant,maximum_courant ,ELEMENT_DU_FICHIER ,conserver_une_valeur_particuliere,valeur_particuliere_a_conserver ); gOPERATION_SUR_LES_FICHIERS(BLOC( DEFV(Float,INIT(valeur_courante,ELEMENT_DU_FICHIER(index))); /* Recuperation de la valeur courante dans le fichier. */ ) ,NORMALISATION_D_UNE_VALEUR(valeur_courante ,normaliser ,ignorer_l_uniformite_du_ficher ,valeur_a_forcer_dans_le_cas_de_l_uniformite_du_ficher ,conserver_une_valeur_particuliere ,valeur_particuliere_a_conserver ,minimum_courant,maximum_courant ,minimum_nouveau,maximum_nouveau ,faire_un_AXPB ) ,EDITER_LA_VALEUR_RESULTANTE_DANS_gOPERATION_SUR_LES_FICHIERS ,nombre_d_exemplaires_du_resultat_de_l_operation_sur_les_valeurs_courantes ); /* Normalisation du fichier argument. */ lGENERATION_D_UN_FICHIER(liste_des_valeurs,VALEUR_IMPLICITE); RETU_Commande; Eblock ECommande