version 1.3, 2010/02/10 10:14:23
|
version 1.41, 2013/02/27 17:11:43
|
Line 1
|
Line 1
|
/* |
/* |
================================================================================ |
================================================================================ |
RPL/2 (R) version 4.0.11 |
RPL/2 (R) version 4.1.13 |
Copyright (C) 1989-2010 Dr. BERTRAND Joël |
Copyright (C) 1989-2013 Dr. BERTRAND Joël |
|
|
This file is part of RPL/2. |
This file is part of RPL/2. |
|
|
Line 20
|
Line 20
|
*/ |
*/ |
|
|
|
|
#include "rpl.conv.h" |
#include "rpl-conv.h" |
|
|
|
|
/* |
/* |
Line 38
|
Line 38
|
void |
void |
instruction_mean(struct_processus *s_etat_processus) |
instruction_mean(struct_processus *s_etat_processus) |
{ |
{ |
logical1 presence_variable; |
|
|
|
long i; |
|
|
|
struct_objet *s_objet_statistique; |
struct_objet *s_objet_statistique; |
struct_objet *s_objet_resultat; |
struct_objet *s_objet_resultat; |
struct_objet *s_objet_temporaire; |
struct_objet *s_objet_temporaire; |
Line 85 instruction_mean(struct_processus *s_eta
|
Line 81 instruction_mean(struct_processus *s_eta
|
* Recherche d'une variable globale référencée par SIGMA |
* Recherche d'une variable globale référencée par SIGMA |
*/ |
*/ |
|
|
if (recherche_variable(s_etat_processus, ds_sdat) == d_faux) |
if (recherche_variable_globale(s_etat_processus, ds_sdat) == d_faux) |
{ |
{ |
/* |
/* |
* Aucune variable SIGMA |
* Aucune variable SIGMA |
*/ |
*/ |
|
|
(*s_etat_processus).erreur_systeme = d_es; |
(*s_etat_processus).erreur_systeme = d_es; |
(*s_etat_processus).erreur_execution = d_ex_absence_observations; |
|
return; |
|
} |
|
else |
|
{ |
|
/* |
|
* Il existe une variable locale SIGMA. Reste à vérifier l'existence |
|
* d'une variable SIGMA globale... |
|
*/ |
|
|
|
i = (*s_etat_processus).position_variable_courante; |
if ((*s_etat_processus).erreur_execution == d_ex) |
presence_variable = d_faux; |
|
|
|
while(i >= 0) |
|
{ |
{ |
if ((strcmp((*s_etat_processus).s_liste_variables[i].nom, |
(*s_etat_processus).erreur_execution = d_ex_absence_observations; |
ds_sdat) == 0) && ((*s_etat_processus) |
|
.s_liste_variables[i].niveau == 1)) |
|
{ |
|
presence_variable = d_vrai; |
|
break; |
|
} |
|
|
|
i--; |
|
} |
} |
|
|
if (presence_variable == d_faux) |
return; |
|
} |
|
else |
|
{ |
|
if (((*(*(*s_etat_processus).pointeur_variable_courante).objet) |
|
.type != MIN) && ((*(*(*s_etat_processus) |
|
.pointeur_variable_courante).objet).type != MRL)) |
{ |
{ |
(*s_etat_processus).erreur_execution = d_ex_absence_observations; |
(*s_etat_processus).erreur_execution = |
|
d_ex_matrice_statistique_invalide; |
return; |
return; |
} |
} |
else |
|
{ |
|
(*s_etat_processus).position_variable_courante = i; |
|
|
|
if ((*s_etat_processus).s_liste_variables[i].objet == NULL) |
nombre_colonnes = (*((struct_matrice *) (*(*(*s_etat_processus) |
{ |
.pointeur_variable_courante).objet).objet)).nombre_colonnes; |
(*s_etat_processus).erreur_execution = d_ex_variable_partagee; |
|
return; |
|
} |
|
|
|
if (((*((*s_etat_processus).s_liste_variables |
|
[(*s_etat_processus).position_variable_courante].objet)) |
|
.type != MIN) && ((*((*s_etat_processus) |
|
.s_liste_variables[(*s_etat_processus) |
|
.position_variable_courante].objet)).type != MRL)) |
|
{ |
|
(*s_etat_processus).erreur_execution = |
|
d_ex_matrice_statistique_invalide; |
|
return; |
|
} |
|
|
|
nombre_colonnes = (*((struct_matrice *) (*((*s_etat_processus) |
|
.s_liste_variables[(*s_etat_processus) |
|
.position_variable_courante].objet)).objet)) |
|
.nombre_colonnes; |
|
} |
|
} |
} |
|
|
s_objet_statistique = ((*s_etat_processus).s_liste_variables |
s_objet_statistique = (*(*s_etat_processus).pointeur_variable_courante) |
[(*s_etat_processus).position_variable_courante]).objet; |
.objet; |
|
|
if (((*s_objet_statistique).type == MIN) || |
if (((*s_objet_statistique).type == MIN) || |
((*s_objet_statistique).type == MRL)) |
((*s_objet_statistique).type == MRL)) |
Line 255 instruction_mean(struct_processus *s_eta
|
Line 215 instruction_mean(struct_processus *s_eta
|
void |
void |
instruction_mins(struct_processus *s_etat_processus) |
instruction_mins(struct_processus *s_etat_processus) |
{ |
{ |
logical1 presence_variable; |
|
|
|
long i; |
long i; |
long j; |
long j; |
|
|
Line 302 instruction_mins(struct_processus *s_eta
|
Line 260 instruction_mins(struct_processus *s_eta
|
* Recherche d'une variable globale référencée par SIGMA |
* Recherche d'une variable globale référencée par SIGMA |
*/ |
*/ |
|
|
if (recherche_variable(s_etat_processus, ds_sdat) == d_faux) |
if (recherche_variable_globale(s_etat_processus, ds_sdat) == d_faux) |
{ |
{ |
/* |
/* |
* Aucune variable SIGMA |
* Aucune variable SIGMA |
*/ |
*/ |
|
|
(*s_etat_processus).erreur_systeme = d_es; |
(*s_etat_processus).erreur_systeme = d_es; |
(*s_etat_processus).erreur_execution = d_ex_absence_observations; |
|
return; |
|
} |
|
else |
|
{ |
|
/* |
|
* Il existe une variable locale SIGMA. Reste à vérifier l'existence |
|
* d'une variable SIGMA globale... |
|
*/ |
|
|
|
i = (*s_etat_processus).position_variable_courante; |
|
presence_variable = d_faux; |
|
|
|
while(i >= 0) |
if ((*s_etat_processus).erreur_execution == d_ex) |
{ |
{ |
if ((strcmp((*s_etat_processus).s_liste_variables[i].nom, |
(*s_etat_processus).erreur_execution = d_ex_absence_observations; |
ds_sdat) == 0) && ((*s_etat_processus) |
|
.s_liste_variables[i].niveau == 1)) |
|
{ |
|
presence_variable = d_vrai; |
|
break; |
|
} |
|
|
|
i--; |
|
} |
} |
|
|
if (presence_variable == d_faux) |
return; |
|
} |
|
else |
|
{ |
|
if (((*(*(*s_etat_processus).pointeur_variable_courante).objet) |
|
.type != MIN) && ((*(*(*s_etat_processus) |
|
.pointeur_variable_courante).objet).type != MRL)) |
{ |
{ |
(*s_etat_processus).erreur_execution = d_ex_absence_observations; |
(*s_etat_processus).erreur_execution = |
|
d_ex_matrice_statistique_invalide; |
return; |
return; |
} |
} |
else |
|
{ |
|
(*s_etat_processus).position_variable_courante = i; |
|
|
|
if ((*s_etat_processus).s_liste_variables[i].objet == NULL) |
|
{ |
|
(*s_etat_processus).erreur_execution = d_ex_variable_partagee; |
|
return; |
|
} |
|
|
|
if (((*((*s_etat_processus).s_liste_variables |
|
[(*s_etat_processus).position_variable_courante].objet)) |
|
.type != MIN) && ((*((*s_etat_processus) |
|
.s_liste_variables[(*s_etat_processus) |
|
.position_variable_courante].objet)).type != MRL)) |
|
{ |
|
(*s_etat_processus).erreur_execution = |
|
d_ex_matrice_statistique_invalide; |
|
return; |
|
} |
|
|
|
nombre_colonnes = (*((struct_matrice *) (*((*s_etat_processus) |
nombre_colonnes = (*((struct_matrice *) (*(*(*s_etat_processus) |
.s_liste_variables[(*s_etat_processus) |
.pointeur_variable_courante).objet).objet)).nombre_colonnes; |
.position_variable_courante].objet)).objet)) |
|
.nombre_colonnes; |
|
} |
|
} |
} |
|
|
s_objet_statistique = ((*s_etat_processus).s_liste_variables |
s_objet_statistique = (*(*s_etat_processus).pointeur_variable_courante) |
[(*s_etat_processus).position_variable_courante]).objet; |
.objet; |
|
|
if (nombre_colonnes == 1) |
if (nombre_colonnes == 1) |
{ |
{ |
Line 537 instruction_mins(struct_processus *s_eta
|
Line 459 instruction_mins(struct_processus *s_eta
|
void |
void |
instruction_maxs(struct_processus *s_etat_processus) |
instruction_maxs(struct_processus *s_etat_processus) |
{ |
{ |
logical1 presence_variable; |
|
|
|
long i; |
long i; |
long j; |
long j; |
|
|
Line 584 instruction_maxs(struct_processus *s_eta
|
Line 504 instruction_maxs(struct_processus *s_eta
|
* Recherche d'une variable globale référencée par SIGMA |
* Recherche d'une variable globale référencée par SIGMA |
*/ |
*/ |
|
|
if (recherche_variable(s_etat_processus, ds_sdat) == d_faux) |
if (recherche_variable_globale(s_etat_processus, ds_sdat) == d_faux) |
{ |
{ |
/* |
/* |
* Aucune variable SIGMA |
* Aucune variable SIGMA |
*/ |
*/ |
|
|
(*s_etat_processus).erreur_systeme = d_es; |
(*s_etat_processus).erreur_systeme = d_es; |
(*s_etat_processus).erreur_execution = d_ex_absence_observations; |
|
return; |
|
} |
|
else |
|
{ |
|
/* |
|
* Il existe une variable locale SIGMA. Reste à vérifier l'existence |
|
* d'une variable SIGMA globale... |
|
*/ |
|
|
|
i = (*s_etat_processus).position_variable_courante; |
if ((*s_etat_processus).erreur_execution == d_ex) |
presence_variable = d_faux; |
|
|
|
while(i >= 0) |
|
{ |
{ |
if ((strcmp((*s_etat_processus).s_liste_variables[i].nom, |
(*s_etat_processus).erreur_execution = d_ex_absence_observations; |
ds_sdat) == 0) && ((*s_etat_processus) |
|
.s_liste_variables[i].niveau == 1)) |
|
{ |
|
presence_variable = d_vrai; |
|
break; |
|
} |
|
|
|
i--; |
|
} |
} |
|
|
if (presence_variable == d_faux) |
return; |
|
} |
|
else |
|
{ |
|
if (((*(*(*s_etat_processus).pointeur_variable_courante).objet) |
|
.type != MIN) && ((*(*(*s_etat_processus) |
|
.pointeur_variable_courante).objet).type != MRL)) |
{ |
{ |
(*s_etat_processus).erreur_execution = d_ex_absence_observations; |
(*s_etat_processus).erreur_execution = |
|
d_ex_matrice_statistique_invalide; |
return; |
return; |
} |
} |
else |
|
{ |
|
(*s_etat_processus).position_variable_courante = i; |
|
|
|
if ((*s_etat_processus).s_liste_variables[i].objet == NULL) |
|
{ |
|
(*s_etat_processus).erreur_execution = d_ex_variable_partagee; |
|
return; |
|
} |
|
|
|
if (((*((*s_etat_processus).s_liste_variables |
nombre_colonnes = (*((struct_matrice *) (*(*(*s_etat_processus) |
[(*s_etat_processus).position_variable_courante].objet)) |
.pointeur_variable_courante).objet).objet)).nombre_colonnes; |
.type != MIN) && ((*((*s_etat_processus) |
|
.s_liste_variables[(*s_etat_processus) |
|
.position_variable_courante].objet)).type != MRL)) |
|
{ |
|
(*s_etat_processus).erreur_execution = |
|
d_ex_matrice_statistique_invalide; |
|
return; |
|
} |
|
|
|
nombre_colonnes = (*((struct_matrice *) (*((*s_etat_processus) |
|
.s_liste_variables[(*s_etat_processus) |
|
.position_variable_courante].objet)).objet)) |
|
.nombre_colonnes; |
|
} |
|
} |
} |
|
|
s_objet_statistique = ((*s_etat_processus).s_liste_variables |
s_objet_statistique = (*(*s_etat_processus).pointeur_variable_courante) |
[(*s_etat_processus).position_variable_courante]).objet; |
.objet; |
|
|
if (nombre_colonnes == 1) |
if (nombre_colonnes == 1) |
{ |
{ |