version 1.37, 2012/10/01 11:05:10
|
version 1.73, 2024/01/17 16:57:18
|
Line 1
|
Line 1
|
/* |
/* |
================================================================================ |
================================================================================ |
RPL/2 (R) version 4.1.11 |
RPL/2 (R) version 4.1.36 |
Copyright (C) 1989-2012 Dr. BERTRAND Joël |
Copyright (C) 1989-2024 Dr. BERTRAND Joël |
|
|
This file is part of RPL/2. |
This file is part of RPL/2. |
|
|
Line 37
|
Line 37
|
*/ |
*/ |
|
|
void |
void |
tri_vecteur(real8 *vecteur, unsigned long taille) |
tri_vecteur(real8 *vecteur, integer8 taille) |
{ |
{ |
logical1 terminaison_boucle_1; |
logical1 terminaison_boucle_1; |
logical1 terminaison_boucle_2; |
logical1 terminaison_boucle_2; |
Line 45 tri_vecteur(real8 *vecteur, unsigned lon
|
Line 45 tri_vecteur(real8 *vecteur, unsigned lon
|
|
|
real8 registre; |
real8 registre; |
|
|
signed long indice_i; |
integer8 ecartement; |
signed long indice_j; |
integer8 indice_i; |
signed long indice_k; |
integer8 indice_j; |
signed long indice_l; |
integer8 indice_k; |
|
integer8 indice_l; |
unsigned long ecartement; |
|
|
|
ecartement = taille; |
ecartement = taille; |
terminaison_boucle_1 = d_faux; |
terminaison_boucle_1 = d_faux; |
Line 76 tri_vecteur(real8 *vecteur, unsigned lon
|
Line 75 tri_vecteur(real8 *vecteur, unsigned lon
|
|
|
if ((indice_i > 0) && (indice_l > 0)) |
if ((indice_i > 0) && (indice_l > 0)) |
{ |
{ |
if (fabs(vecteur[indice_i - 1]) > |
if (abs(vecteur[indice_i - 1]) > |
fabs(vecteur[indice_l - 1])) |
abs(vecteur[indice_l - 1])) |
{ |
{ |
registre = vecteur[indice_i - 1]; |
registre = vecteur[indice_i - 1]; |
vecteur[indice_i - 1] = vecteur[indice_l - 1]; |
vecteur[indice_i - 1] = vecteur[indice_l - 1]; |
Line 131 tri_vecteur(real8 *vecteur, unsigned lon
|
Line 130 tri_vecteur(real8 *vecteur, unsigned lon
|
*/ |
*/ |
|
|
real8 |
real8 |
sommation_vecteur_reel(real8 *vecteur, unsigned long *taille, |
sommation_vecteur_reel(real8 *vecteur, integer8 *taille, |
logical1 *erreur_memoire) |
logical1 *erreur_memoire) |
{ |
{ |
#if 0 |
#if 0 |
Line 161 sommation_vecteur_reel(real8 *vecteur, u
|
Line 160 sommation_vecteur_reel(real8 *vecteur, u
|
real8 registre; |
real8 registre; |
real8 tampon; |
real8 tampon; |
|
|
unsigned long i; |
integer8 i; |
|
|
somme = 0; |
somme = 0; |
erreur = 0; |
erreur = 0; |
Line 195 sommation_vecteur_reel(real8 *vecteur, u
|
Line 194 sommation_vecteur_reel(real8 *vecteur, u
|
*/ |
*/ |
|
|
complex16 |
complex16 |
sommation_vecteur_complexe(complex16 *vecteur, unsigned long *taille, |
sommation_vecteur_complexe(complex16 *vecteur, integer8 *taille, |
logical1 *erreur_memoire) |
logical1 *erreur_memoire) |
{ |
{ |
complex16 cumul; |
complex16 cumul; |
|
|
real8 *tampon; |
real8 *tampon; |
|
|
unsigned long i; |
integer8 i; |
unsigned long nombre_elements; |
integer8 nombre_elements; |
|
|
if ((tampon = malloc((*taille) * sizeof(real8))) == NULL) |
if ((tampon = sys_malloc(((size_t) (*taille)) * sizeof(real8))) == NULL) |
{ |
{ |
(*erreur_memoire) = d_vrai; |
(*erreur_memoire) = d_vrai; |
|
|
Line 237 sommation_vecteur_complexe(complex16 *ve
|
Line 236 sommation_vecteur_complexe(complex16 *ve
|
cumul.partie_imaginaire = sommation_vecteur_reel(tampon, taille, |
cumul.partie_imaginaire = sommation_vecteur_reel(tampon, taille, |
erreur_memoire); |
erreur_memoire); |
|
|
free(tampon); |
sys_free(tampon); |
|
|
return(cumul); |
return(cumul); |
} |
} |