/*************************************************************************************************************************************/
/*                                                                                                                                   */
/*        C E N T R A G   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  :                                                   */
/*                                                                                                                                   */
/*                                                                                                                                   */
/*        Author of '$xrv/centrage.01$K' :                                                                                           */
/*                                                                                                                                   */
/*                    Jean-Francois COLONNA (LACTAMME, 20240420152514).                                                              */
/*                                                                                                                                   */
/*************************************************************************************************************************************/

/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/*                                                                                                                                   */
/*        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   FORCER_LES_EXTREMA                                                                                                            \
                    FAUX
#define   MINIMUM_ANCIEN                                                                                                                \
                    COORDONNEE_BARYCENTRIQUE_MINIMALE
#define   MAXIMUM_ANCIEN                                                                                                                \
                    COORDONNEE_BARYCENTRIQUE_MAXIMALE
                                        /* Afin de pouvoir forcer les extrema du fichier.                                            */

#define   MINIMUM_NOUVEAU                                                                                                               \
                    COORDONNEE_BARYCENTRIQUE_MINIMALE
#define   MAXIMUM_NOUVEAU                                                                                                               \
                    COORDONNEE_BARYCENTRIQUE_MAXIMALE
                                        /* Pour definir le facteur d'homothetie et la constante de translation...                    */

#define   VALEUR_CENTRALE                                                                                                               \
                    COORDONNEE_BARYCENTRIQUE_CENTRALE
                                        /* Definition du centre...                                                                   */

/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/*                                                                                                                                   */
/*        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...                                                  */

/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/*                                                                                                                                   */
/*        C E N T R A G   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(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.                                            */

     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(Float,INIT(valeur_centrale,VALEUR_CENTRALE));
                                        /* Definition du centre...                                                                   */

#include  xrv/ARITHMET.22.I"
#include  xci/valeurs.03.I"
     /*..............................................................................................................................*/
#include  xrv/champs_5.1A.I"

     GET_ARGUMENTS_(nombre_d_arguments
                   ,BLOC(GET_ARGUMENT_L("compatibilite_20230217=",compatibilite_20230217);

                         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("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);

                         GET_ARGUMENT_F("centre=""vc=",valeur_centrale);

                         PROCESS_ARGUMENTS_DE_PARAMETRAGE_DE_LA_GENERATION_DE_SUITE_DE_VALEURS_3;

                         PROCESS_ARGUMENTS_DE_PARAMETRAGE_DE_LA_GENERATION_DE_SUITE_DE_VALEURS_1;

                         PROCESS_ARGUMENTS_DE_PARAMETRAGE_DE_LA_GENERATION_DE_SUITE_DE_VALEURS_5;
                         )
                    );

#include  xrv/normalise.01.I"

     RECHERCHE_DES_EXTREMA(forcer_les_extrema
                          ,compatibilite_20230217
                          ,minimum_ancien,maximum_ancien
                          ,minimum_courant,maximum_courant
                          ,ELEMENT_DU_FICHIER
                          ,FAUX,FLOT__UNDEF
                           );

     gOPERATION_SUR_LES_FICHIERS(BLOC(
                                      DEFV(Float,INIT(valeur_courante,ELEMENT_DU_FICHIER(index)));
                                        /* Recuperation de la valeur courante dans le fichier.                                       */
                                      )
                                ,ADD2(valeur_courante
                                     ,ADD2(valeur_centrale
                                          ,NEGA(MOYE(minimum_courant,maximum_courant))
                                           )
                                      )
                                ,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



Copyright © Jean-François COLONNA, 2024-2024.
Copyright © CMAP (Centre de Mathématiques APpliquées) UMR CNRS 7641 / École polytechnique, Institut Polytechnique de Paris, 2024-2024.