/*************************************************************************************************************************************/
/*                                                                                                                                   */
/*        T R A N S F O R M A T I O N   I T E R A T I V E   D ' U N E   I M A G E                                                    */
/*        P A R   L A   D Y N A M I Q U E   D E   V E R H U L S T  :                                                                 */
/*                                                                                                                                   */
/*                                                                                                                                   */
/*        Author of '$xci/Verhulst.01$K' :                                                                                           */
/*                                                                                                                                   */
/*                    Jean-Francois COLONNA (LACTAMME, 1996??????????).                                                              */
/*                                                                                                                                   */
/*************************************************************************************************************************************/

/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/*                                                                                                                                   */
/*        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
#include  image_image_IMAGESF_EXT
#include  image_image_GOOF_IMAGE_EXT
                                        /* Introduit le 20051128161055...                                                            */

/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/*                                                                                                                                   */
/*        P A R A M E T R E S  :                                                                                                     */
/*                                                                                                                                   */
/*************************************************************************************************************************************/
#define   TAUX_DE_CROISSANCE                                                                                                            \
                    FTROIS                                                                                                              \
                                        /* Taux de croissance 'R'.                                                                   */
#define   NOMBRE_D_ITERATIONS                                                                                                           \
                    SEIZE                                                                                                               \
                                        /* Nombre d'iterations 'N'.                                                                  */

#define   LA_TRANSFORMATION_EST_DELOCALISEE                                                                                             \
                    VRAI                                                                                                                \
                                        /* Choix entre la transformation "delocalisee" ('VRAI') et "localisee" ('FAUX'). Cette       */ \
                                        /* option a ete introduite le 20040915102409.                                                */

#define   TRANSFORMER_LES_NIVEAUX                                                                                                       \
                    VRAI
#define   TRANSFORMER_LES_COORDONNEES_X                                                                                                 \
                    FAUX
#define   TRANSFORMER_LES_COORDONNEES_Y                                                                                                 \
                    FAUX
                                        /* Indiquent si les niveaux et les coordonnees sont respectivement a transformer.            */

#define   PONDERATION_X                                                                                                                 \
                    FZERO
#define   PONDERATION_Y                                                                                                                 \
                    FZERO
#define   PONDERATION_N                                                                                                                 \
                    FU
#define   TRANSLATION__                                                                                                                 \
                    FZERO
                                        /* Ponderations de {X,Y} et du niveau, et translation pour le mode "localise"...             */

#define   MINIMUM_FORCE_POUR_LES_NIVEAUX                                                                                                \
                    FZERO
#define   MAXIMUM_FORCE_POUR_LES_NIVEAUX                                                                                                \
                    FU
                                        /* Extrema forces pour les niveaux.                                                          */

/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/*                                                                                                                                   */
/*        M A C R O S   U T I L E S  :                                                                                               */
/*                                                                                                                                   */
/*************************************************************************************************************************************/
#include  xci/Verhulst.01.I"

/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/*                                                                                                                                   */
/*        T R A N S F O R M A T I O N   I T E R A T I V E   D ' U N E   I M A G E                                                    */
/*        P A R   L A   D Y N A M I Q U E   D E   V E R H U L S T  :                                                                 */
/*                                                                                                                                   */
/*************************************************************************************************************************************/
BCommande(nombre_d_arguments,arguments)
/*-----------------------------------------------------------------------------------------------------------------------------------*/
     Bblock
     DEFV(CHAR,INIC(POINTERc(nom_imageR),NOM_PIPE));
     DEFV(CHAR,INIC(POINTERc(nom_imageA),NOM_PIPE));
     DEFV(CHAR,INIC(POINTERc(nom_imageT),NOM_PIPE));
     DEFV(CHAR,INIC(POINTERc(nom_imagePX),NOM_PIPE));
     DEFV(CHAR,INIC(POINTERc(nom_imagePY),NOM_PIPE));
     DEFV(CHAR,INIC(POINTERc(nom_imagePN),NOM_PIPE));
     DEFV(CHAR,INIC(POINTERc(nom_imageTR),NOM_PIPE));

     DEFV(Float,INIT(taux_de_croissance,TAUX_DE_CROISSANCE));
                                        /* Taux de croissance 'R'.                                                                   */
     DEFV(Positive,INIT(nombre_d_iterations,NOMBRE_D_ITERATIONS));
                                        /* Nombre d'iterations 'N'.                                                                  */
     DEFV(Logical,INIT(la_transformation_est_delocalisee,LA_TRANSFORMATION_EST_DELOCALISEE));
                                        /* Choix entre la transformation "delocalisee" ('VRAI') et "localisee" ('FAUX'). Cette       */
                                        /* option a ete introduite le 20040915102409.                                                */

     DEFV(Logical,INIT(transformer_les_niveaux,TRANSFORMER_LES_NIVEAUX));
     DEFV(Logical,INIT(transformer_les_coordonnees_X,TRANSFORMER_LES_COORDONNEES_X));
     DEFV(Logical,INIT(transformer_les_coordonnees_Y,TRANSFORMER_LES_COORDONNEES_Y));
                                        /* Indiquent si les niveaux et les coordonnees sont respectivement a transformer.            */

     DEFV(Float,INIT(ponderation_X,PONDERATION_X));
     DEFV(Float,INIT(ponderation_Y,PONDERATION_Y));
     DEFV(Float,INIT(ponderation_N,PONDERATION_N));
     DEFV(Float,INIT(translation__,TRANSLATION__));
                                        /* Ponderations de {X,Y} et du niveau, et translation pour le mode "localise"...             */

     DEFV(Float,INIT(minimum_force_pour_les_niveaux,MINIMUM_FORCE_POUR_LES_NIVEAUX));
     DEFV(Float,INIT(maximum_force_pour_les_niveaux,MAXIMUM_FORCE_POUR_LES_NIVEAUX));
                                        /* Extrema forces pour les niveaux.                                                          */
     /*..............................................................................................................................*/
     GET_ARGUMENTSi(nombre_d_arguments
                   ,BLOC(GET_ARGUMENT_C("imageA=""A=",nom_imageA);
                         GET_ARGUMENT_C("imageT=""T=",nom_imageT);
                         GET_ARGUMENT_C("imagePX=""PX=",nom_imagePX);
                         GET_ARGUMENT_C("imagePY=""PY=",nom_imagePY);
                         GET_ARGUMENT_C("imagePN=""PN=",nom_imagePN);
                         GET_ARGUMENT_C("imageTR=""TR=",nom_imageTR);
                         GET_ARGUMENT_C("imageR=""R=",nom_imageR);
                         GET_ARGUMENT_L("standard=",les_images_sont_standards);

                         GET_ARGUMENT_F("taux=""croissance=",taux_de_croissance);

                         GET_ARGUMENT_L("delocalisee=""deloc=",la_transformation_est_delocalisee);
                         GET_ARGUMENT_N("localisee=""loc=",la_transformation_est_delocalisee);

                         GET_ARGUMENT_I("nombre=""iterations=",nombre_d_iterations);

                         GET_ARGUMENT_F("increment_delocalise=""ideloc="
                                       ,IFdynamique_de_Verhulst_delocalisee_____increment_du_taux_de_croissance
                                        );

                         GET_ARGUMENT_L("niveaux=",transformer_les_niveaux);
                         GET_ARGUMENT_L("cX=""X=",transformer_les_coordonnees_X);
                         GET_ARGUMENT_L("cY=""Y=",transformer_les_coordonnees_Y);

                         GET_ARGUMENT_F("increment_localise=""iloc="
                                       ,IFdynamique_de_Verhulst_localisee_____increment_du_taux_de_croissance
                                        );
                         GET_ARGUMENT_F("ponderationX=",ponderation_X);
                         GET_ARGUMENT_F("ponderationY=",ponderation_Y);
                         GET_ARGUMENT_F("ponderationN=",ponderation_N);
                         GET_ARGUMENT_F("translation=",translation__);

                         GET_ARGUMENT_F("minimum=",minimum_force_pour_les_niveaux);
                         GET_ARGUMENT_F("maximum=",maximum_force_pour_les_niveaux);
                         )
                    );

     CALi(gInettoyage(les_images_sont_standards,ImageR,IFmageR));
                                        /* Initialisation de l'image Resultat.                                                       */

     LOAD_D_UNE_IMAGE_FLOTTANTE_DE_PARAMETRAGE(IFmageA1,nom_imageT,taux_de_croissance,"taux de croissance");

     Test(PAS_D_ERREUR(CODE_ERROR(gIload_image(les_images_sont_standards,ImageA,IFmageA,nom_imageA))))
          Bblock
          Test(EST_VRAI(les_images_sont_standards))
               Bblock
               CALS(Istd_float(IFmageA,minimum_force_pour_les_niveaux,maximum_force_pour_les_niveaux,ImageA));
                                        /* Conversion flottante si necessaire.                                                       */
               Eblock
          ATes
               Bblock
               Eblock
          ETes

          Test(EST_VRAI(la_transformation_est_delocalisee))
               Bblock
               CALS(IFdynamique_de_Verhulst_delocalisee(IFmageR
                                                       ,IFmageA1
                                                       ,nombre_d_iterations
                                                       ,IFmageA
                                                       ,transformer_les_niveaux
                                                       ,transformer_les_coordonnees_X
                                                       ,transformer_les_coordonnees_Y
                                                        )
                    );
                                        /* Iteration par la dynamique de Verhulst "delocalisee". Dans ce mode {X,Y} et le niveau 'N' */
                                        /* de chaque point sont iteres independamment l'un de l'autre :                              */
                                        /*                                                                                           */
                                        /*                  X  = Verhulst(X   )                                                      */
                                        /*                   n             n-1                                                       */
                                        /*                                                                                           */
                                        /*                  Y  = Verhulst(Y   )                                                      */
                                        /*                   n             n-1                                                       */
                                        /*                                                                                           */
                                        /*                  N  = Verhulst(N   )                                                      */
                                        /*                   n             n-1                                                       */
                                        /*                                                                                           */
                                        /* Le 20040915172214 'IFmageA1' (de type 'imageF') a remplace 'taux_de_croissance' (de       */
                                        /* type 'Float').                                                                            */
               Eblock
          ATes
               Bblock
               BDEFV(imageF,image_ponderation_X);
               BDEFV(imageF,image_ponderation_Y);
               BDEFV(imageF,image_ponderation_N);
               BDEFV(imageF,image_translation__);
                                        /* Images ponderations de {X,Y} et du niveau, et translation...                              */

               LOAD_D_UNE_IMAGE_FLOTTANTE_DE_PARAMETRAGE(image_ponderation_X,nom_imagePX,ponderation_X,"ponderation de 'X'");
               LOAD_D_UNE_IMAGE_FLOTTANTE_DE_PARAMETRAGE(image_ponderation_Y,nom_imagePY,ponderation_Y,"ponderation de 'Y'");
               LOAD_D_UNE_IMAGE_FLOTTANTE_DE_PARAMETRAGE(image_ponderation_N,nom_imagePN,ponderation_N,"ponderation du niveau");
               LOAD_D_UNE_IMAGE_FLOTTANTE_DE_PARAMETRAGE(image_translation__,nom_imageTR,translation__,"translation");
                                        /* Chargement des images ponderations de {X,Y} et du niveau, et translation...               */

               CALS(IFdynamique_de_Verhulst_localisee(IFmageR
                                                     ,IFmageA1
                                                     ,nombre_d_iterations
                                                     ,IFmageA
                                                     ,image_ponderation_X
                                                     ,image_ponderation_Y
                                                     ,image_ponderation_N
                                                     ,image_translation__
                                                      )
                    );
                                        /* Iteration par la dynamique de Verhulst "localisee". Dans ce mode {X,Y} sont conserves     */
                                        /* (d'ou le "local") et seul le niveau est modifie ; ce qui est en fait itere est une        */
                                        /* sorte de niveau generalise 'NG' obtenu par une combinaison de {X,Y} et du niveau 'N' :    */
                                        /*                                                                                           */
                                        /*                  NG = PX.X + PY.Y + PN.N + translation                                    */
                                        /*                                                                                           */
                                        /* et iteration de 'NG' :                                                                    */
                                        /*                                                                                           */
                                        /*                  NG  = Verhulst(NG   )                                                    */
                                        /*                    n              n-1                                                     */
                                        /*                                                                                           */
                                        /* les quatre parametres {PX,PY,PN,translation} etant introduits si besoin est sous forme    */
                                        /* d'images de type 'imageF'...                                                              */
                                        /*                                                                                           */
                                        /* Le 20040915172214 'IFmageA1' (de type 'imageF') a remplace 'taux_de_croissance' (de       */
                                        /* type 'Float').                                                                            */

               EDEFV(imageF,image_translation__);
               EDEFV(imageF,image_ponderation_N);
               EDEFV(imageF,image_ponderation_Y);
               EDEFV(imageF,image_ponderation_X);
                                        /* Images ponderations de {X,Y} et du niveau, et translation...                              */
               Eblock
          ETes

          Test(EST_VRAI(les_images_sont_standards))
               Bblock
               CALS(Ifloat_std_avec_renormalisation(ImageR,IFmageR));
                                        /* Conversion "standard" si necessaire.                                                      */
               Eblock
          ATes
               Bblock
               Eblock
          ETes

          CALi(gIupdate_image(les_images_sont_standards,nom_imageR,ImageR,IFmageR));
                                        /* Et enfin, sortie...                                                                       */
          Eblock
     ATes
          Bblock
          Test__CODE_ERREUR__ERREUR07;
          Eblock
     ETes

     RETU_Commande;
     Eblock
ECommande



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