Annotation of rpl/src/instructions_m3.c, revision 1.10

1.1       bertrand    1: /*
                      2: ================================================================================
1.10    ! bertrand    3:   RPL/2 (R) version 4.0.18
1.1       bertrand    4:   Copyright (C) 1989-2010 Dr. BERTRAND Joël
                      5: 
                      6:   This file is part of RPL/2.
                      7: 
                      8:   RPL/2 is free software; you can redistribute it and/or modify it
                      9:   under the terms of the CeCILL V2 License as published by the french
                     10:   CEA, CNRS and INRIA.
                     11:  
                     12:   RPL/2 is distributed in the hope that it will be useful, but WITHOUT
                     13:   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
                     14:   FITNESS FOR A PARTICULAR PURPOSE.  See the CeCILL V2 License
                     15:   for more details.
                     16:  
                     17:   You should have received a copy of the CeCILL License
                     18:   along with RPL/2. If not, write to info@cecill.info.
                     19: ================================================================================
                     20: */
                     21: 
                     22: 
                     23: #include "rpl.conv.h"
                     24: 
                     25: 
                     26: /*
                     27: ================================================================================
                     28:   Fonction 'mean'
                     29: ================================================================================
                     30:   Entrées : pointeur sur une structure struct_processus
                     31: --------------------------------------------------------------------------------
                     32:   Sorties :
                     33: --------------------------------------------------------------------------------
                     34:   Effets de bord : néant
                     35: ================================================================================
                     36: */
                     37: 
                     38: void
                     39: instruction_mean(struct_processus *s_etat_processus)
                     40: {
                     41:    logical1                            presence_variable;
                     42: 
                     43:    long                                i;
                     44: 
                     45:    struct_objet                        *s_objet_statistique;
                     46:    struct_objet                        *s_objet_resultat;
                     47:    struct_objet                        *s_objet_temporaire;
                     48: 
                     49:    unsigned long                       nombre_colonnes;
                     50: 
                     51:    (*s_etat_processus).erreur_execution = d_ex;
                     52: 
                     53:    if ((*s_etat_processus).affichage_arguments == 'Y')
                     54:    {
                     55:        printf("\n  MEAN ");
                     56: 
                     57:        if ((*s_etat_processus).langue == 'F')
                     58:        {
                     59:            printf("(moyenne)\n\n");
                     60:        }
                     61:        else
                     62:        {
                     63:            printf("(mean)\n\n");
                     64:        }
                     65: 
                     66:        printf("->  1: %s, %s, %s, %s\n", d_INT, d_REL, d_VIN, d_VRL);
                     67: 
                     68:        return;
                     69:    }
                     70:    else if ((*s_etat_processus).test_instruction == 'Y')
                     71:    {
                     72:        (*s_etat_processus).nombre_arguments = -1;
                     73:        return;
                     74:    }
                     75: 
                     76:    if (test_cfsf(s_etat_processus, 31) == d_vrai)
                     77:    {
                     78:        if (empilement_pile_last(s_etat_processus, 0) == d_erreur)
                     79:        {
                     80:            return;
                     81:        }
                     82:    }
                     83: 
                     84:    /*
                     85:     * Recherche d'une variable globale référencée par SIGMA
                     86:     */
                     87: 
                     88:    if (recherche_variable(s_etat_processus, ds_sdat) == d_faux)
                     89:    {
                     90:        /*
                     91:         * Aucune variable SIGMA
                     92:         */
                     93: 
                     94:        (*s_etat_processus).erreur_systeme = d_es;
                     95:        (*s_etat_processus).erreur_execution = d_ex_absence_observations;
                     96:        return;
                     97:    }
                     98:    else
                     99:    {
                    100:        /*
                    101:         * Il existe une variable locale SIGMA. Reste à vérifier l'existence
                    102:         * d'une variable SIGMA globale...
                    103:         */
                    104: 
                    105:        i = (*s_etat_processus).position_variable_courante;
                    106:        presence_variable = d_faux;
                    107: 
                    108:        while(i >= 0)
                    109:        {
                    110:            if ((strcmp((*s_etat_processus).s_liste_variables[i].nom,
                    111:                    ds_sdat) == 0) && ((*s_etat_processus)
                    112:                    .s_liste_variables[i].niveau == 1))
                    113:            {
                    114:                presence_variable = d_vrai;
                    115:                break;
                    116:            }
                    117: 
                    118:            i--;
                    119:        }
                    120: 
                    121:        if (presence_variable == d_faux)
                    122:        {
                    123:            (*s_etat_processus).erreur_execution = d_ex_absence_observations;
                    124:            return;
                    125:        }
                    126:        else
                    127:        {
                    128:            (*s_etat_processus).position_variable_courante = i;
                    129: 
                    130:            if ((*s_etat_processus).s_liste_variables[i].objet == NULL)
                    131:            {
                    132:                (*s_etat_processus).erreur_execution = d_ex_variable_partagee;
                    133:                return;
                    134:            }
                    135: 
                    136:            if (((*((*s_etat_processus).s_liste_variables
                    137:                    [(*s_etat_processus).position_variable_courante].objet))
                    138:                    .type != MIN) && ((*((*s_etat_processus)
                    139:                    .s_liste_variables[(*s_etat_processus)
                    140:                    .position_variable_courante].objet)).type != MRL))
                    141:            {
                    142:                (*s_etat_processus).erreur_execution =
                    143:                        d_ex_matrice_statistique_invalide;
                    144:                return;
                    145:            }
                    146: 
                    147:            nombre_colonnes = (*((struct_matrice *) (*((*s_etat_processus)
                    148:                    .s_liste_variables[(*s_etat_processus)
                    149:                    .position_variable_courante].objet)).objet))
                    150:                    .nombre_colonnes;
                    151:        }
                    152:    }
                    153: 
                    154:    s_objet_statistique = ((*s_etat_processus).s_liste_variables
                    155:            [(*s_etat_processus).position_variable_courante]).objet;
                    156: 
                    157:    if (((*s_objet_statistique).type == MIN) ||
                    158:            ((*s_objet_statistique).type == MRL))
                    159:    {
                    160:        if ((s_objet_resultat = allocation(s_etat_processus, NON)) == NULL)
                    161:        {
                    162:            (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;
                    163:            return;
                    164:        }
                    165: 
                    166:        if (((*s_objet_resultat).objet = moyenne_statistique((struct_matrice *)
                    167:                (*s_objet_statistique).objet)) == NULL)
                    168:        {
                    169:            (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;
                    170:            return;
                    171:        }
                    172: 
                    173:        if (nombre_colonnes == 1)
                    174:        {
                    175:            if ((*((struct_vecteur *) (*s_objet_resultat).objet)).type == 'I')
                    176:            {
                    177:                (*s_objet_resultat).type = VIN;
                    178:                s_objet_temporaire = s_objet_resultat;
                    179: 
                    180:                if ((s_objet_resultat = allocation(s_etat_processus, INT))
                    181:                        == NULL)
                    182:                {
                    183:                    (*s_etat_processus).erreur_systeme =
                    184:                            d_es_allocation_memoire;
                    185:                    return;
                    186:                }
                    187: 
                    188:                (*((integer8 *) (*s_objet_resultat).objet)) =
                    189:                        ((integer8 *) (*((struct_vecteur *)
                    190:                        (*s_objet_temporaire).objet)).tableau)[0];
                    191: 
                    192:                liberation(s_etat_processus, s_objet_temporaire);
                    193:            }
                    194:            else
                    195:            {
                    196:                (*s_objet_resultat).type = VRL;
                    197:                s_objet_temporaire = s_objet_resultat;
                    198: 
                    199:                if ((s_objet_resultat = allocation(s_etat_processus, REL))
                    200:                        == NULL)
                    201:                {
                    202:                    (*s_etat_processus).erreur_systeme =
                    203:                            d_es_allocation_memoire;
                    204:                    return;
                    205:                }
                    206: 
                    207:                (*((real8 *) (*s_objet_resultat).objet)) =
                    208:                        ((real8 *) (*((struct_vecteur *)
                    209:                        (*s_objet_temporaire).objet)).tableau)[0];
                    210: 
                    211:                liberation(s_etat_processus, s_objet_temporaire);
                    212:            }
                    213:        }
                    214:        else
                    215:        {
                    216:            if ((*((struct_vecteur *) (*s_objet_resultat).objet)).type == 'I')
                    217:            {
                    218:                (*s_objet_resultat).type = VIN;
                    219:            }
                    220:            else
                    221:            {
                    222:                (*s_objet_resultat).type = VRL;
                    223:            }
                    224:        }
                    225: 
                    226:        if (empilement(s_etat_processus, &((*s_etat_processus).l_base_pile),
                    227:                s_objet_resultat) == d_erreur)
                    228:        {
                    229:            return;
                    230:        }
                    231:    }
                    232:    else
                    233:    {
                    234:        (*s_etat_processus).erreur_execution =
                    235:                d_ex_matrice_statistique_invalide;
                    236:        return;
                    237:    }
                    238: 
                    239:    return;
                    240: }
                    241: 
                    242: 
                    243: /*
                    244: ================================================================================
                    245:   Fonction 'mins'
                    246: ================================================================================
                    247:   Entrées : pointeur sur une structure struct_processus
                    248: --------------------------------------------------------------------------------
                    249:   Sorties :
                    250: --------------------------------------------------------------------------------
                    251:   Effets de bord : néant
                    252: ================================================================================
                    253: */
                    254: 
                    255: void
                    256: instruction_mins(struct_processus *s_etat_processus)
                    257: {
                    258:    logical1                            presence_variable;
                    259: 
                    260:    long                                i;
                    261:    long                                j;
                    262: 
                    263:    struct_objet                        *s_objet_statistique;
                    264:    struct_objet                        *s_objet_resultat;
                    265: 
                    266:    unsigned long                       nombre_colonnes;
                    267: 
                    268:    (*s_etat_processus).erreur_execution = d_ex;
                    269: 
                    270:    if ((*s_etat_processus).affichage_arguments == 'Y')
                    271:    {
                    272:        printf("\n  MINS ");
                    273: 
                    274:        if ((*s_etat_processus).langue == 'F')
                    275:        {
                    276:            printf("(minimum de la matrice statistique)\n\n");
                    277:        }
                    278:        else
                    279:        {
                    280:            printf("(statistical matrix minimum)\n\n");
                    281:        }
                    282: 
                    283:        printf("->  1: %s, %s, %s, %s\n", d_INT, d_REL, d_VIN, d_VRL);
                    284: 
                    285:        return;
                    286:    }
                    287:    else if ((*s_etat_processus).test_instruction == 'Y')
                    288:    {
                    289:        (*s_etat_processus).nombre_arguments = -1;
                    290:        return;
                    291:    }
                    292: 
                    293:    if (test_cfsf(s_etat_processus, 31) == d_vrai)
                    294:    {
                    295:        if (empilement_pile_last(s_etat_processus, 0) == d_erreur)
                    296:        {
                    297:            return;
                    298:        }
                    299:    }
                    300: 
                    301:    /*
                    302:     * Recherche d'une variable globale référencée par SIGMA
                    303:     */
                    304: 
                    305:    if (recherche_variable(s_etat_processus, ds_sdat) == d_faux)
                    306:    {
                    307:        /*
                    308:         * Aucune variable SIGMA
                    309:         */
                    310: 
                    311:        (*s_etat_processus).erreur_systeme = d_es;
                    312:        (*s_etat_processus).erreur_execution = d_ex_absence_observations;
                    313:        return;
                    314:    }
                    315:    else
                    316:    {
                    317:        /*
                    318:         * Il existe une variable locale SIGMA. Reste à vérifier l'existence
                    319:         * d'une variable SIGMA globale...
                    320:         */
                    321: 
                    322:        i = (*s_etat_processus).position_variable_courante;
                    323:        presence_variable = d_faux;
                    324: 
                    325:        while(i >= 0)
                    326:        {
                    327:            if ((strcmp((*s_etat_processus).s_liste_variables[i].nom,
                    328:                    ds_sdat) == 0) && ((*s_etat_processus)
                    329:                    .s_liste_variables[i].niveau == 1))
                    330:            {
                    331:                presence_variable = d_vrai;
                    332:                break;
                    333:            }
                    334: 
                    335:            i--;
                    336:        }
                    337: 
                    338:        if (presence_variable == d_faux)
                    339:        {
                    340:            (*s_etat_processus).erreur_execution = d_ex_absence_observations;
                    341:            return;
                    342:        }
                    343:        else
                    344:        {
                    345:            (*s_etat_processus).position_variable_courante = i;
                    346: 
                    347:            if ((*s_etat_processus).s_liste_variables[i].objet == NULL)
                    348:            {
                    349:                (*s_etat_processus).erreur_execution = d_ex_variable_partagee;
                    350:                return;
                    351:            }
                    352: 
                    353:            if (((*((*s_etat_processus).s_liste_variables
                    354:                    [(*s_etat_processus).position_variable_courante].objet))
                    355:                    .type != MIN) && ((*((*s_etat_processus)
                    356:                    .s_liste_variables[(*s_etat_processus)
                    357:                    .position_variable_courante].objet)).type != MRL))
                    358:            {
                    359:                (*s_etat_processus).erreur_execution =
                    360:                        d_ex_matrice_statistique_invalide;
                    361:                return;
                    362:            }
                    363: 
                    364:            nombre_colonnes = (*((struct_matrice *) (*((*s_etat_processus)
                    365:                    .s_liste_variables[(*s_etat_processus)
                    366:                    .position_variable_courante].objet)).objet))
                    367:                    .nombre_colonnes;
                    368:        }
                    369:    }
                    370: 
                    371:    s_objet_statistique = ((*s_etat_processus).s_liste_variables
                    372:            [(*s_etat_processus).position_variable_courante]).objet;
                    373: 
                    374:    if (nombre_colonnes == 1)
                    375:    {
                    376:        if ((*s_objet_statistique).type == MRL)
                    377:        {
                    378:            if ((s_objet_resultat = allocation(s_etat_processus, REL))
                    379:                    == NULL)
                    380:            {
                    381:                (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;
                    382:                return;
                    383:            }
                    384: 
                    385:            (*((real8 *) (*s_objet_resultat).objet)) = ((real8 **)
                    386:                    (*((struct_matrice *) (*s_objet_statistique).objet))
                    387:                    .tableau)[0][0];
                    388: 
                    389:            for(i = 1; i < (long) (*((struct_matrice *) (*s_objet_statistique)
                    390:                    .objet)).nombre_lignes; i++)
                    391:            {
                    392:                if ((*((real8 *) (*s_objet_resultat).objet)) > ((real8 **)
                    393:                        (*((struct_matrice *) (*s_objet_statistique).objet))
                    394:                        .tableau)[i][0])
                    395:                {
                    396:                    (*((real8 *) (*s_objet_resultat).objet)) = ((real8 **)
                    397:                            (*((struct_matrice *) (*s_objet_statistique).objet))
                    398:                            .tableau)[i][0];
                    399:                }
                    400:            }
                    401:        }
                    402:        else
                    403:        {
                    404:            if ((s_objet_resultat = allocation(s_etat_processus, INT))
                    405:                    == NULL)
                    406:            {
                    407:                (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;
                    408:                return;
                    409:            }
                    410: 
                    411:            (*((integer8 *) (*s_objet_resultat).objet)) = ((integer8 **)
                    412:                    (*((struct_matrice *) (*s_objet_statistique).objet))
                    413:                    .tableau)[0][0];
                    414: 
                    415:            for(i = 1; i < (long) (*((struct_matrice *) (*s_objet_statistique)
                    416:                    .objet)).nombre_lignes; i++)
                    417:            {
                    418:                if ((*((integer8 *) (*s_objet_resultat).objet)) > ((integer8 **)
                    419:                        (*((struct_matrice *) (*s_objet_statistique).objet))
                    420:                        .tableau)[i][0])
                    421:                {
                    422:                    (*((integer8 *) (*s_objet_resultat).objet)) = ((integer8 **)
                    423:                            (*((struct_matrice *) (*s_objet_statistique).objet))
                    424:                            .tableau)[i][0];
                    425:                }
                    426:            }
                    427:        }
                    428:    }
                    429:    else
                    430:    {
                    431:        if ((*s_objet_statistique).type == MRL)
                    432:        {
                    433:            if ((s_objet_resultat = allocation(s_etat_processus, VRL))
                    434:                    == NULL)
                    435:            {
                    436:                (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;
                    437:                return;
                    438:            }
                    439: 
                    440:            (*((struct_vecteur *) (*s_objet_resultat).objet)).taille =
                    441:                    nombre_colonnes;
                    442: 
                    443:            if (((*((struct_vecteur *) (*s_objet_resultat).objet)).tableau =
                    444:                    malloc(nombre_colonnes * sizeof(real8))) == NULL)
                    445:            {
                    446:                (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;
                    447:                return;
                    448:            }
                    449: 
                    450:            for(j = 0; j < (long) nombre_colonnes; j++)
                    451:            {
                    452:                ((real8 *) (*((struct_vecteur *) (*s_objet_resultat).objet))
                    453:                        .tableau)[j] = ((real8 **) (*((struct_matrice *)
                    454:                        (*s_objet_statistique).objet)).tableau)[0][j];
                    455: 
                    456:                for(i = 1; i < (long) (*((struct_matrice *)
                    457:                        (*s_objet_statistique).objet)).nombre_lignes; i++)
                    458:                {
                    459:                    if (((real8 *) (*((struct_vecteur *) (*s_objet_resultat)
                    460:                            .objet)).tableau)[j] > ((real8 **)
                    461:                            (*((struct_matrice *) (*s_objet_statistique).objet))
                    462:                            .tableau)[i][j])
                    463:                    {
                    464:                        ((real8 *) (*((struct_vecteur *) (*s_objet_resultat)
                    465:                                .objet)).tableau)[j] = ((real8 **)
                    466:                                (*((struct_matrice *) (*s_objet_statistique)
                    467:                                .objet)).tableau)[i][j];
                    468:                    }
                    469:                }
                    470:            }
                    471:        }
                    472:        else
                    473:        {
                    474:            if ((s_objet_resultat = allocation(s_etat_processus, VIN))
                    475:                    == NULL)
                    476:            {
                    477:                (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;
                    478:                return;
                    479:            }
                    480: 
                    481:            (*((struct_vecteur *) (*s_objet_resultat).objet)).taille =
                    482:                    nombre_colonnes;
                    483: 
                    484:            if (((*((struct_vecteur *) (*s_objet_resultat).objet)).tableau =
                    485:                    malloc(nombre_colonnes * sizeof(integer8))) == NULL)
                    486:            {
                    487:                (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;
                    488:                return;
                    489:            }
                    490: 
                    491:            for(j = 0; j < (long) nombre_colonnes; j++)
                    492:            {
                    493:                ((integer8 *) (*((struct_vecteur *) (*s_objet_resultat).objet))
                    494:                        .tableau)[j] = ((integer8 **) (*((struct_matrice *)
                    495:                        (*s_objet_statistique).objet)).tableau)[0][j];
                    496: 
                    497:                for(i = 1; i < (long) (*((struct_matrice *)
                    498:                        (*s_objet_statistique).objet)).nombre_lignes; i++)
                    499:                {
                    500:                    if (((integer8 *) (*((struct_vecteur *) (*s_objet_resultat)
                    501:                            .objet)).tableau)[j] > ((integer8 **)
                    502:                            (*((struct_matrice *) (*s_objet_statistique).objet))
                    503:                            .tableau)[i][j])
                    504:                    {
                    505:                        ((integer8 *) (*((struct_vecteur *) (*s_objet_resultat)
                    506:                                .objet)).tableau)[j] = ((integer8 **)
                    507:                                (*((struct_matrice *) (*s_objet_statistique)
                    508:                                .objet)).tableau)[i][j];
                    509:                    }
                    510:                }
                    511:            }
                    512:        }
                    513:    }
                    514: 
                    515:    if (empilement(s_etat_processus, &((*s_etat_processus).l_base_pile),
                    516:            s_objet_resultat) == d_erreur)
                    517:    {
                    518:        return;
                    519:    }
                    520: 
                    521:    return;
                    522: }
                    523: 
                    524: 
                    525: /*
                    526: ================================================================================
                    527:   Fonction 'maxs'
                    528: ================================================================================
                    529:   Entrées : pointeur sur une structure struct_processus
                    530: --------------------------------------------------------------------------------
                    531:   Sorties :
                    532: --------------------------------------------------------------------------------
                    533:   Effets de bord : néant
                    534: ================================================================================
                    535: */
                    536: 
                    537: void
                    538: instruction_maxs(struct_processus *s_etat_processus)
                    539: {
                    540:    logical1                            presence_variable;
                    541: 
                    542:    long                                i;
                    543:    long                                j;
                    544: 
                    545:    struct_objet                        *s_objet_statistique;
                    546:    struct_objet                        *s_objet_resultat;
                    547: 
                    548:    unsigned long                       nombre_colonnes;
                    549: 
                    550:    (*s_etat_processus).erreur_execution = d_ex;
                    551: 
                    552:    if ((*s_etat_processus).affichage_arguments == 'Y')
                    553:    {
                    554:        printf("\n  MAXS ");
                    555: 
                    556:        if ((*s_etat_processus).langue == 'F')
                    557:        {
                    558:            printf("(maximum de la matrice statistique)\n\n");
                    559:        }
                    560:        else
                    561:        {
                    562:            printf("(statistical matrix maximum)\n\n");
                    563:        }
                    564: 
                    565:        printf("->  1: %s, %s, %s, %s\n", d_INT, d_REL, d_VIN, d_VRL);
                    566: 
                    567:        return;
                    568:    }
                    569:    else if ((*s_etat_processus).test_instruction == 'Y')
                    570:    {
                    571:        (*s_etat_processus).nombre_arguments = -1;
                    572:        return;
                    573:    }
                    574: 
                    575:    if (test_cfsf(s_etat_processus, 31) == d_vrai)
                    576:    {
                    577:        if (empilement_pile_last(s_etat_processus, 0) == d_erreur)
                    578:        {
                    579:            return;
                    580:        }
                    581:    }
                    582: 
                    583:    /*
                    584:     * Recherche d'une variable globale référencée par SIGMA
                    585:     */
                    586: 
                    587:    if (recherche_variable(s_etat_processus, ds_sdat) == d_faux)
                    588:    {
                    589:        /*
                    590:         * Aucune variable SIGMA
                    591:         */
                    592: 
                    593:        (*s_etat_processus).erreur_systeme = d_es;
                    594:        (*s_etat_processus).erreur_execution = d_ex_absence_observations;
                    595:        return;
                    596:    }
                    597:    else
                    598:    {
                    599:        /*
                    600:         * Il existe une variable locale SIGMA. Reste à vérifier l'existence
                    601:         * d'une variable SIGMA globale...
                    602:         */
                    603: 
                    604:        i = (*s_etat_processus).position_variable_courante;
                    605:        presence_variable = d_faux;
                    606: 
                    607:        while(i >= 0)
                    608:        {
                    609:            if ((strcmp((*s_etat_processus).s_liste_variables[i].nom,
                    610:                    ds_sdat) == 0) && ((*s_etat_processus)
                    611:                    .s_liste_variables[i].niveau == 1))
                    612:            {
                    613:                presence_variable = d_vrai;
                    614:                break;
                    615:            }
                    616: 
                    617:            i--;
                    618:        }
                    619: 
                    620:        if (presence_variable == d_faux)
                    621:        {
                    622:            (*s_etat_processus).erreur_execution = d_ex_absence_observations;
                    623:            return;
                    624:        }
                    625:        else
                    626:        {
                    627:            (*s_etat_processus).position_variable_courante = i;
                    628: 
                    629:            if ((*s_etat_processus).s_liste_variables[i].objet == NULL)
                    630:            {
                    631:                (*s_etat_processus).erreur_execution = d_ex_variable_partagee;
                    632:                return;
                    633:            }
                    634: 
                    635:            if (((*((*s_etat_processus).s_liste_variables
                    636:                    [(*s_etat_processus).position_variable_courante].objet))
                    637:                    .type != MIN) && ((*((*s_etat_processus)
                    638:                    .s_liste_variables[(*s_etat_processus)
                    639:                    .position_variable_courante].objet)).type != MRL))
                    640:            {
                    641:                (*s_etat_processus).erreur_execution =
                    642:                        d_ex_matrice_statistique_invalide;
                    643:                return;
                    644:            }
                    645: 
                    646:            nombre_colonnes = (*((struct_matrice *) (*((*s_etat_processus)
                    647:                    .s_liste_variables[(*s_etat_processus)
                    648:                    .position_variable_courante].objet)).objet))
                    649:                    .nombre_colonnes;
                    650:        }
                    651:    }
                    652: 
                    653:    s_objet_statistique = ((*s_etat_processus).s_liste_variables
                    654:            [(*s_etat_processus).position_variable_courante]).objet;
                    655: 
                    656:    if (nombre_colonnes == 1)
                    657:    {
                    658:        if ((*s_objet_statistique).type == MRL)
                    659:        {
                    660:            if ((s_objet_resultat = allocation(s_etat_processus, REL))
                    661:                    == NULL)
                    662:            {
                    663:                (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;
                    664:                return;
                    665:            }
                    666: 
                    667:            (*((real8 *) (*s_objet_resultat).objet)) = ((real8 **)
                    668:                    (*((struct_matrice *) (*s_objet_statistique).objet))
                    669:                    .tableau)[0][0];
                    670: 
                    671:            for(i = 1; i < (long) (*((struct_matrice *) (*s_objet_statistique)
                    672:                    .objet)).nombre_lignes; i++)
                    673:            {
                    674:                if ((*((real8 *) (*s_objet_resultat).objet)) < ((real8 **)
                    675:                        (*((struct_matrice *) (*s_objet_statistique).objet))
                    676:                        .tableau)[i][0])
                    677:                {
                    678:                    (*((real8 *) (*s_objet_resultat).objet)) = ((real8 **)
                    679:                            (*((struct_matrice *) (*s_objet_statistique).objet))
                    680:                            .tableau)[i][0];
                    681:                }
                    682:            }
                    683:        }
                    684:        else
                    685:        {
                    686:            if ((s_objet_resultat = allocation(s_etat_processus, INT))
                    687:                    == NULL)
                    688:            {
                    689:                (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;
                    690:                return;
                    691:            }
                    692: 
                    693:            (*((integer8 *) (*s_objet_resultat).objet)) = ((integer8 **)
                    694:                    (*((struct_matrice *) (*s_objet_statistique).objet))
                    695:                    .tableau)[0][0];
                    696: 
                    697:            for(i = 1; i < (long) (*((struct_matrice *) (*s_objet_statistique)
                    698:                    .objet)).nombre_lignes; i++)
                    699:            {
                    700:                if ((*((integer8 *) (*s_objet_resultat).objet)) < ((integer8 **)
                    701:                        (*((struct_matrice *) (*s_objet_statistique).objet))
                    702:                        .tableau)[i][0])
                    703:                {
                    704:                    (*((integer8 *) (*s_objet_resultat).objet)) = ((integer8 **)
                    705:                            (*((struct_matrice *) (*s_objet_statistique).objet))
                    706:                            .tableau)[i][0];
                    707:                }
                    708:            }
                    709:        }
                    710:    }
                    711:    else
                    712:    {
                    713:        if ((*s_objet_statistique).type == MRL)
                    714:        {
                    715:            if ((s_objet_resultat = allocation(s_etat_processus, VRL))
                    716:                    == NULL)
                    717:            {
                    718:                (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;
                    719:                return;
                    720:            }
                    721: 
                    722:            (*((struct_vecteur *) (*s_objet_resultat).objet)).taille =
                    723:                    nombre_colonnes;
                    724: 
                    725:            if (((*((struct_vecteur *) (*s_objet_resultat).objet)).tableau =
                    726:                    malloc(nombre_colonnes * sizeof(real8))) == NULL)
                    727:            {
                    728:                (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;
                    729:                return;
                    730:            }
                    731: 
                    732:            for(j = 0; j < (long) nombre_colonnes; j++)
                    733:            {
                    734:                ((real8 *) (*((struct_vecteur *) (*s_objet_resultat).objet))
                    735:                        .tableau)[j] = ((real8 **) (*((struct_matrice *)
                    736:                        (*s_objet_statistique).objet)).tableau)[0][j];
                    737: 
                    738:                for(i = 1; i < (long) (*((struct_matrice *)
                    739:                        (*s_objet_statistique).objet)).nombre_lignes; i++)
                    740:                {
                    741:                    if (((real8 *) (*((struct_vecteur *) (*s_objet_resultat)
                    742:                            .objet)).tableau)[j] < ((real8 **)
                    743:                            (*((struct_matrice *) (*s_objet_statistique).objet))
                    744:                            .tableau)[i][j])
                    745:                    {
                    746:                        ((real8 *) (*((struct_vecteur *) (*s_objet_resultat)
                    747:                                .objet)).tableau)[j] = ((real8 **)
                    748:                                (*((struct_matrice *) (*s_objet_statistique)
                    749:                                .objet)).tableau)[i][j];
                    750:                    }
                    751:                }
                    752:            }
                    753:        }
                    754:        else
                    755:        {
                    756:            if ((s_objet_resultat = allocation(s_etat_processus, VIN))
                    757:                    == NULL)
                    758:            {
                    759:                (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;
                    760:                return;
                    761:            }
                    762: 
                    763:            (*((struct_vecteur *) (*s_objet_resultat).objet)).taille =
                    764:                    nombre_colonnes;
                    765: 
                    766:            if (((*((struct_vecteur *) (*s_objet_resultat).objet)).tableau =
                    767:                    malloc(nombre_colonnes * sizeof(integer8))) == NULL)
                    768:            {
                    769:                (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;
                    770:                return;
                    771:            }
                    772: 
                    773:            for(j = 0; j < (long) nombre_colonnes; j++)
                    774:            {
                    775:                ((integer8 *) (*((struct_vecteur *) (*s_objet_resultat).objet))
                    776:                        .tableau)[j] = ((integer8 **) (*((struct_matrice *)
                    777:                        (*s_objet_statistique).objet)).tableau)[0][j];
                    778: 
                    779:                for(i = 1; i < (long) (*((struct_matrice *)
                    780:                        (*s_objet_statistique).objet)).nombre_lignes; i++)
                    781:                {
                    782:                    if (((integer8 *) (*((struct_vecteur *) (*s_objet_resultat)
                    783:                            .objet)).tableau)[j] < ((integer8 **)
                    784:                            (*((struct_matrice *) (*s_objet_statistique).objet))
                    785:                            .tableau)[i][j])
                    786:                    {
                    787:                        ((integer8 *) (*((struct_vecteur *) (*s_objet_resultat)
                    788:                                .objet)).tableau)[j] = ((integer8 **)
                    789:                                (*((struct_matrice *) (*s_objet_statistique)
                    790:                                .objet)).tableau)[i][j];
                    791:                    }
                    792:                }
                    793:            }
                    794:        }
                    795:    }
                    796: 
                    797:    if (empilement(s_etat_processus, &((*s_etat_processus).l_base_pile),
                    798:            s_objet_resultat) == d_erreur)
                    799:    {
                    800:        return;
                    801:    }
                    802: 
                    803:    return;
                    804: }
                    805: 
                    806: // vim: ts=4

CVSweb interface <joel.bertrand@systella.fr>