-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainTeste.java
52 lines (47 loc) 路 1.67 KB
/
MainTeste.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
public class MainTeste {
public static void main(String[] args)
{
try {
LeitorDeArquivo leitor = new LeitorDeArquivo("gauss.txt");
//Ver se o leitor conssegue ler linhas do arquivo
if(!leitor.getUmaLinha().equals("") || leitor.getUmaLinha() != null)
System.out.println("leitor funcionando");
double[][] mat = new double[3][4];
mat[0][0] = 1;
mat[0][1] = 4;
mat[0][2] = 5;
mat[0][3] = 4;
mat[1][0] = 1;
mat[1][1] = 9;
mat[1][2] = 7;
mat[1][3] = 8;
mat[2][0] = 3;
mat[2][1] = 11;
mat[2][2] = 3;
mat[2][3] = 2;
//Testes da matriz
Matriz matriz = new Matriz(mat);
//matriz.setCol(-1);
//matriz.setLin(-1);
//matriz.setMatriz(null);
System.out.println(matriz.toString());
Matriz matDois = (Matriz)matriz.clone();
System.out.println(matDois.getClass());
if(matriz.equals(matDois))
System.out.println("Equals OK");
//Testes do gauss
if(Gauss.valida(mat));
System.out.println("Valida莽茫o funcionando");
double[] teste = {0, 1, 2, 3, 0};
if(Gauss.isColunaComZero(teste, 1));
System.out.println("Coluna com zero OK");
mat = Gauss.tornarZero(mat, 0);
for(int i = 0; i < matriz.getLin(); i++)
System.out.println(mat[i][0] + "");
}
catch(Exception err)
{
System.out.println(err.getMessage());
}
}
}