L'algorithme du pivot total de gauss en delphi

etoilefilante21 Messages postés 1 Date d'inscription samedi 28 mars 2009 Statut Membre Dernière intervention 28 mars 2009 - 28 mars 2009 à 15:30
zayetchik Messages postés 2 Date d'inscription jeudi 6 décembre 2007 Statut Membre Dernière intervention 11 avril 2009 - 11 avril 2009 à 00:25
aidez moi svp.j'ai un probleme avec mon algorithme je sais pas ou sa cloche mais les resultat sont faux.voila mon algorithme.bein je suis debutante donc je connais pas grand chose .de plus la note compte bcp.svp svp.merci d'avance
var n,i,t,c,j,h,f,m,o,k:integer;
    max:real;
    V,W,Z,Y:array[1..100] of STRING;


begin
n:=strtoint(edit1.text);


//initialisation de U
for i:=1 to n do
 begin
  for j:=1 to n do
    U.Cells[i,j]:=A.Cells[i,j];
 end;
//initialisation de L,P,Q
for i:=1 to n do
 begin
  for j:=1 to n do
   begin
    if i<>j then
    begin
                 L.Cells[i,j]:='0';
                 P.Cells[i,j]:='0';
                 Q.Cells[i,j]:='0';
                 L.cells[i,j]:='0';
                 P.cells[i,j]:='0';
                 Q.cells[i,j]:='0';
    end
            else
            begin
                 P.Cells[i,j]:='1';
                 Q.Cells[i,j]:='1';
                 L.Cells[i,j]:='1';
                 L.cells[i,j]:='1';
                 P.Cells[i,j]:='1';
                 Q.Cells[i,j]:='1';
            end;


   end;


 


  end;
//recherche du maximum
m:=1;
while m<n do
 begin
 max:=abs(strtofloat(U.cells[m,m]));
 i:=m;t:=m;c:=m;
 for k:=m to n do
 begin
 v[k]:=U.Cells[k,m];
 end;
 while i<=n do
  begin


 j:=m;
  while j<=n do
   begin if abs(strtofloat(U.cells[j,i]))>max then


         begin
              max:=strtofloat(U.cells[j,i]);
              t:=i;c:=j;
         end;
       j:=j+1;
   end;
       i:=i+1;
 end;
 for h:=m to n do
  begin


   U.cells[h,m]:=U.cells[h,t];
   U.cells[h,t]:=V[h];
   Z[h]:=P.cells[h,m];


   P.cells[h,m]:=P.cells[h,t];
   P.cells[h,t]:=Z[h];
   W[h]:=U.cells[m,h];




   end;
   for f:=m to n do
   begin


   U.cells[m,f]:=U.cells[c,f];
   U.cells[c,f]:=W[f];
   Y[f]:=Q.cells[m,f];
   Q.cells[m,f]:=Q.cells[c,f];
   Q.cells[c,f]:=Y[f];
   end;
   //ELIMINATION DE GAUSS


     o:=m+1;
   while o<=n do
   begin




   L.cells[m,o]:=floattostr(strtofloat(U.cells[m,o])/(strtofloat(U.cells[m,m])));
     k:=m;
    while k<=n do
   begin
   U.cells[k,o]:=floattostr(strtofloat(U.cells[k,o])-(((strtofloat(U.cells[m,o]))/(strtofloat(U.cells[m,m])))*(strtofloat(U.cells[k,m]))));


   k:=k+1;
   end;




   o:=o+1;
   end;


 




  m:=m+1;
  end;


     
  end;

3 réponses

JulioDelphi Messages postés 2226 Date d'inscription dimanche 5 octobre 2003 Statut Membre Dernière intervention 18 novembre 2010 14
30 mars 2009 à 09:30
"Bonjour" ?
0
RechercheO Messages postés 1 Date d'inscription jeudi 2 avril 2009 Statut Membre Dernière intervention 2 avril 2009
2 avril 2009 à 16:06
salam 3likom khti tu est algerienne g vu ton profil moi aussi je suis algerienne SVP khti je voulais savoir si vous avez la réponse de votre question sur l'algorithme de pivot total.merci. 
0
zayetchik Messages postés 2 Date d'inscription jeudi 6 décembre 2007 Statut Membre Dernière intervention 11 avril 2009
11 avril 2009 à 00:25
Va faire tn TP toute seule, et essaye du moins c'est pas ce qui vous est demandé ce qu'elle a fait la demoiselle. Elle passé par une decompo à première vue mais bn si tu veux t'engager sur cette voie.
@etoile filante, bon courage, j'ai pas trop le temps de voir ce que tu as fait, j'espère que ça ira..
0
Rejoignez-nous