Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for (k=0;k<n-1;k++) {
- for (i=n-1; i>k; i--) {
- if (abs(matice[i][k])>abs(matice[i-1][k])) {
- for (j=0; j<n+1; j++) {
- matice[i][j]+= matice[i-1][j];
- matice[i-1][j]= matice[i][j]- matice[i-1][j];
- matice[i][j]-= matice[i-1][j];
- }
- }
- }
- for (i=k+1; i<n; i++) {
- if (matice[i][k]!=0){
- x=(double) matice[k][k]/matice[i][k];
- for (j=k; j<n+1; j++) {
- matice[i][j]*=-x;
- matice[i][j]+=matice[k][j];
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement