Frederick 6 anni fa
parent
commit
c547374be3

+ 9 - 0
.idea/Jakobs_Arbeits_Ecke.iml

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager" inherit-compiler-output="true">
+    <exclude-output />
+    <content url="file://$MODULE_DIR$" />
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+  </component>
+</module>

+ 8 - 0
.idea/modules.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectModuleManager">
+    <modules>
+      <module fileurl="file://$PROJECT_DIR$/.idea/Jakobs_Arbeits_Ecke.iml" filepath="$PROJECT_DIR$/.idea/Jakobs_Arbeits_Ecke.iml" />
+    </modules>
+  </component>
+</project>

+ 6 - 0
.idea/vcs.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="VcsDirectoryMappings">
+    <mapping directory="" vcs="Git" />
+  </component>
+</project>

+ 163 - 0
.idea/workspace.xml

@@ -0,0 +1,163 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ChangeListManager">
+    <list default="true" id="bd86310a-4897-4275-b7d6-8db0ce9c60dd" name="Default Changelist" comment="" />
+    <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
+    <option name="SHOW_DIALOG" value="false" />
+    <option name="HIGHLIGHT_CONFLICTS" value="true" />
+    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
+    <option name="LAST_RESOLUTION" value="IGNORE" />
+  </component>
+  <component name="DefaultGradleProjectSettings">
+    <option name="testRunner" value="GRADLE" />
+    <option name="delegatedBuild" value="true" />
+  </component>
+  <component name="FileEditorManager">
+    <leaf>
+      <file pinned="false" current-in-tab="true">
+        <entry file="file://$PROJECT_DIR$/Lin_Algebra/Eingabe.java">
+          <provider selected="true" editor-type-id="text-editor">
+            <state relative-caret-position="-588">
+              <caret line="58" column="4" lean-forward="true" selection-start-line="58" selection-start-column="4" selection-end-line="58" selection-end-column="4" />
+            </state>
+          </provider>
+        </entry>
+      </file>
+    </leaf>
+  </component>
+  <component name="Git.Settings">
+    <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
+  </component>
+  <component name="IdeDocumentHistory">
+    <option name="CHANGED_PATHS">
+      <list>
+        <option value="$PROJECT_DIR$/Lin_Algebra/Eingabe.java" />
+      </list>
+    </option>
+  </component>
+  <component name="ProjectConfigurationFiles">
+    <option name="files">
+      <list>
+        <option value="$PROJECT_DIR$/.idea/Jakobs_Arbeits_Ecke.iml" />
+        <option value="$PROJECT_DIR$/.idea/vcs.xml" />
+        <option value="$PROJECT_DIR$/.idea/modules.xml" />
+      </list>
+    </option>
+  </component>
+  <component name="ProjectFrameBounds" extendedState="4">
+    <option name="x" value="1974" />
+    <option name="y" value="24" />
+    <option name="width" value="933" />
+    <option name="height" value="1056" />
+  </component>
+  <component name="ProjectView">
+    <navigator proportions="" version="1">
+      <foldersAlwaysOnTop value="true" />
+    </navigator>
+    <panes>
+      <pane id="Scope" />
+      <pane id="ProjectPane">
+        <subPane>
+          <expand>
+            <path>
+              <item name="Jakobs_Arbeits_Ecke" type="b2602c69:ProjectViewProjectNode" />
+              <item name="Jakobs_Arbeits_Ecke" type="462c0819:PsiDirectoryNode" />
+            </path>
+            <path>
+              <item name="Jakobs_Arbeits_Ecke" type="b2602c69:ProjectViewProjectNode" />
+              <item name="Jakobs_Arbeits_Ecke" type="462c0819:PsiDirectoryNode" />
+              <item name="Lin_Algebra" type="462c0819:PsiDirectoryNode" />
+            </path>
+          </expand>
+          <select />
+        </subPane>
+      </pane>
+      <pane id="PackagesPane" />
+    </panes>
+  </component>
+  <component name="PropertiesComponent">
+    <property name="last_opened_file_path" value="$PROJECT_DIR$" />
+  </component>
+  <component name="RunDashboard">
+    <option name="ruleStates">
+      <list>
+        <RuleState>
+          <option name="name" value="ConfigurationTypeDashboardGroupingRule" />
+        </RuleState>
+        <RuleState>
+          <option name="name" value="StatusDashboardGroupingRule" />
+        </RuleState>
+      </list>
+    </option>
+  </component>
+  <component name="SvnConfiguration">
+    <configuration />
+  </component>
+  <component name="TaskManager">
+    <task active="true" id="Default" summary="Default task">
+      <changelist id="bd86310a-4897-4275-b7d6-8db0ce9c60dd" name="Default Changelist" comment="" />
+      <created>1556394629042</created>
+      <option name="number" value="Default" />
+      <option name="presentableId" value="Default" />
+      <updated>1556394629042</updated>
+    </task>
+    <servers />
+  </component>
+  <component name="ToolWindowManager">
+    <frame x="1974" y="24" width="933" height="1056" extended-state="4" />
+    <editor active="true" />
+    <layout>
+      <window_info id="Favorites" side_tool="true" />
+      <window_info id="Image Layers" />
+      <window_info id="Designer" />
+      <window_info id="UI Designer" />
+      <window_info id="Capture Tool" />
+      <window_info id="Learn" />
+      <window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.24971752" />
+      <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
+      <window_info anchor="bottom" id="Version Control" weight="0.32900432" />
+      <window_info anchor="bottom" id="Terminal" />
+      <window_info anchor="bottom" id="Event Log" side_tool="true" />
+      <window_info anchor="bottom" id="Message" order="0" />
+      <window_info anchor="bottom" id="Find" order="1" />
+      <window_info anchor="bottom" id="Run" order="2" />
+      <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
+      <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
+      <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
+      <window_info anchor="bottom" id="TODO" order="6" />
+      <window_info anchor="right" id="Palette" />
+      <window_info anchor="right" id="Theme Preview" />
+      <window_info anchor="right" id="Capture Analysis" />
+      <window_info anchor="right" id="Palette&#9;" />
+      <window_info anchor="right" id="Maven" />
+      <window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
+      <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
+      <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
+    </layout>
+  </component>
+  <component name="editorHistoryManager">
+    <entry file="file://$PROJECT_DIR$/Lin_Algebra/Eingabe.java">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="-588">
+          <caret line="58" column="4" lean-forward="true" selection-start-line="58" selection-start-column="4" selection-end-line="58" selection-end-column="4" />
+        </state>
+      </provider>
+    </entry>
+  </component>
+  <component name="masterDetails">
+    <states>
+      <state key="ProjectJDKs.UI">
+        <settings>
+          <last-edited>1.8</last-edited>
+          <splitter-proportions>
+            <option name="proportions">
+              <list>
+                <option value="0.2" />
+              </list>
+            </option>
+          </splitter-proportions>
+        </settings>
+      </state>
+    </states>
+  </component>
+</project>

BIN
Lin_Algebra/Eingabe.class.orig


+ 5 - 3
Lin_Algebra/Eingabe.ctxt

@@ -2,8 +2,8 @@
 comment0.target=Eingabe
 comment1.params=
 comment1.target=Eingabe()
-comment2.params=dim_m\ dim_n
-comment2.target=void\ einlesen(int,\ int)
+comment2.params=
+comment2.target=void\ einlesen()
 comment3.params=zahl
 comment3.target=double\ faktorCheck(Element)
 comment4.params=zahl\ multi
@@ -14,4 +14,6 @@ comment6.params=
 comment6.target=void\ ausgabe()
 comment7.params=
 comment7.target=void\ gauss()
-numComments=8
+comment8.params=args
+comment8.target=void\ main(java.lang.String[])
+numComments=9

+ 47 - 26
Lin_Algebra/Eingabe.java

@@ -9,35 +9,42 @@ import java.util.*;
 
 public class Eingabe
 {
-  private Element[][] matrix;
-  private double multi = 1;
-  private int n;
-  private int m;
-  
-    public Eingabe() throws IOException
+    private Element[][] matrix;
+    private double multi = 1;
+    private int n;
+    private int m;
+
+    public Eingabe()
     {
-       n = 3;
-       m = 4;
+        n = 3;
+        m = 4;
     }
-    
-    public void einlesen(int dim_m, int dim_n) throws IOException
-    {
-        m = dim_m;
-        n = dim_n;
-      for(int i=0; i<n; i++)
-      {
-          for(int j=0; j<m; j++)
-          {
-              InputStreamReader isr = new InputStreamReader(System.in);
-              BufferedReader br = new BufferedReader(isr);
-              System.out.print( + i + "," + j + ": ");
-              String eingabe = br.readLine();
-              matrix[j][i] = new Element(Double.parseDouble(eingabe));
-   
-          }
+
+    public void einlesen() throws IOException {
         
-      }
-    
+        //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++) {
+                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));
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+
+        }
+        if (br != null) {
+            try {
+                br.close();
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
     }
     public double faktorCheck(Element zahl)
     {
@@ -123,6 +130,20 @@ public class Eingabe
         }
         ausgabe();
     }
+
+    public static void main (String[] args) {
+
+        Eingabe a = new Eingabe();
+
+        try {
+            a.einlesen();
+            a.gauss();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+
+        a.ausgabe();
+    }
     
   /*
     

+ 172 - 0
Lin_Algebra/Eingabe.java.orig

@@ -0,0 +1,172 @@
+
+/** 
+ * @author (Jakob Kienegger) 
+ * @version (27.04.19)
+ */
+
+import java.io.*;
+import java.util.*;
+
+public class Eingabe
+{
+    private Element[][] matrix;
+    private double multi = 1;
+    private int n;
+    private int m;
+
+    public Eingabe()
+    {
+        n = 3;
+        m = 4;
+    }
+<<<<<<< HEAD
+    
+    public void einlesen(int dim_m, int dim_n) throws IOException
+    {
+        m = dim_m;
+        n = dim_n;
+      for(int i=0; i<n; i++)
+      {
+          for(int j=0; j<m; j++)
+          {
+              InputStreamReader isr = new InputStreamReader(System.in);
+              BufferedReader br = new BufferedReader(isr);
+              System.out.print( + i + "," + j + ": ");
+              String eingabe = br.readLine();
+              matrix[j][i] = new Element(Double.parseDouble(eingabe));
+   
+          }
+=======
+
+    public void einlesen() throws IOException {
+>>>>>>> dt
+        
+        //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++) {
+                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));
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+
+        }
+        if (br != null) {
+            try {
+                br.close();
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+    }
+    public double faktorCheck(Element zahl)
+    {
+        if(zahl.gibZahl() != 1)
+        {
+            multi = 1/(zahl.gibZahl());
+            zahl.multiZahl(multi);
+        }
+        return multi;
+    }
+    
+    public double rechnen(Element zahl, double multi)
+    {
+        zahl.multiZahl(multi);
+        return zahl.gibZahl();
+    }
+   
+    public void zeilenFaktor(int a)
+    {
+        for(int i=0; i<n; i++)
+        {
+            this.multi = faktorCheck(matrix[i][a]);
+            for(int j=1; j<m; j++)
+            {
+                matrix[i][j].multiZahl(this.multi); 
+            }
+        }   
+        
+    }
+    
+    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(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();
+    }
+
+    public static void main (String[] args) {
+
+        Eingabe a = new Eingabe();
+
+        try {
+            a.einlesen();
+            a.gauss();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+
+        a.ausgabe();
+    }
+    
+  /*
+    
+    */
+   
+   
+}

+ 1 - 5
Lin_Algebra/package.bluej

@@ -4,12 +4,8 @@ dependency1.to=Element
 dependency1.type=UsesDependency
 editor.fx.0.height=873
 editor.fx.0.width=720
-editor.fx.0.x=720
+editor.fx.0.x=0
 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

+ 0 - 0
hallo