import java.io.Serializable ; /* ************************************ */ /* Classe matrice 4x4 */ /* ************************************ */ public class Matrice implements Serializable { public float m[][] = new float[4][4] ; public void annulle() { for ( int i = 0 ; i < 4 ; i++ ) for ( int j = 0 ; j < 4 ; j++ ) m[i][j] = 0.0F ; } public void identite() { for ( int i = 0 ; i < 4 ; i++ ) for ( int j = 0 ; j < 4 ; j++ ) m[i][j] = ( i == j ) ? 1.0F : 0.0F ; } public void aleatoire() { for ( int i = 0 ; i < 4 ; i++ ) for ( int j = 0 ; j < 4 ; j++ ) m[i][j] =(float) Math.random() ; } public String toString() { return("Matrice : "+m[0][0]+" "+m[0][1]+" "+m[0][2]+" "+m[0][3]+"\n "+ m[1][0]+" "+m[1][1]+" "+m[1][2]+" "+m[1][3]+"\n "+ m[2][0]+" "+m[2][1]+" "+m[2][2]+" "+m[2][3]+"\n "+ m[3][0]+" "+m[3][1]+" "+m[3][2]+" "+m[3][3]) ; } }