version 1.26, 2011/06/27 09:04:53
|
version 1.49, 2014/04/25 07:37:27
|
Line 1
|
Line 1
|
/* |
/* |
================================================================================ |
================================================================================ |
RPL/2 (R) version 4.1.0 |
RPL/2 (R) version 4.1.18 |
Copyright (C) 1989-2011 Dr. BERTRAND Joël |
Copyright (C) 1989-2014 Dr. BERTRAND Joël |
|
|
This file is part of RPL/2. |
This file is part of RPL/2. |
|
|
Line 59 factorisation_schur(struct_processus *s_
|
Line 59 factorisation_schur(struct_processus *s_
|
unsigned char calcul_vecteurs_schur; |
unsigned char calcul_vecteurs_schur; |
unsigned char tri_vecteurs_schur; |
unsigned char tri_vecteurs_schur; |
|
|
unsigned long i; |
integer8 i; |
unsigned long j; |
integer8 j; |
unsigned long k; |
integer8 k; |
unsigned long taille_matrice_f77; |
integer8 taille_matrice_f77; |
|
|
void *matrice_a_f77; |
void *matrice_a_f77; |
void *matrice_vs_f77; |
void *matrice_vs_f77; |
Line 82 factorisation_schur(struct_processus *s_
|
Line 82 factorisation_schur(struct_processus *s_
|
{ |
{ |
/* Conversion de la matrice en matrice réelle */ |
/* Conversion de la matrice en matrice réelle */ |
|
|
for(i = 0; i < (unsigned long) nombre_lignes_a; i++) |
for(i = 0; i < nombre_lignes_a; i++) |
{ |
{ |
tampon = (*s_matrice).tableau[i]; |
tampon = (*s_matrice).tableau[i]; |
|
|
if ((((real8 **) (*s_matrice).tableau)[i] = (real8 *) |
if ((((real8 **) (*s_matrice).tableau)[i] = (real8 *) |
malloc(nombre_colonnes_a * sizeof(real8))) == NULL) |
malloc(((size_t) nombre_colonnes_a) * sizeof(real8))) |
|
== NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = |
(*s_etat_processus).erreur_systeme = |
d_es_allocation_memoire; |
d_es_allocation_memoire; |
return; |
return; |
} |
} |
|
|
for(j = 0; j < (unsigned long) nombre_colonnes_a; j++) |
for(j = 0; j < nombre_colonnes_a; j++) |
{ |
{ |
((real8 **) (*s_matrice).tableau)[i][j] = |
((real8 **) (*s_matrice).tableau)[i][j] = (real8) |
((integer8 *) tampon)[j]; |
((integer8 *) tampon)[j]; |
} |
} |
|
|
Line 108 factorisation_schur(struct_processus *s_
|
Line 109 factorisation_schur(struct_processus *s_
|
|
|
case 'R' : |
case 'R' : |
{ |
{ |
if ((matrice_a_f77 = (void *) malloc(taille_matrice_f77 * |
if ((matrice_a_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; |
return; |
return; |
} |
} |
|
|
if ((matrice_vs_f77 = (void *) malloc(taille_matrice_f77 * |
if ((matrice_vs_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 131 factorisation_schur(struct_processus *s_
|
Line 132 factorisation_schur(struct_processus *s_
|
} |
} |
} |
} |
|
|
if ((wr = (real8 *) malloc(nombre_lignes_a * sizeof(real8))) |
if ((wr = (real8 *) malloc(((size_t) nombre_lignes_a) * |
== NULL) |
sizeof(real8))) == NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return; |
return; |
} |
} |
|
|
if ((wi = (real8 *) malloc(nombre_lignes_a * sizeof(real8))) |
if ((wi = (real8 *) malloc(((size_t) nombre_lignes_a) * |
== NULL) |
sizeof(real8))) == NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return; |
return; |
Line 159 factorisation_schur(struct_processus *s_
|
Line 160 factorisation_schur(struct_processus *s_
|
matrice_vs_f77, &nombre_colonnes_a, |
matrice_vs_f77, &nombre_colonnes_a, |
work, &lwork, NULL, &info, 1, 1); |
work, &lwork, NULL, &info, 1, 1); |
|
|
lwork = ((real8 *) work)[0]; |
lwork = (integer4) ((real8 *) work)[0]; |
free(work); |
free(work); |
|
|
if ((work = (real8 *) malloc(lwork * sizeof(real8))) == NULL) |
if ((work = (real8 *) malloc(((size_t) lwork) * sizeof(real8))) |
|
== NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return; |
return; |
Line 208 factorisation_schur(struct_processus *s_
|
Line 210 factorisation_schur(struct_processus *s_
|
(**s_schur).nombre_lignes = (*s_matrice).nombre_lignes; |
(**s_schur).nombre_lignes = (*s_matrice).nombre_lignes; |
(**s_schur).type = 'R'; |
(**s_schur).type = 'R'; |
|
|
if (((**s_schur).tableau = malloc((**s_schur) |
if (((**s_schur).tableau = malloc(((size_t) (**s_schur) |
.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 218 factorisation_schur(struct_processus *s_
|
Line 220 factorisation_schur(struct_processus *s_
|
for(i = 0; i < (**s_schur).nombre_lignes; i++) |
for(i = 0; i < (**s_schur).nombre_lignes; i++) |
{ |
{ |
if ((((real8 **) (**s_schur).tableau)[i] = (real8 *) |
if ((((real8 **) (**s_schur).tableau)[i] = (real8 *) |
malloc((**s_schur).nombre_colonnes * |
malloc(((size_t) (**s_schur).nombre_colonnes) * |
sizeof(real8))) == NULL) |
sizeof(real8))) == NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = |
(*s_etat_processus).erreur_systeme = |
Line 244 factorisation_schur(struct_processus *s_
|
Line 246 factorisation_schur(struct_processus *s_
|
|
|
case 'C' : |
case 'C' : |
{ |
{ |
if ((matrice_a_f77 = (void *) malloc(taille_matrice_f77 * |
if ((matrice_a_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; |
return; |
return; |
} |
} |
|
|
if ((matrice_vs_f77 = (void *) malloc(taille_matrice_f77 * |
if ((matrice_vs_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 271 factorisation_schur(struct_processus *s_
|
Line 273 factorisation_schur(struct_processus *s_
|
} |
} |
} |
} |
|
|
if ((w = (complex16 *) malloc(nombre_lignes_a * sizeof(complex16))) |
if ((w = (complex16 *) malloc(((size_t) nombre_lignes_a) * |
== NULL) |
sizeof(complex16))) == NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return; |
return; |
Line 286 factorisation_schur(struct_processus *s_
|
Line 288 factorisation_schur(struct_processus *s_
|
return; |
return; |
} |
} |
|
|
if ((rwork = (real8 *) malloc(nombre_lignes_a * sizeof(real8))) |
if ((rwork = (real8 *) malloc(((size_t) nombre_lignes_a) * |
== NULL) |
sizeof(real8))) == NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return; |
return; |
Line 299 factorisation_schur(struct_processus *s_
|
Line 301 factorisation_schur(struct_processus *s_
|
matrice_vs_f77, &nombre_colonnes_a, |
matrice_vs_f77, &nombre_colonnes_a, |
work, &lwork, rwork, NULL, &info, 1, 1); |
work, &lwork, rwork, NULL, &info, 1, 1); |
|
|
lwork = ((complex16 *) work)[0].partie_reelle; |
lwork = (integer4) ((complex16 *) work)[0].partie_reelle; |
free(work); |
free(work); |
|
|
if ((work = (complex16 *) malloc(lwork * sizeof(complex16))) |
if ((work = (complex16 *) malloc(((size_t) lwork) * |
== NULL) |
sizeof(complex16))) == NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return; |
return; |
Line 353 factorisation_schur(struct_processus *s_
|
Line 355 factorisation_schur(struct_processus *s_
|
(**s_schur).nombre_lignes = (*s_matrice).nombre_lignes; |
(**s_schur).nombre_lignes = (*s_matrice).nombre_lignes; |
(**s_schur).type = 'C'; |
(**s_schur).type = 'C'; |
|
|
if (((**s_schur).tableau = malloc((**s_schur) |
if (((**s_schur).tableau = malloc(((size_t) (**s_schur) |
.nombre_lignes * sizeof(complex16 *))) == NULL) |
.nombre_lignes) * sizeof(complex16 *))) == NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return; |
return; |
Line 363 factorisation_schur(struct_processus *s_
|
Line 365 factorisation_schur(struct_processus *s_
|
for(i = 0; i < (**s_schur).nombre_lignes; i++) |
for(i = 0; i < (**s_schur).nombre_lignes; i++) |
{ |
{ |
if ((((complex16 **) (**s_schur).tableau)[i] = (complex16 *) |
if ((((complex16 **) (**s_schur).tableau)[i] = (complex16 *) |
malloc((**s_schur).nombre_colonnes * |
malloc(((size_t) (**s_schur).nombre_colonnes) * |
sizeof(complex16))) == NULL) |
sizeof(complex16))) == NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = |
(*s_etat_processus).erreur_systeme = |
Line 416 factorisation_lq(struct_processus *s_eta
|
Line 418 factorisation_lq(struct_processus *s_eta
|
integer4 nombre_lignes_a; |
integer4 nombre_lignes_a; |
integer4 erreur; |
integer4 erreur; |
|
|
unsigned long i; |
integer8 i; |
unsigned long j; |
integer8 j; |
unsigned long k; |
integer8 k; |
unsigned long taille_matrice_f77; |
integer8 taille_matrice_f77; |
|
|
void *matrice_a_f77; |
void *matrice_a_f77; |
void *tampon; |
void *tampon; |
Line 435 factorisation_lq(struct_processus *s_eta
|
Line 437 factorisation_lq(struct_processus *s_eta
|
{ |
{ |
/* Conversion de la matrice en matrice réelle */ |
/* Conversion de la matrice en matrice réelle */ |
|
|
for(i = 0; i < (unsigned long) nombre_lignes_a; i++) |
for(i = 0; i < nombre_lignes_a; i++) |
{ |
{ |
tampon = (*s_matrice).tableau[i]; |
tampon = (*s_matrice).tableau[i]; |
|
|
if ((((real8 **) (*s_matrice).tableau)[i] = (real8 *) |
if ((((real8 **) (*s_matrice).tableau)[i] = (real8 *) |
malloc(nombre_colonnes_a * sizeof(real8))) == NULL) |
malloc(((size_t) nombre_colonnes_a) * sizeof(real8))) |
|
== NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = |
(*s_etat_processus).erreur_systeme = |
d_es_allocation_memoire; |
d_es_allocation_memoire; |
return; |
return; |
} |
} |
|
|
for(j = 0; j < (unsigned long) nombre_colonnes_a; j++) |
for(j = 0; j < nombre_colonnes_a; j++) |
{ |
{ |
((real8 **) (*s_matrice).tableau)[i][j] = |
((real8 **) (*s_matrice).tableau)[i][j] = (real8) |
((integer8 *) tampon)[j]; |
((integer8 *) tampon)[j]; |
} |
} |
|
|
Line 461 factorisation_lq(struct_processus *s_eta
|
Line 464 factorisation_lq(struct_processus *s_eta
|
|
|
case 'R' : |
case 'R' : |
{ |
{ |
if ((matrice_a_f77 = (void *) malloc(taille_matrice_f77 * |
if ((matrice_a_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; |
return; |
return; |
} |
} |
|
|
if (((*tau) = malloc(((nombre_colonnes_a < nombre_lignes_a) |
if (((*tau) = malloc(((size_t) ((nombre_colonnes_a < |
? nombre_colonnes_a : nombre_lignes_a) * sizeof(real8))) |
nombre_lignes_a) ? nombre_colonnes_a : nombre_lignes_a)) * |
== NULL) |
sizeof(real8))) == NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return; |
return; |
} |
} |
|
|
if ((work = malloc(nombre_lignes_a * sizeof(real8))) == NULL) |
if ((work = malloc(((size_t) nombre_lignes_a) * 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_lq(struct_processus *s_eta
|
Line 509 factorisation_lq(struct_processus *s_eta
|
return; |
return; |
} |
} |
|
|
for(k = 0, i = 0; i < (unsigned long) nombre_colonnes_a; i++) |
for(k = 0, i = 0; i < nombre_colonnes_a; i++) |
{ |
{ |
for(j = 0; j < (unsigned long) nombre_lignes_a; j++) |
for(j = 0; j < nombre_lignes_a; j++) |
{ |
{ |
((real8 **) (*s_matrice).tableau)[j][i] = ((real8 *) |
((real8 **) (*s_matrice).tableau)[j][i] = ((real8 *) |
matrice_a_f77)[k++]; |
matrice_a_f77)[k++]; |
Line 522 factorisation_lq(struct_processus *s_eta
|
Line 526 factorisation_lq(struct_processus *s_eta
|
|
|
case 'C' : |
case 'C' : |
{ |
{ |
if ((matrice_a_f77 = (void *) malloc(taille_matrice_f77 * |
if ((matrice_a_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; |
return; |
return; |
} |
} |
|
|
if (((*tau) = malloc(((nombre_colonnes_a < nombre_lignes_a) |
if (((*tau) = malloc(((size_t) ((nombre_colonnes_a < |
? nombre_colonnes_a : nombre_lignes_a) * |
nombre_lignes_a) ? nombre_colonnes_a : nombre_lignes_a)) * |
sizeof(complex16))) == NULL) |
sizeof(complex16))) == NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return; |
return; |
} |
} |
|
|
if ((work = malloc(nombre_lignes_a * sizeof(complex16))) == NULL) |
if ((work = malloc(((size_t) nombre_lignes_a) * sizeof(complex16))) |
|
== NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return; |
return; |
Line 570 factorisation_lq(struct_processus *s_eta
|
Line 575 factorisation_lq(struct_processus *s_eta
|
return; |
return; |
} |
} |
|
|
for(k = 0, i = 0; i < (unsigned long) nombre_colonnes_a; i++) |
for(k = 0, i = 0; i < nombre_colonnes_a; i++) |
{ |
{ |
for(j = 0; j < (unsigned long) nombre_lignes_a; j++) |
for(j = 0; j < nombre_lignes_a; j++) |
{ |
{ |
((complex16 **) (*s_matrice).tableau)[j][i].partie_reelle = |
((complex16 **) (*s_matrice).tableau)[j][i].partie_reelle = |
((complex16 *) matrice_a_f77)[k].partie_reelle; |
((complex16 *) matrice_a_f77)[k].partie_reelle; |
Line 618 factorisation_qr(struct_processus *s_eta
|
Line 623 factorisation_qr(struct_processus *s_eta
|
|
|
real8 *rwork; |
real8 *rwork; |
|
|
unsigned long i; |
integer8 i; |
unsigned long j; |
integer8 j; |
unsigned long k; |
integer8 k; |
unsigned long taille_matrice_f77; |
integer8 taille_matrice_f77; |
|
|
void *matrice_a_f77; |
void *matrice_a_f77; |
void *registre; |
void *registre; |
Line 638 factorisation_qr(struct_processus *s_eta
|
Line 643 factorisation_qr(struct_processus *s_eta
|
{ |
{ |
/* Conversion de la matrice en matrice réelle */ |
/* Conversion de la matrice en matrice réelle */ |
|
|
for(i = 0; i < (unsigned long) nombre_lignes_a; i++) |
for(i = 0; i < nombre_lignes_a; i++) |
{ |
{ |
tampon = (*s_matrice).tableau[i]; |
tampon = (*s_matrice).tableau[i]; |
|
|
if ((((real8 **) (*s_matrice).tableau)[i] = (real8 *) |
if ((((real8 **) (*s_matrice).tableau)[i] = (real8 *) |
malloc(nombre_colonnes_a * sizeof(real8))) == NULL) |
malloc(((size_t) nombre_colonnes_a) * sizeof(real8))) |
|
== NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = |
(*s_etat_processus).erreur_systeme = |
d_es_allocation_memoire; |
d_es_allocation_memoire; |
return; |
return; |
} |
} |
|
|
for(j = 0; j < (unsigned long) nombre_colonnes_a; j++) |
for(j = 0; j < nombre_colonnes_a; j++) |
{ |
{ |
((real8 **) (*s_matrice).tableau)[i][j] = |
((real8 **) (*s_matrice).tableau)[i][j] = (real8) |
((integer8 *) tampon)[j]; |
((integer8 *) tampon)[j]; |
} |
} |
|
|
Line 664 factorisation_qr(struct_processus *s_eta
|
Line 670 factorisation_qr(struct_processus *s_eta
|
|
|
case 'R' : |
case 'R' : |
{ |
{ |
if ((matrice_a_f77 = (void *) malloc(taille_matrice_f77 * |
if ((matrice_a_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; |
return; |
return; |
} |
} |
|
|
if (((*tau) = malloc(((nombre_colonnes_a < nombre_lignes_a) |
if (((*tau) = malloc(((size_t) ((nombre_colonnes_a < |
? nombre_colonnes_a : nombre_lignes_a) * sizeof(real8))) |
nombre_lignes_a) ? nombre_colonnes_a : nombre_lignes_a)) * |
== NULL) |
sizeof(real8))) == NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return; |
return; |
Line 688 factorisation_qr(struct_processus *s_eta
|
Line 694 factorisation_qr(struct_processus *s_eta
|
} |
} |
} |
} |
|
|
if ((pivot = malloc(nombre_colonnes_a * sizeof(integer4))) == NULL) |
if ((pivot = malloc(((size_t) nombre_colonnes_a) * |
|
sizeof(integer4))) == NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return; |
return; |
} |
} |
|
|
for(i = 0; i < (unsigned long) nombre_colonnes_a; pivot[i++] = 0); |
for(i = 0; i < nombre_colonnes_a; pivot[i++] = 0); |
|
|
lwork = -1; |
lwork = -1; |
|
|
Line 710 factorisation_qr(struct_processus *s_eta
|
Line 717 factorisation_qr(struct_processus *s_eta
|
&nombre_lignes_a, pivot, (*((real8 **) tau)), |
&nombre_lignes_a, pivot, (*((real8 **) tau)), |
work, &lwork, &erreur); |
work, &lwork, &erreur); |
|
|
lwork = ((real8 *) work)[0]; |
lwork = (integer4) ((real8 *) work)[0]; |
|
|
free(work); |
free(work); |
|
|
if ((work = malloc(lwork * sizeof(real8))) == NULL) |
if ((work = malloc(((size_t) lwork) * sizeof(real8))) == NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return; |
return; |
Line 722 factorisation_qr(struct_processus *s_eta
|
Line 729 factorisation_qr(struct_processus *s_eta
|
|
|
// Calcul de la permutation |
// Calcul de la permutation |
|
|
if ((registre = (void *) malloc(taille_matrice_f77 * |
if ((registre = 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; |
return; |
return; |
} |
} |
|
|
memcpy(registre, matrice_a_f77, taille_matrice_f77 * sizeof(real8)); |
memcpy(registre, matrice_a_f77, ((size_t) taille_matrice_f77) * |
|
sizeof(real8)); |
|
|
dgeqp3_(&nombre_lignes_a, &nombre_colonnes_a, registre, |
dgeqp3_(&nombre_lignes_a, &nombre_colonnes_a, registre, |
&nombre_lignes_a, pivot, (*((real8 **) tau)), |
&nombre_lignes_a, pivot, (*((real8 **) tau)), |
Line 767 factorisation_qr(struct_processus *s_eta
|
Line 775 factorisation_qr(struct_processus *s_eta
|
return; |
return; |
} |
} |
|
|
for(i = 0; i < (unsigned long) nombre_colonnes_a; i++) |
for(i = 0; i < nombre_colonnes_a; i++) |
{ |
{ |
if ((i + 1) != (unsigned long) pivot[i]) |
if ((i + 1) != pivot[i]) |
{ |
{ |
(*s_etat_processus).erreur_execution = |
(*s_etat_processus).erreur_execution = |
d_ex_routines_mathematiques; |
d_ex_routines_mathematiques; |
Line 785 factorisation_qr(struct_processus *s_eta
|
Line 793 factorisation_qr(struct_processus *s_eta
|
|
|
free(pivot); |
free(pivot); |
|
|
for(k = 0, i = 0; i < (unsigned long) nombre_colonnes_a; i++) |
for(k = 0, i = 0; i < nombre_colonnes_a; i++) |
{ |
{ |
for(j = 0; j < (unsigned long) nombre_lignes_a; j++) |
for(j = 0; j < nombre_lignes_a; j++) |
{ |
{ |
((real8 **) (*s_matrice).tableau)[j][i] = ((real8 *) |
((real8 **) (*s_matrice).tableau)[j][i] = ((real8 *) |
matrice_a_f77)[k++]; |
matrice_a_f77)[k++]; |
Line 802 factorisation_qr(struct_processus *s_eta
|
Line 810 factorisation_qr(struct_processus *s_eta
|
|
|
case 'C' : |
case 'C' : |
{ |
{ |
if ((matrice_a_f77 = (void *) malloc(taille_matrice_f77 * |
if ((matrice_a_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; |
return; |
return; |
} |
} |
|
|
if (((*tau) = malloc(((nombre_colonnes_a < nombre_lignes_a) |
if (((*tau) = malloc(((size_t) ((nombre_colonnes_a < |
? nombre_colonnes_a : nombre_lignes_a) * sizeof(complex16))) |
nombre_lignes_a) ? nombre_colonnes_a : nombre_lignes_a)) * |
== NULL) |
sizeof(complex16))) == NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return; |
return; |
Line 830 factorisation_qr(struct_processus *s_eta
|
Line 838 factorisation_qr(struct_processus *s_eta
|
} |
} |
} |
} |
|
|
if ((pivot = malloc(nombre_colonnes_a * sizeof(integer4))) == NULL) |
if ((pivot = malloc(((size_t) nombre_colonnes_a) * |
|
sizeof(integer4))) == NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return; |
return; |
} |
} |
|
|
if ((rwork = malloc(2 * nombre_colonnes_a * sizeof(real8))) == NULL) |
if ((rwork = malloc(2 * ((size_t) nombre_colonnes_a) * |
|
sizeof(real8))) == NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return; |
return; |
} |
} |
|
|
for(i = 0; i < (unsigned long) nombre_colonnes_a; pivot[i++] = 0); |
for(i = 0; i < nombre_colonnes_a; pivot[i++] = 0); |
|
|
lwork = -1; |
lwork = -1; |
|
|
Line 873 factorisation_qr(struct_processus *s_eta
|
Line 883 factorisation_qr(struct_processus *s_eta
|
return; |
return; |
} |
} |
|
|
lwork = ((complex16 *) work)[0].partie_reelle; |
lwork = (integer4) ((complex16 *) work)[0].partie_reelle; |
|
|
free(work); |
free(work); |
|
|
if ((work = malloc(lwork * sizeof(complex16))) == NULL) |
if ((work = malloc(((size_t) lwork) * sizeof(complex16))) == NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return; |
return; |
Line 885 factorisation_qr(struct_processus *s_eta
|
Line 895 factorisation_qr(struct_processus *s_eta
|
|
|
// Calcul de la permutation |
// Calcul de la permutation |
|
|
if ((registre = (void *) malloc(taille_matrice_f77 * |
if ((registre = 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 893 factorisation_qr(struct_processus *s_eta
|
Line 903 factorisation_qr(struct_processus *s_eta
|
} |
} |
|
|
memcpy(registre, matrice_a_f77, |
memcpy(registre, matrice_a_f77, |
taille_matrice_f77 * sizeof(complex16)); |
((size_t) taille_matrice_f77) * sizeof(complex16)); |
|
|
zgeqp3_(&nombre_lignes_a, &nombre_colonnes_a, registre, |
zgeqp3_(&nombre_lignes_a, &nombre_colonnes_a, registre, |
&nombre_lignes_a, pivot, (*((complex16 **) tau)), |
&nombre_lignes_a, pivot, (*((complex16 **) tau)), |
Line 939 factorisation_qr(struct_processus *s_eta
|
Line 949 factorisation_qr(struct_processus *s_eta
|
|
|
free(rwork); |
free(rwork); |
|
|
for(i = 0; i < (unsigned long) nombre_colonnes_a; i++) |
for(i = 0; i < nombre_colonnes_a; i++) |
{ |
{ |
if ((i + 1) != (unsigned long) pivot[i]) |
if ((i + 1) != pivot[i]) |
{ |
{ |
(*s_etat_processus).erreur_execution = |
(*s_etat_processus).erreur_execution = |
d_ex_routines_mathematiques; |
d_ex_routines_mathematiques; |
Line 957 factorisation_qr(struct_processus *s_eta
|
Line 967 factorisation_qr(struct_processus *s_eta
|
|
|
free(pivot); |
free(pivot); |
|
|
for(k = 0, i = 0; i < (unsigned long) nombre_colonnes_a; i++) |
for(k = 0, i = 0; i < nombre_colonnes_a; i++) |
{ |
{ |
for(j = 0; j < (unsigned long) nombre_lignes_a; j++) |
for(j = 0; j < nombre_lignes_a; j++) |
{ |
{ |
((complex16 **) (*s_matrice).tableau)[j][i].partie_reelle = |
((complex16 **) (*s_matrice).tableau)[j][i].partie_reelle = |
((complex16 *) matrice_a_f77)[k].partie_reelle; |
((complex16 *) matrice_a_f77)[k].partie_reelle; |
Line 1014 calcul_rang(struct_processus *s_etat_pro
|
Line 1024 calcul_rang(struct_processus *s_etat_pro
|
|
|
unsigned char norme; |
unsigned char norme; |
|
|
unsigned long i; |
integer8 i; |
|
|
void *matrice_b; |
void *matrice_b; |
void *matrice_c; |
void *matrice_c; |
Line 1024 calcul_rang(struct_processus *s_etat_pro
|
Line 1034 calcul_rang(struct_processus *s_etat_pro
|
#ifdef NORME_I |
#ifdef NORME_I |
norme = 'I'; |
norme = 'I'; |
|
|
if ((work = malloc(nombre_lignes_a * sizeof(real8))) == NULL) |
if ((work = malloc(((size_t) nombre_lignes_a) * sizeof(real8))) == NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return(-1); |
return(-1); |
Line 1045 calcul_rang(struct_processus *s_etat_pro
|
Line 1055 calcul_rang(struct_processus *s_etat_pro
|
free(work); |
free(work); |
#endif |
#endif |
|
|
if ((matrice_c = malloc(nombre_lignes_a * nombre_colonnes_a * |
if ((matrice_c = malloc(((size_t) (nombre_lignes_a * nombre_colonnes_a)) |
sizeof(real8))) == NULL) |
* sizeof(real8))) == NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return(-1); |
return(-1); |
} |
} |
|
|
memcpy(matrice_c, matrice_f77, nombre_lignes_a * nombre_colonnes_a * |
memcpy(matrice_c, matrice_f77, ((size_t) (nombre_lignes_a * |
sizeof(real8)); |
nombre_colonnes_a)) * sizeof(real8)); |
|
|
dgetrf_(&nombre_lignes_a, &nombre_colonnes_a, matrice_f77, |
dgetrf_(&nombre_lignes_a, &nombre_colonnes_a, matrice_f77, |
&nombre_lignes_a, pivot, &erreur); |
&nombre_lignes_a, pivot, &erreur); |
Line 1067 calcul_rang(struct_processus *s_etat_pro
|
Line 1077 calcul_rang(struct_processus *s_etat_pro
|
return(-1); |
return(-1); |
} |
} |
|
|
if ((iwork = malloc(nombre_colonnes_a * sizeof(integer4))) == NULL) |
if ((iwork = malloc(((size_t) nombre_colonnes_a) * sizeof(integer4))) |
|
== NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return(-1); |
return(-1); |
} |
} |
|
|
if ((work = malloc(4 * nombre_colonnes_a * sizeof(real8))) == NULL) |
if ((work = malloc(4 * ((size_t) nombre_colonnes_a) * sizeof(real8))) |
|
== NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return(-1); |
return(-1); |
Line 1098 calcul_rang(struct_processus *s_etat_pro
|
Line 1110 calcul_rang(struct_processus *s_etat_pro
|
return(-1); |
return(-1); |
} |
} |
|
|
if ((jpvt = malloc(nombre_colonnes_a * sizeof(integer4))) == NULL) |
if ((jpvt = malloc(((size_t) nombre_colonnes_a) * sizeof(integer4))) |
|
== NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return(-1); |
return(-1); |
} |
} |
|
|
for(i = 0; i < (unsigned long) nombre_colonnes_a; i++) |
for(i = 0; i < nombre_colonnes_a; i++) |
{ |
{ |
((integer4 *) jpvt)[i] = 0; |
((integer4 *) jpvt)[i] = 0; |
} |
} |
Line 1121 calcul_rang(struct_processus *s_etat_pro
|
Line 1134 calcul_rang(struct_processus *s_etat_pro
|
nombre_lignes_b = (nombre_lignes_a > nombre_colonnes_a) |
nombre_lignes_b = (nombre_lignes_a > nombre_colonnes_a) |
? nombre_lignes_a : nombre_colonnes_a; |
? nombre_lignes_a : nombre_colonnes_a; |
|
|
if ((matrice_b = malloc(nombre_lignes_b * sizeof(real8))) == NULL) |
if ((matrice_b = malloc(((size_t) nombre_lignes_b) * sizeof(real8))) |
|
== NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return(-1); |
return(-1); |
} |
} |
|
|
for(i = 0; i < (unsigned long) nombre_lignes_b; i++) |
for(i = 0; i < nombre_lignes_b; i++) |
{ |
{ |
((real8 *) matrice_b)[i] = 0; |
((real8 *) matrice_b)[i] = 0; |
} |
} |
Line 1137 calcul_rang(struct_processus *s_etat_pro
|
Line 1151 calcul_rang(struct_processus *s_etat_pro
|
matrice_b, &nombre_lignes_b, jpvt, &rcond, &rang, |
matrice_b, &nombre_lignes_b, jpvt, &rcond, &rang, |
work, &lwork, &erreur); |
work, &lwork, &erreur); |
|
|
lwork = ((real8 *) work)[0]; |
lwork = (integer4) ((real8 *) work)[0]; |
free(work); |
free(work); |
|
|
if ((work = malloc(lwork * sizeof(real8))) == NULL) |
if ((work = malloc(((size_t) lwork) * sizeof(real8))) == NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return(-1); |
return(-1); |
Line 1174 calcul_rang(struct_processus *s_etat_pro
|
Line 1188 calcul_rang(struct_processus *s_etat_pro
|
free(work); |
free(work); |
#endif |
#endif |
|
|
if ((matrice_c = malloc(nombre_lignes_a * nombre_colonnes_a * |
if ((matrice_c = malloc(((size_t) (nombre_lignes_a * nombre_colonnes_a)) |
sizeof(complex16))) == NULL) |
* sizeof(complex16))) == NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return(-1); |
return(-1); |
} |
} |
|
|
memcpy(matrice_c, matrice_f77, nombre_lignes_a * nombre_colonnes_a * |
memcpy(matrice_c, matrice_f77, ((size_t) (nombre_lignes_a * |
sizeof(complex16)); |
nombre_colonnes_a)) * sizeof(complex16)); |
|
|
zgetrf_(&nombre_lignes_a, &nombre_colonnes_a, matrice_f77, |
zgetrf_(&nombre_lignes_a, &nombre_colonnes_a, matrice_f77, |
&nombre_lignes_a, pivot, &erreur); |
&nombre_lignes_a, pivot, &erreur); |
Line 1196 calcul_rang(struct_processus *s_etat_pro
|
Line 1210 calcul_rang(struct_processus *s_etat_pro
|
return(-1); |
return(-1); |
} |
} |
|
|
if ((rwork = malloc(2 * nombre_colonnes_a * sizeof(real8))) == NULL) |
if ((rwork = malloc(2 * ((size_t) nombre_colonnes_a) * sizeof(real8))) |
|
== NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return(-1); |
return(-1); |
} |
} |
|
|
if ((work = malloc(2 * nombre_colonnes_a * sizeof(complex16))) == NULL) |
if ((work = malloc(2 * ((size_t) nombre_colonnes_a) * |
|
sizeof(complex16))) == NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return(-1); |
return(-1); |
Line 1226 calcul_rang(struct_processus *s_etat_pro
|
Line 1242 calcul_rang(struct_processus *s_etat_pro
|
return(-1); |
return(-1); |
} |
} |
|
|
if ((jpvt = malloc(nombre_colonnes_a * sizeof(integer4))) == NULL) |
if ((jpvt = malloc(((size_t) nombre_colonnes_a) * sizeof(integer4))) |
|
== NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return(-1); |
return(-1); |
} |
} |
|
|
for(i = 0; i < (unsigned long) nombre_colonnes_a; i++) |
for(i = 0; i < nombre_colonnes_a; i++) |
{ |
{ |
((integer4 *) jpvt)[i] = 0; |
((integer4 *) jpvt)[i] = 0; |
} |
} |
Line 1249 calcul_rang(struct_processus *s_etat_pro
|
Line 1266 calcul_rang(struct_processus *s_etat_pro
|
nombre_lignes_b = (nombre_lignes_a > nombre_colonnes_a) |
nombre_lignes_b = (nombre_lignes_a > nombre_colonnes_a) |
? nombre_lignes_a : nombre_colonnes_a; |
? nombre_lignes_a : nombre_colonnes_a; |
|
|
if ((matrice_b = malloc(nombre_lignes_b * sizeof(complex16))) == NULL) |
if ((matrice_b = malloc(((size_t) nombre_lignes_b) * |
|
sizeof(complex16))) == NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return(-1); |
return(-1); |
} |
} |
|
|
for(i = 0; i < (unsigned long) nombre_lignes_b; i++) |
for(i = 0; i < nombre_lignes_b; i++) |
{ |
{ |
((complex16 *) matrice_b)[i].partie_reelle = 0; |
((complex16 *) matrice_b)[i].partie_reelle = 0; |
((complex16 *) matrice_b)[i].partie_imaginaire = 0; |
((complex16 *) matrice_b)[i].partie_imaginaire = 0; |
Line 1266 calcul_rang(struct_processus *s_etat_pro
|
Line 1284 calcul_rang(struct_processus *s_etat_pro
|
matrice_b, &nombre_lignes_b, jpvt, &rcond, &rang, |
matrice_b, &nombre_lignes_b, jpvt, &rcond, &rang, |
work, &lwork, rwork, &erreur); |
work, &lwork, rwork, &erreur); |
|
|
lwork = ((complex16 *) work)[0].partie_reelle; |
lwork = (integer4) ((complex16 *) work)[0].partie_reelle; |
free(work); |
free(work); |
|
|
if ((work = malloc(lwork * sizeof(complex16))) == NULL) |
if ((work = malloc(((size_t) lwork) * sizeof(complex16))) == NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return(-1); |
return(-1); |
Line 1312 determinant(struct_processus *s_etat_pro
|
Line 1330 determinant(struct_processus *s_etat_pro
|
integer4 *pivot; |
integer4 *pivot; |
integer4 rang; |
integer4 rang; |
|
|
|
integer8 i; |
|
integer8 j; |
|
integer8 k; |
integer8 signe; |
integer8 signe; |
|
integer8 taille_matrice_f77; |
|
|
real8 *vecteur_reel; |
real8 *vecteur_reel; |
|
|
unsigned long i; |
|
unsigned long j; |
|
unsigned long k; |
|
unsigned long taille_matrice_f77; |
|
|
|
void *matrice_f77; |
void *matrice_f77; |
|
|
nombre_lignes_a = (integer4) (*s_matrice).nombre_lignes; |
nombre_lignes_a = (integer4) (*s_matrice).nombre_lignes; |
Line 1333 determinant(struct_processus *s_etat_pro
|
Line 1350 determinant(struct_processus *s_etat_pro
|
{ |
{ |
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 1344 determinant(struct_processus *s_etat_pro
|
Line 1361 determinant(struct_processus *s_etat_pro
|
{ |
{ |
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]; |
} |
} |
} |
} |
|
|
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 1369 determinant(struct_processus *s_etat_pro
|
Line 1386 determinant(struct_processus *s_etat_pro
|
} |
} |
else |
else |
{ |
{ |
if ((vecteur_reel = malloc((*s_matrice).nombre_colonnes * |
if ((vecteur_reel = malloc(((size_t) ((*s_matrice) |
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 1381 determinant(struct_processus *s_etat_pro
|
Line 1398 determinant(struct_processus *s_etat_pro
|
|
|
for(i = 0; i < (*s_matrice).nombre_colonnes; i++) |
for(i = 0; i < (*s_matrice).nombre_colonnes; i++) |
{ |
{ |
if ((unsigned long) pivot[i] != (i + 1)) |
if (pivot[i] != (i + 1)) |
{ |
{ |
signe = (signe == 1) ? -1 : 1; |
signe = (signe == 1) ? -1 : 1; |
} |
} |
Line 1395 determinant(struct_processus *s_etat_pro
|
Line 1412 determinant(struct_processus *s_etat_pro
|
vecteur_reel[0] *= vecteur_reel[i]; |
vecteur_reel[0] *= vecteur_reel[i]; |
} |
} |
|
|
(*((real8 *) valeur)) = vecteur_reel[0] * signe; |
(*((real8 *) valeur)) = vecteur_reel[0] * ((real8) signe); |
|
|
free(vecteur_reel); |
free(vecteur_reel); |
} |
} |
|
|
Line 1408 determinant(struct_processus *s_etat_pro
|
Line 1424 determinant(struct_processus *s_etat_pro
|
|
|
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 1424 determinant(struct_processus *s_etat_pro
|
Line 1440 determinant(struct_processus *s_etat_pro
|
} |
} |
} |
} |
|
|
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 1444 determinant(struct_processus *s_etat_pro
|
Line 1460 determinant(struct_processus *s_etat_pro
|
} |
} |
else |
else |
{ |
{ |
if ((vecteur_reel = malloc((*s_matrice).nombre_colonnes * |
if ((vecteur_reel = malloc(((size_t) (*s_matrice) |
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 1456 determinant(struct_processus *s_etat_pro
|
Line 1472 determinant(struct_processus *s_etat_pro
|
|
|
for(i = 0; i < (*s_matrice).nombre_colonnes; i++) |
for(i = 0; i < (*s_matrice).nombre_colonnes; i++) |
{ |
{ |
if ((unsigned long) pivot[i] != (i + 1)) |
if (pivot[i] != (i + 1)) |
{ |
{ |
signe = (signe == 1) ? -1 : 1; |
signe = (signe == 1) ? -1 : 1; |
} |
} |
Line 1470 determinant(struct_processus *s_etat_pro
|
Line 1486 determinant(struct_processus *s_etat_pro
|
vecteur_reel[0] *= vecteur_reel[i]; |
vecteur_reel[0] *= vecteur_reel[i]; |
} |
} |
|
|
(*((real8 *) valeur)) = vecteur_reel[0] * signe; |
(*((real8 *) valeur)) = vecteur_reel[0] * ((real8) signe); |
|
|
free(vecteur_reel); |
free(vecteur_reel); |
} |
} |
Line 1483 determinant(struct_processus *s_etat_pro
|
Line 1499 determinant(struct_processus *s_etat_pro
|
|
|
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 1499 determinant(struct_processus *s_etat_pro
|
Line 1515 determinant(struct_processus *s_etat_pro
|
} |
} |
} |
} |
|
|
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 1520 determinant(struct_processus *s_etat_pro
|
Line 1536 determinant(struct_processus *s_etat_pro
|
} |
} |
else |
else |
{ |
{ |
if ((vecteur_complexe = malloc((*s_matrice).nombre_colonnes * |
if ((vecteur_complexe = malloc(((size_t) (*s_matrice) |
sizeof(complex16))) == NULL) |
.nombre_colonnes) * sizeof(complex16))) == NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = |
(*s_etat_processus).erreur_systeme = |
d_es_allocation_memoire; |
d_es_allocation_memoire; |
Line 1532 determinant(struct_processus *s_etat_pro
|
Line 1548 determinant(struct_processus *s_etat_pro
|
|
|
for(i = 0; i < (*s_matrice).nombre_colonnes; i++) |
for(i = 0; i < (*s_matrice).nombre_colonnes; i++) |
{ |
{ |
if ((unsigned long) pivot[i] != (i + 1)) |
if (pivot[i] != (i + 1)) |
{ |
{ |
signe = (signe == 1) ? -1 : 1; |
signe = (signe == 1) ? -1 : 1; |
} |
} |
Line 1575 rang(struct_processus *s_etat_processus,
|
Line 1591 rang(struct_processus *s_etat_processus,
|
integer4 rang; |
integer4 rang; |
integer4 taille_matrice_f77; |
integer4 taille_matrice_f77; |
|
|
unsigned long i; |
integer8 i; |
unsigned long j; |
integer8 j; |
unsigned long k; |
integer8 k; |
|
|
void *matrice_f77; |
void *matrice_f77; |
|
|
Line 1587 rang(struct_processus *s_etat_processus,
|
Line 1603 rang(struct_processus *s_etat_processus,
|
? nombre_lignes_a : nombre_colonnes_a; |
? nombre_lignes_a : nombre_colonnes_a; |
taille_matrice_f77 = nombre_lignes_a * nombre_colonnes_a; |
taille_matrice_f77 = nombre_lignes_a * nombre_colonnes_a; |
|
|
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; |
Line 1598 rang(struct_processus *s_etat_processus,
|
Line 1614 rang(struct_processus *s_etat_processus,
|
{ |
{ |
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 1609 rang(struct_processus *s_etat_processus,
|
Line 1625 rang(struct_processus *s_etat_processus,
|
{ |
{ |
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 1630 rang(struct_processus *s_etat_processus,
|
Line 1646 rang(struct_processus *s_etat_processus,
|
|
|
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 1662 rang(struct_processus *s_etat_processus,
|
Line 1678 rang(struct_processus *s_etat_processus,
|
|
|
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; |