adaptation code en cas ou pas de class Marice existe
BONJOUR
je veux adapter ce code où il ya la Classe Matrice je le veux int [][] mais ça donne pas de résultat correcte.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| public Matrice getMatriceTranspose()
{
Matrice a = new Matrice(this.getColumns(), this.getRows());
long tmp = 0;
for (int i=0; i<a.getRows(); i++)
for (int j=0; j<a.getColumns(); j++)
{
tmp = this.getValue(j,i);
a.setValue(i,j,tmp);
}
return a;
} |
voilàa le code
l'appel se fait comme ça
Code:
1 2
| Matrice x = new Matrice(new long[][] { {0,1,0,0}, {1,0,0,0}, {0,0,1,1},{0,0,0,1}});
x.getMatriceTranspose() |
Merci d'avance :)