mbiricus
Messages postés4Date d'inscriptionsamedi 10 janvier 2009StatutMembreDernière intervention 5 août 2009
-
3 août 2009 à 18:27
kirua12
Messages postés1155Date d'inscriptionsamedi 17 janvier 2004StatutMembreDernière intervention29 avril 2011
-
5 août 2009 à 14:22
bonjour
j'ai developpé un programme pour inverser une matrice
mais lors de l'execution j'ai le message suivant affiché
qq'un qui peut m'aider?
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 2
at Matrice.setValue(Matrice.java:27)
at Matrice.getNewMatrice(Matrice.java:89)
at Matrice.getDeterminant(Matrice.java:63)
at Matrice.getMatriceInverse(Matrice.java:102)
at Matrice.main(Matrice.java:191)
voila mon code
public class Matrice{
private float[][] coeff;
//constructor//
public Matrice(int i,int j){
this.setLength(i,j);
}
public Matrice(){
this.setLength(0,0);
}
public Matrice(float[][]mat){
this.coeff=mat;
}
//Setter//
public void setMatrice(float[][] mat){
this.coeff=mat;
}
public void setValue(int i,int j,float value){
this.coeff[i][j]=value;
}
public void setLength(int i,int j){
coeff=new float[i][j];
}
//Getter//
public float[][] getMatrice(){
return this.coeff;
}
public int getRow(){
return this.coeff.length;
}
public int getColumns(){
return this.coeff[0].length;
}
public float getValue(int i,int j){
return this.coeff[i][j];
}
kirua12
Messages postés1155Date d'inscriptionsamedi 17 janvier 2004StatutMembreDernière intervention29 avril 20117 5 août 2009 à 14:22
un point d'arrêt permet d'interrompre le programme et de visualiser les différentes variables.
Regarde la doc de ton éditeur de développement (Eclipse, netbean ...) pour savoir comment en mettre un.