Browse Source

Matrix_V6

Jakob Kienegger 6 years ago
parent
commit
2f65c52620
4 changed files with 13 additions and 12 deletions
  1. BIN
      Lin_Algebra/Eingabe.class
  2. BIN
      Lin_Algebra/Eingabe.class.orig
  3. 11 10
      Lin_Algebra/Eingabe.java
  4. 2 2
      Lin_Algebra/package.bluej

BIN
Lin_Algebra/Eingabe.class


BIN
Lin_Algebra/Eingabe.class.orig


+ 11 - 10
Lin_Algebra/Eingabe.java

@@ -24,14 +24,14 @@ public class Eingabe
         
         //InputStreamReader isr = null;
         BufferedReader br = null;
-        matrix = new Element[m][n];
-        for (int i = 0; i < n; i++) {
-            for (int j = 0; j < m; j++) {
+        matrix = new Element[n][m];
+        for(int i = 0; i < n; i++) {
+            for(int j = 0; j < m; j++) {
                 try {
                     br = new BufferedReader(new InputStreamReader(System.in));
                     System.out.print(+ i + "," + j + ": ");
                     String eingabe = br.readLine();
-                    matrix[i][j] = new Element(Integer.parseInt(eingabe));
+                    matrix[i][j] = new Element(Double.parseDouble(eingabe));
                 } catch (IOException e) {
                     e.printStackTrace();
                 }
@@ -48,7 +48,8 @@ public class Eingabe
     }
     public double faktorCheck(Element zahl)
     {
-        if(zahl.gibZahl() != 1)
+        int value = (int) zahl.gibZahl();
+        if(value != 1)
         {
             multi = 1/(zahl.gibZahl());
             zahl.multiZahl(multi);
@@ -66,10 +67,10 @@ public class Eingabe
     {
         for(int i=0; i<n; i++)
         {
-            this.multi = faktorCheck(matrix[i][a]);
+            multi = faktorCheck(matrix[i][a]);
             for(int j=1; j<m; j++)
             {
-                matrix[i][j].multiZahl(this.multi); 
+                matrix[i][j].multiZahl(multi); 
             }
         }   
         
@@ -83,14 +84,14 @@ public class Eingabe
             {
                 System.out.print( matrix[j][i].gibZahl() + ", ");
             }
-            
+            System.out.println("");
         }
     }
     
     
     public void gauss() throws IOException
     {
-        einlesen(m, n);
+        //einlesen(m, n);
         zeilenFaktor(0);
         for(int j=1; j<3; j++)
         {
@@ -142,7 +143,7 @@ public class Eingabe
             e.printStackTrace();
         }
 
-        a.ausgabe();
+        //a.ausgabe();
     }
     
   /*

+ 2 - 2
Lin_Algebra/package.bluej

@@ -7,8 +7,8 @@ editor.fx.0.width=720
 editor.fx.0.x=0
 editor.fx.0.y=0
 objectbench.height=93
-objectbench.width=763
-package.divider.horizontal=0.5422535211267606
+objectbench.width=845
+package.divider.horizontal=0.6
 package.divider.vertical=0.8717948717948718
 package.editor.height=673
 package.editor.width=1310