Jakob Kienegger 6 ani în urmă
părinte
comite
f8449c24ca

BIN
Lin_Algebra/Eingabe.class


+ 7 - 3
Lin_Algebra/Eingabe.ctxt

@@ -8,6 +8,10 @@ comment3.params=zahl
 comment3.target=double\ faktorCheck(Element)
 comment4.params=zahl\ multi
 comment4.target=double\ rechnen(Element,\ double)
-comment5.params=
-comment5.target=void\ zeilenFaktor()
-numComments=6
+comment5.params=a
+comment5.target=void\ zeilenFaktor(int)
+comment6.params=
+comment6.target=void\ ausgabe()
+comment7.params=
+comment7.target=void\ gauss()
+numComments=8

+ 54 - 6
Lin_Algebra/Eingabe.java

@@ -54,11 +54,11 @@ public class Eingabe
         return zahl.gibZahl();
     }
    
-    public void zeilenFaktor()
+    public void zeilenFaktor(int a)
     {
         for(int i=0; i<n; i++)
         {
-            this.multi = faktorCheck(matrix[i][0]);
+            this.multi = faktorCheck(matrix[i][a]);
             for(int j=1; j<m; j++)
             {
                 matrix[i][j].multiZahl(this.multi); 
@@ -66,13 +66,61 @@ public class Eingabe
         }   
         
     }
-    /*
+    
+    public void ausgabe()
+    {
+        for(int j=0; j<n; j++)
+        {
+            for(int i=0; i<m; i++)
+            {
+                System.out.print( matrix[j][i].gibZahl() + ", ");
+            }
+            
+        }
+    }
+    
+    
     public void gauss() throws IOException
     {
         einlesen(m, n);
-        zeilenFaktor();
-        for(int i=0; i<
-        
+        zeilenFaktor(0);
+        for(int j=1; j<3; j++)
+        {
+            for(int i=0; i<m; i++)
+            {
+                double a = matrix[0][i].gibZahl();
+                double b = matrix[j][i].gibZahl();
+                
+                matrix[j][i].changeZahl(b-a);
+            }
+        }
+        zeilenFaktor(1);
+        for(int i=1; i<m; i++)
+            {
+                double a = matrix[1][i].gibZahl();
+                double b = matrix[0][i].gibZahl();
+                
+                matrix[0][i].changeZahl(b-a);
+            }
+        for(int i=1; i<m; i++)
+            {
+                double a = matrix[1][i].gibZahl();
+                double b = matrix[2][i].gibZahl();
+                
+                matrix[2][i].changeZahl(b-a);
+            }
+        zeilenFaktor(2);
+        for(int j=0; j<2; j++)
+        {
+            for(int i=2; i<m; i++)
+            {
+                double a = matrix[2][i].gibZahl();
+                double b = matrix[j][i].gibZahl();
+                
+                matrix[j][i].changeZahl(b-a);
+            }
+        }
+        ausgabe();
     }
     
   /*

+ 4 - 0
Lin_Algebra/package.bluej

@@ -6,6 +6,10 @@ editor.fx.0.height=873
 editor.fx.0.width=720
 editor.fx.0.x=720
 editor.fx.0.y=0
+editor.fx.1.height=873
+editor.fx.1.width=720
+editor.fx.1.x=0
+editor.fx.1.y=0
 objectbench.height=93
 objectbench.width=763
 package.divider.horizontal=0.5422535211267606