Diff for /rpl/src/algebre_lineaire2.c between versions 1.41 and 1.42

version 1.41, 2013/02/27 17:11:39 version 1.42, 2013/03/20 17:11:42
Line 51  factorisation_lu(struct_processus *s_eta Line 51  factorisation_lu(struct_processus *s_eta
     integer4                    nombre_lignes_a;      integer4                    nombre_lignes_a;
     integer4                    *pivot;      integer4                    *pivot;
   
     long                        n;      integer8                    i;
       integer8                    j;
     unsigned long               i;      integer8                    k;
     unsigned long               j;      integer8                    n;
     unsigned long               k;      integer8                    taille_matrice_f77;
     unsigned long               taille_matrice_f77;  
   
     void                        *matrice_f77;      void                        *matrice_f77;
     void                        *tampon;      void                        *tampon;
Line 71  factorisation_lu(struct_processus *s_eta Line 70  factorisation_lu(struct_processus *s_eta
     {      {
         case 'I' :          case 'I' :
         {          {
             if ((matrice_f77 = (void *) malloc(taille_matrice_f77 *              if ((matrice_f77 = malloc(((size_t) taille_matrice_f77) *
                     sizeof(real8))) == NULL)                      sizeof(real8))) == NULL)
             {              {
                 (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;                  (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;
Line 82  factorisation_lu(struct_processus *s_eta Line 81  factorisation_lu(struct_processus *s_eta
             {              {
                 for(j = 0; j < (*s_matrice).nombre_lignes; j++)                  for(j = 0; j < (*s_matrice).nombre_lignes; j++)
                 {                  {
                     ((real8 *) matrice_f77)[k++] = ((integer8 **)                      ((real8 *) matrice_f77)[k++] = (real8) ((integer8 **)
                             (*s_matrice).tableau)[j][i];                              (*s_matrice).tableau)[j][i];
                 }                  }
             }              }
Line 94  factorisation_lu(struct_processus *s_eta Line 93  factorisation_lu(struct_processus *s_eta
   
             free((integer8 **) (*s_matrice).tableau);              free((integer8 **) (*s_matrice).tableau);
   
             if (((*s_matrice).tableau = (void **) malloc((*s_matrice)              if (((*s_matrice).tableau = malloc(((size_t) (*s_matrice)
                     .nombre_lignes * sizeof(real8 *))) == NULL)                      .nombre_lignes) * sizeof(real8 *))) == NULL)
             {              {
                 (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;                  (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;
                 return;                  return;
Line 104  factorisation_lu(struct_processus *s_eta Line 103  factorisation_lu(struct_processus *s_eta
             for(i = 0; i < (*s_matrice).nombre_lignes; i++)              for(i = 0; i < (*s_matrice).nombre_lignes; i++)
             {              {
                 if ((((*s_matrice).tableau)[i] =                  if ((((*s_matrice).tableau)[i] =
                         (real8 *) malloc((*s_matrice)                          (real8 *) malloc(((size_t) (*s_matrice)
                         .nombre_colonnes * sizeof(real8))) == NULL)                          .nombre_colonnes) * sizeof(real8))) == NULL)
                 {                  {
                     (*s_etat_processus).erreur_systeme =                      (*s_etat_processus).erreur_systeme =
                             d_es_allocation_memoire;                              d_es_allocation_memoire;
Line 115  factorisation_lu(struct_processus *s_eta Line 114  factorisation_lu(struct_processus *s_eta
   
             (*s_matrice).type = 'R';              (*s_matrice).type = 'R';
   
             if ((pivot = (integer4 *) malloc(dimension_vecteur_pivot *              if ((pivot = (integer4 *) malloc(((size_t) dimension_vecteur_pivot)
                     sizeof(integer4))) == NULL)                      * sizeof(integer4))) == NULL)
             {              {
                 (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;                  (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;
                 return;                  return;
Line 150  factorisation_lu(struct_processus *s_eta Line 149  factorisation_lu(struct_processus *s_eta
             (**s_permutation).nombre_lignes = dimension_vecteur_pivot;              (**s_permutation).nombre_lignes = dimension_vecteur_pivot;
             (**s_permutation).nombre_colonnes = dimension_vecteur_pivot;              (**s_permutation).nombre_colonnes = dimension_vecteur_pivot;
   
             if (((**s_permutation).tableau = malloc((**s_permutation)              if (((**s_permutation).tableau = malloc(((size_t) (**s_permutation)
                     .nombre_lignes * sizeof(integer8 *))) == NULL)                      .nombre_lignes) * sizeof(integer8 *))) == NULL)
             {              {
                 (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;                  (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;
                 return;                  return;
Line 160  factorisation_lu(struct_processus *s_eta Line 159  factorisation_lu(struct_processus *s_eta
             for(i = 0; i < (**s_permutation).nombre_lignes; i++)              for(i = 0; i < (**s_permutation).nombre_lignes; i++)
             {              {
                 if ((((integer8 **) (**s_permutation).tableau)[i] =                  if ((((integer8 **) (**s_permutation).tableau)[i] =
                         (integer8 *) malloc((**s_permutation).nombre_colonnes *                          (integer8 *) malloc(((size_t) (**s_permutation)
                         sizeof(integer8))) == NULL)                          .nombre_colonnes) * sizeof(integer8))) == NULL)
                 {                  {
                     (*s_etat_processus).erreur_systeme =                      (*s_etat_processus).erreur_systeme =
                             d_es_allocation_memoire;                              d_es_allocation_memoire;
Line 195  factorisation_lu(struct_processus *s_eta Line 194  factorisation_lu(struct_processus *s_eta
   
         case 'R' :          case 'R' :
         {          {
             if ((matrice_f77 = (void *) malloc(taille_matrice_f77 *              if ((matrice_f77 = malloc(((size_t) taille_matrice_f77) *
                     sizeof(real8))) == NULL)                      sizeof(real8))) == NULL)
             {              {
                 (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;                  (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;
Line 211  factorisation_lu(struct_processus *s_eta Line 210  factorisation_lu(struct_processus *s_eta
                 }                  }
             }              }
   
             if ((pivot = (integer4 *) malloc(dimension_vecteur_pivot *              if ((pivot = (integer4 *) malloc(((size_t) dimension_vecteur_pivot)
                     sizeof(integer4))) == NULL)                      * sizeof(integer4))) == NULL)
             {              {
                 (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;                  (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;
                 return;                  return;
Line 246  factorisation_lu(struct_processus *s_eta Line 245  factorisation_lu(struct_processus *s_eta
             (**s_permutation).nombre_lignes = dimension_vecteur_pivot;              (**s_permutation).nombre_lignes = dimension_vecteur_pivot;
             (**s_permutation).nombre_colonnes = dimension_vecteur_pivot;              (**s_permutation).nombre_colonnes = dimension_vecteur_pivot;
   
             if (((**s_permutation).tableau = malloc((**s_permutation)              if (((**s_permutation).tableau = malloc(((size_t) (**s_permutation)
                     .nombre_lignes * sizeof(integer8 *))) == NULL)                      .nombre_lignes) * sizeof(integer8 *))) == NULL)
             {              {
                 (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;                  (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;
                 return;                  return;
Line 256  factorisation_lu(struct_processus *s_eta Line 255  factorisation_lu(struct_processus *s_eta
             for(i = 0; i < (**s_permutation).nombre_lignes; i++)              for(i = 0; i < (**s_permutation).nombre_lignes; i++)
             {              {
                 if ((((integer8 **) (**s_permutation).tableau)[i] =                  if ((((integer8 **) (**s_permutation).tableau)[i] =
                         (integer8 *) malloc((**s_permutation).nombre_colonnes *                          (integer8 *) malloc(((size_t) (**s_permutation)
                         sizeof(integer8))) == NULL)                          .nombre_colonnes) * sizeof(integer8))) == NULL)
                 {                  {
                     (*s_etat_processus).erreur_systeme =                      (*s_etat_processus).erreur_systeme =
                             d_es_allocation_memoire;                              d_es_allocation_memoire;
Line 291  factorisation_lu(struct_processus *s_eta Line 290  factorisation_lu(struct_processus *s_eta
   
         case 'C' :          case 'C' :
         {          {
             if ((matrice_f77 = (void *) malloc(taille_matrice_f77 *              if ((matrice_f77 = malloc(((size_t) taille_matrice_f77) *
                     sizeof(complex16))) == NULL)                      sizeof(complex16))) == NULL)
             {              {
                 (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;                  (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;
Line 307  factorisation_lu(struct_processus *s_eta Line 306  factorisation_lu(struct_processus *s_eta
                 }                  }
             }              }
   
             if ((pivot = (integer4 *) malloc(dimension_vecteur_pivot *              if ((pivot = (integer4 *) malloc(((size_t) dimension_vecteur_pivot)
                     sizeof(integer4))) == NULL)                      * sizeof(integer4))) == NULL)
             {              {
                 (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;                  (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;
                 return;                  return;
Line 341  factorisation_lu(struct_processus *s_eta Line 340  factorisation_lu(struct_processus *s_eta
             (**s_permutation).nombre_lignes = dimension_vecteur_pivot;              (**s_permutation).nombre_lignes = dimension_vecteur_pivot;
             (**s_permutation).nombre_colonnes = dimension_vecteur_pivot;              (**s_permutation).nombre_colonnes = dimension_vecteur_pivot;
   
             if (((**s_permutation).tableau = malloc((**s_permutation)              if (((**s_permutation).tableau = malloc(((size_t) (**s_permutation)
                     .nombre_lignes * sizeof(integer8 *))) == NULL)                      .nombre_lignes) * sizeof(integer8 *))) == NULL)
             {              {
                 (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;                  (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;
                 return;                  return;
Line 351  factorisation_lu(struct_processus *s_eta Line 350  factorisation_lu(struct_processus *s_eta
             for(i = 0; i < (**s_permutation).nombre_lignes; i++)              for(i = 0; i < (**s_permutation).nombre_lignes; i++)
             {              {
                 if ((((integer8 **) (**s_permutation).tableau)[i] =                  if ((((integer8 **) (**s_permutation).tableau)[i] =
                         (integer8 *) malloc((**s_permutation).nombre_colonnes *                          (integer8 *) malloc(((size_t) (**s_permutation)
                         sizeof(integer8))) == NULL)                          .nombre_colonnes) * sizeof(integer8))) == NULL)
                 {                  {
                     (*s_etat_processus).erreur_systeme =                      (*s_etat_processus).erreur_systeme =
                             d_es_allocation_memoire;                              d_es_allocation_memoire;
Line 413  factorisation_cholesky(struct_processus Line 412  factorisation_cholesky(struct_processus
     integer4                    nombre_colonnes_a;      integer4                    nombre_colonnes_a;
     integer4                    nombre_lignes_a;      integer4                    nombre_lignes_a;
   
     unsigned long               taille_matrice_f77;      integer8                    taille_matrice_f77;
   
     void                        *matrice_f77;      void                        *matrice_f77;
   
Line 436  factorisation_cholesky(struct_processus Line 435  factorisation_cholesky(struct_processus
              * Allocation du vecteur représentant la matrice triangulaire               * Allocation du vecteur représentant la matrice triangulaire
              */               */
   
             if ((matrice_f77 = (void *) malloc(taille_matrice_f77 *              if ((matrice_f77 = malloc(((size_t) taille_matrice_f77) *
                     sizeof(real8))) == NULL)                      sizeof(real8))) == NULL)
             {              {
                 (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;                  (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;
Line 495  factorisation_cholesky(struct_processus Line 494  factorisation_cholesky(struct_processus
   
             free((integer8 **) (*s_matrice).tableau);              free((integer8 **) (*s_matrice).tableau);
   
             if (((*s_matrice).tableau = (void **) malloc((*s_matrice)              if (((*s_matrice).tableau = malloc(((size_t) (*s_matrice)
                     .nombre_lignes * sizeof(real8 *))) == NULL)                      .nombre_lignes) * sizeof(real8 *))) == NULL)
             {              {
                 (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;                  (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;
                 return;                  return;
Line 505  factorisation_cholesky(struct_processus Line 504  factorisation_cholesky(struct_processus
             for(i = 0; i < (integer4) (*s_matrice).nombre_lignes; i++)              for(i = 0; i < (integer4) (*s_matrice).nombre_lignes; i++)
             {              {
                 if ((((*s_matrice).tableau)[i] =                  if ((((*s_matrice).tableau)[i] =
                         (real8 *) malloc((*s_matrice)                          (real8 *) malloc(((size_t) (*s_matrice)
                         .nombre_colonnes * sizeof(real8))) == NULL)                          .nombre_colonnes) * sizeof(real8))) == NULL)
                 {                  {
                     (*s_etat_processus).erreur_systeme =                      (*s_etat_processus).erreur_systeme =
                             d_es_allocation_memoire;                              d_es_allocation_memoire;
Line 567  factorisation_cholesky(struct_processus Line 566  factorisation_cholesky(struct_processus
              * Allocation du vecteur représentant la matrice triangulaire               * Allocation du vecteur représentant la matrice triangulaire
              */               */
   
             if ((matrice_f77 = (void *) malloc(taille_matrice_f77 *              if ((matrice_f77 = malloc(((size_t) taille_matrice_f77) *
                     sizeof(real8))) == NULL)                      sizeof(real8))) == NULL)
             {              {
                 (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;                  (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;
Line 668  factorisation_cholesky(struct_processus Line 667  factorisation_cholesky(struct_processus
              * Allocation du vecteur représentant la matrice triangulaire               * Allocation du vecteur représentant la matrice triangulaire
              */               */
   
             if ((matrice_f77 = (void *) malloc(taille_matrice_f77 *              if ((matrice_f77 = malloc(((size_t) taille_matrice_f77) *
                     sizeof(complex16))) == NULL)                      sizeof(complex16))) == NULL)
             {              {
                 (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;                  (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;

Removed from v.1.41  
changed lines
  Added in v.1.42


CVSweb interface <joel.bertrand@systella.fr>