Documente online.
Zona de administrare documente. Fisierele tale
Am uitat parola x Creaza cont nou
 HomeExploreaza
upload
Upload




Proiect la Algebra Liniara

Informatica


Proiect la Algebra Liniara



Student:Radu Niculae Ion grupa M522

Profesor:Gabriela Tanase 23523t1920x

#include<iostream.h>
#include<stdlib.h>
#include<math.h>
void main()

for(i=1;i<=n;i++)

cout<<endl;
double s=0;
for(i=1;i<=n;i++)

cout<<s<<endl;
if(s<=eps)
cout<<"error";
else

cout<<endl;
l=0;
while(l<max)

//calculam d
for(i=1;i<=n;i++)

//calculam iar d
for(i=1;i<=n;i++)
for(j=1;j<=n;j++)

//calculam y
for(i=1;i<=n;i++)

i=1;
while(i<=n)
if(j==n+1)
i=i+1;
else
i=n+2;}
if((i==n+1)&&(j==n+1))

for(i=1;i<=n;i++)

cout<<endl;}
exit(1);
cout<<endl;}
 else
 

 
}}
}

/////aici se ermina programul

#include<iostream.h>
#include<math.h>
void main()

for(p=1;p<=n;p++)

}
}}
cout<<"afis inf tr"<<endl;
for(i=1;i<=n;i++)

cout<<endl;}

for(i=1;i<=n;i++)

cout<<endl;
}

#include<iostream.h>
#include<math.h>
void main()

for(p=1;p<=n;p++)

}

cout<<"afis inf tr"<<endl;
for(i=1;i<=n;i++)

cout<<endl;}

include<iostream.h>
#include<math.h>
#include<stdlib.h>
#include<stdio.h>
void main()

for(i=1;i<=n;i++)


for(p=1;p<=n-1;p++)
}}
/*for(i=1;i<=n;i++)
for(j=1;j<=n;j++)
*/
cout<<"afisare  L"<<endl;
for(i=1;i<=n;i++)

cout<<endl;}

/*for(i=1;i<=n;i++)
for(j=1;j<=n;j++)
*/

cout<<"afisare  U"<<endl;
for(i=1;i<=n;i++)

cout<<endl;}

/*for(k=1;k<=n;k++)
for(i=1;i<=n;i++)

}
cout<<"afisare  B"<<endl;
for(i=1;i<=n;i++)
*/

for(i=1;i<=n;i++)

cout<<s<<"  ";
}cout<<endl;
}

#include<iostream.h>
#include<math.h>
#include<stdlib.h>
#include<stdio.h>
void main()

for(i=1;i<=n;i++)





for(p=1;p<=n-1;p++)

for(i=1;i<=n;i++)
for(j=1;j<=n;j++)

cout<<"afisare  L"<<endl;
for(i=1;i<=n;i++)


for(i=1;i<=n;i++)
for(j=1;j<=n;j++)


cout<<"afisare  U"<<endl;
for(i=1;i<=n;i++)

}
}

//calcul matrice inversa


#include<stdio.h>
#include<conio.h>
#define max 100
void main()
if(d==0)printf("\nMatricea nu este inversabila!!!");
else }
getchar();
getchar();
}

Calcul determinanti:

#include<stdio.h>

#include<conio.h>

#define max 100

void main()

for(j=i+1;j<=n;j++)for(l=i+1;l<=n;l++)a[j][l]-=a[j][i]*a[i][l]/a[i][i];

if(d!=0)for(i=1;i<=n;i++)d*=a[i][i];

printf("\nValoarea determinantului este : %.2f",d);

getchar();

getchar();

//calcul matrice inversa

#include<stdio.h>

#include<conio.h>

#define max 100

void main()

if(d==0)

printf("\nMatricea nu este inversabila!!!");

else

}

getchar();

getchar();

/*#include<iostream.h>

void main()

for(i=1;i<=n-1;i++)

for(i=1;i<=n-1;i++)

for(i=1;i<=n-1;i++)

cout<<"afisam desc LU"<<endl;

for(i=1;i<=n;i++)

cout<<d[i]<<" ";

cout<<endl;

for(i=1;i<=n-1;i++)

cout<<l[i]<<" ";

cout<<endl;

for(i=1;i<=n-1;i++)

cout<<u[i]<<" ";

cout<<endl;

cout<<"terminat afisarea LU"<<endl;

cout<<"rez inf tr"<<endl;

for(i=1;i<=n;i++)

for(i=2;i<=n;i++)

b[i]=b[i]-l[i-1]*b[i-1];

for(i=1;i<=n;i++)

cout<<b[i]<<" ";

cout<<endl;

cout<<"term inf tr"<<endl;

cout<<"rez sup tr"<<endl;

for(i=1;i<=n;i++)

b[n]=b[n]/d[n];

for(i=n-1;i>=1;i--)

b[i]=(b[i]-b[i+1]*u[i])/d[i];

for(i=1;i<=n;i++)

cout<<b[i]<<" ";

cout<<endl;

#include<iostream.h>

#include<math.h>

void main()

for(p=1;p<=n;p++)

for(i=1;i<=n;i++)

cout<<endl;}

for(i=1;i<=n;i++)

cout<<endl;

Descompuneri:

/*#include<iostream.h>

#include<math.h>

#include<stdlib.h>

#include<stdio.h>

void main()

for(i=1;i<=n;i++)

for(p=1;p<=n-1;p++)

/*for(i=1;i<=n;i++)

for(j=1;j<=n;j++)

/*cout<<"afisare L"<<endl;

for(i=1;i<=n;i++)

cout<<endl;}

/*for(i=1;i<=n;i++)

for(j=1;j<=n;j++)

/*out<<"afisare U"<<endl;

for(i=1;i<=n;i++)

cout<<endl;}

/*for(k=1;k<=n;k++)

for(i=1;i<=n;i++)

cout<<"afisare B"<<endl;

for(i=0;i<=n;i++)

/*cout<<"afisare L*U"<<endl;

for(i=1;i<=n;i++)

cout<<s<<" ";

}cout<<endl;

#include<iostream.h>

void main()

for(i=1;i<=n;i++)

for(i=1;i<=n;i++)

for(j=i+1;j<=n;j++)

if(k!=0)

cout<<"nu"<<endl;

else

cout<<"da"<<endl;

for(i=1;i<=n;i++)

else

a[i][j]=0;}

cout<<endl;}

cout<<"afis a;"<<endl;

for(i=1;i<=n;i++)

for(i=0;i<=n;i++)

for(i=0;i<=n;i++)

cout<<"afisare a"<<endl;

for(i=0;i<=n;i++)

for(i=1;i<=n;i++)

for(j=i+1;j<=n;j++)

if(k!=0)

cout<<"nu"<<endl;

else

cout<<"da"<<endl;

for(i=1;i<=n;i++)

for(j=1;j<=n;j++)

t[i][j]=0;

for(i=1;i<=n;++)

t[i][i]=1;

for(i=f+1;i<=n;i++)

for(i=1;i<=n;i++)

for(i=1;i<=n;i++)

/*#include<iostream.h>

#include<iomanip.h>

#include<stdlib.h>

#include<stdio.h>

#include<conio.h>

#include<math.h>

void main()

cout<<"afisare a"<<endl;

for(i=1;i<=n;i++)

cout<<endl;

for(p=1;p<=n;p++)

if(fabs(a[p][p])<=eps)

cout<<"error";

else

cout<<"afisare a"<<endl;

for(i=1;i<=n;i++)

cout<<"afisare L"<<endl;

for(i=1;i<=n;i++)

for(j=1;j<=n;j++)

for(i=1;i<=n;i++)

cout<<"afisare U"<<endl;

for(i=1;i<=n;i++)

for(j=1;j<=n;j++)

for(i=1;i<=n;i++)

for(k=1;k<=n;k++)

for(i=1;i<=n;i++)

cout<<endl;

cout<<"afisare L*U"<<endl;;

for(i=1;i<=n;i++)

#include<iostream.h>

#include<iomanip.h>

#include<stdlib.h>

#include<stdio.h>

#include<conio.h>

#include<math.h>

void main()

cout<<"afisare a"<<endl;

for(i=1;i<=n;i++)

cout<<endl;

for(p=1;p<=n;p++)

if(m<=eps)

cout<<"error";

else

for(i=p+1;i<=n;i++)

a[i][p]=a[i][p]/a[p][p];

for(j=p+1;j<=n;j++)

cout<<"afisare a"<<endl;

for(i=1;i<=n;i++)

cout<<"afisare L"<<endl;

for(i=1;i<=n;i++)

for(j=1;j<=n;j++)

for(i=1;i<=n;i++)

cout<<"afisare U"<<endl;

for(i=1;i<=n;i++)

for(j=1;j<=n;j++)

for(i=1;i<=n;i++)

for(k=1;k<=n;k++)

for(i=1;i<=n;i++)

cout<<endl;

cout<<"afisare L*U"<<endl;;

for(i=1;i<=n;i++)

*#include<iostream.h>

#include<stdio.h>

#include<math.h>

void main()

cout<<"afisare t"<<endl;

for(i=1;i<=n;i++)

for(i=1;i<=n;i++)

for(j=1;j<=n;j++)

b[i][j]=t[i][j];

for(p=1;p<=n;p++)

cout<<"afisare t"<<endl;

for(i=1;i<=n;i++)

cout<<"verificare"<<endl;

for(i=1;i<=n;i++)

cout<<endl;

/*#include<iostream.h>

#include<stdio.h>

#include<math.h>

void main()

cout<<"afisare t"<<endl;

for(i=1;i<=n;i++)

for(i=1;i<=n;i++)

for(j=1;j<=n;j++)

b[i][j]=t[i][j];

for(p=1;p<=n;p++)

cout<<"afisare t"<<endl;

for(i=1;i<=n;i++)

cout<<"verificare"<<endl;

for(i=1;i<=n;i++)

cout<<endl;

#include<iostream.h>

#include<math.h>

#include<stdlib.h>

#include<stdio.h>

void main()

for(i=1;i<=n;i++)

for(p=1;p<=n-1;p++)

v[p]=l;

if(M<=eps)

cout<<"error"<<endl;

else

for(i=p+1;i<=n;i++)

if(fabs(a[n][n])<=eps)

cout<<"error";

else

cout<<"mtra adupa inv i";

for(i=1;i<=n;i++)

cout<<endl;

for(p=2;p<=n;p++)

for(i=1;i<=n;i++)

cout<<endl;

for(i=1;i<=n;i++)

c[i][j]=s;

for(p=n-1;p>=1;p--)

cout<<"afis inversa"<<endl;

for(i=1;i<=n;i++)

for(i=1;i<=n;i++)

cout<<endl;}}////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

#include<iostream.h>

#include<math.h>

void main()

for(i=1;i<=n;i++)

p=1;

while((p<=n)&&(fabs(a[p][p])>eps))

if(p==n+1)

i=1;

while((i<=n)&&(fabs(x[i]-y[i])<=eps))

i=i+1;

if(i==n+1)

cout<<"s-a atins precizia eps in k=1 pasi ,aprox este y";

else

else

cout<<"error";

Pivotari:

/*#include<iostream.h>

#include<math.h>

#include<stdlib.h>

#include<stdio.h>

void main()

for(i=1;i<=n;i++)

for(i=1;i<=n;i++)

for(i=1;i<=n;i++)

for(p=1;p<=n-1;p++)

if(M<=eps)

cout<<"error"<<endl;

else

aux2=b[p];

b[p]=b[l];

b[l]=aux2;}

for(i=p+1;i<=n;i++)

cout<<"matr dupa pasul"<<p<<endl;

for(i=1;i<=n;i++)

cout<<"term liber dupa pasul"<<p<<endl;

for(i=1;i<=n;i++)

if(fabs(a[n][n])<=eps)

cout<<"error";

else

cout<<"sol:"<<endl;

for(i=1;i<=n;i++)

/*#include<iostream.h>

#include<math.h>

#include<stdlib.h>

#include<stdio.h>

void main()

for(i=1;i<=n;i++)

for(i=1;i<=n;i++)

for(i=1;i<=n;i++)

for(p=1;p<=n-1;p++)

col[p]=c;

if(M<=eps)

cout<<"error"<<endl;

else

aux2=b[p];

b[p]=b[l];

b[l]=aux2;}

if(p!=c)

for(i=p+1;i<=n;i++)

cout<<"matr dupa pasul"<<p<<endl;

for(i=1;i<=n;i++)

cout<<"term liber dupa pasul"<<p<<endl;

for(i=1;i<=n;i++)

if(fabs(a[n][n])<=eps)

cout<<"error";

else

cout<<"sol:"<<endl;

for(i=1;i<=n;i++)

for(p=n-1;p>=1;p--)

cout<<"sol:"<<endl;

for(i=1;i<=n;i++)

/*#include<iostream.h>

#include<iomanip.h>

#include<stdlib.h>

#include<stdio.h>

#include<conio.h>

#include<math.h>

void main()

for(i=1;i<=n;i++)

eps=pow(10,-10);

cout<<"matricea"<<endl;

for(i=1;i<=n;i++)

cout<<"vectorul"<<endl;

for(i=1;i<=n;i++)

setprecision(8);

if(n==2)

else

else

if(n==3)

else

#include<iostream.h>

#include<math.h>

#include<stdlib.h>

#include<stdio.h>

void main()

for(i=1;i<=n;i++)

for(i=1;i<=n;i++)

for(i=1;i<=n;i++)

for(p=1;p<=n-1;p++)

cout<<"matr dupa pasul"<<p<<endl;

for(i=1;i<=n;i++)

cout<<"term liber dupa pasul"<<p<<endl;

for(i=1;i<=n;i++)

if(fabs(a[n][n])<=eps)

cout<<"error";

else

cout<<"sol:"<<endl;

for(i=1;i<=n;i++)

/*#include<iostream.h>

#include<math.h>

#include<stdlib.h>

#include<stdio.h>

void main()

for(i=1;i<=n;i++)

for(p=1;p<=n-1;p++)

/*for(i=1;i<=n;i++)

for(j=1;j<=n;j++)

/*cout<<"afisare L"<<endl;

for(i=1;i<=n;i++)

cout<<endl;}

/*for(i=1;i<=n;i++)

for(j=1;j<=n;j++)

/*out<<"afisare U"<<endl;

for(i=1;i<=n;i++)

cout<<endl;}

/*for(k=1;k<=n;k++)

for(i=1;i<=n;i++)

cout<<"afisare B"<<endl;

for(i=0;i<=n;i++)

/*cout<<"afisare L*U"<<endl;

for(i=1;i<=n;i++)

cout<<s<<" ";

}cout<<endl;

#include<iostream.h>

void main()

for(i=1;i<=n;i++)

for(i=1;i<=n;i++)

for(j=i+1;j<=n;j++)

if(k!=0)

cout<<"nu"<<endl;

else

cout<<"da"<<endl;

for(i=1;i<=n;i++)

else

a[i][j]=0;}

cout<<endl;}

cout<<"afis a;"<<endl;

for(i=1;i<=n;i++)

for(i=0;i<=n;i++)

for(i=0;i<=n;i++)

cout<<"afisare a"<<endl;

for(i=0;i<=n;i++)

for(i=1;i<=n;i++)

for(j=i+1;j<=n;j++)

if(k!=0)

cout<<"nu"<<endl;

else

cout<<"da"<<endl;

for(i=1;i<=n;i++)

for(j=1;j<=n;j++)

t[i][j]=0;

for(i=1;i<=n;++)

t[i][i]=1;

for(i=f+1;i<=n;i++)

for(i=1;i<=n;i++)

for(i=1;i<=n;i++)


Document Info


Accesari: 1942
Apreciat: hand-up

Comenteaza documentul:

Nu esti inregistrat
Trebuie sa fii utilizator inregistrat pentru a putea comenta


Creaza cont nou

A fost util?

Daca documentul a fost util si crezi ca merita
sa adaugi un link catre el la tine in site


in pagina web a site-ului tau.




eCoduri.com - coduri postale, contabile, CAEN sau bancare

Politica de confidentialitate | Termenii si conditii de utilizare




Copyright © Contact (SCRIGROUP Int. 2024 )