-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
46 lines (41 loc) · 1.28 KB
/
Main.java
File metadata and controls
46 lines (41 loc) · 1.28 KB
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
import Gauss.*;
import java.io.IOException;
public class Main{
public static void main (String[] args) throws IOException{
Gauss x = new Gauss("1.txt");
x.print();
int n = x.getN();
double[] I = new double[n];
try{
/* I = x.inverse();
for (int i =0; i<n;i++){
for(int j=0;j<n;j++){
System.out.print(I[i][j]+" ");
}
System.out.println();
}*/
I = x.solve();
for (int i = 0; i < n; i++){
System.out.print(I[i] + " ");
}
System.out.println();
I = x.solveCol();
for (int i = 0; i < n; i++){
System.out.print(I[i] + " ");
}
System.out.println();
I = x.solveRow();
for (int i = 0; i < n; i++){
System.out.print(I[i] + " ");
}
System.out.println();
I = x.solveEl();
for (int i = 0; i < n; i++){
System.out.print(I[i] + " ");
}
// System.out.println(x.determinant());
}catch (Exception e){
System.out.println(e.toString());
}
}
}