diff --git a/Schenk_Brandenberger_S8_Aufg1.pdf b/Schenk_Brandenberger_S8_Aufg1.pdf new file mode 100644 index 0000000..44df81a Binary files /dev/null and b/Schenk_Brandenberger_S8_Aufg1.pdf differ diff --git a/Serie8_Aufg2_Gerüst.py b/Schenk_Brandenberger_S8_Aufg2.py similarity index 63% rename from Serie8_Aufg2_Gerüst.py rename to Schenk_Brandenberger_S8_Aufg2.py index 7bb4156..d4dafb5 100644 --- a/Serie8_Aufg2_Gerüst.py +++ b/Schenk_Brandenberger_S8_Aufg2.py @@ -14,10 +14,11 @@ Example: A = np.array([[1,2,-1],[4,-2,6],[3,1,0]]) @author: knaa """ +import numpy as np def Serie8_Aufg2(A): - - import numpy as np + unknown = 0 + A = np.copy(A) #necessary to prevent changes in the original matrix A_in A = A.astype('float64') #change to float @@ -29,22 +30,34 @@ def Serie8_Aufg2(A): Q = np.eye(n) R = A - + for j in np.arange(0,n-1): - a = np.copy(???).reshape(n-j,1) - e = np.eye(???)[:,0].reshape(n-j,1) + a = np.copy(unknown).reshape(n-j,1) + e = np.eye(unknown)[:,0].reshape(n-j,1) length_a = np.linalg.norm(a) - if a[0] >= 0: sig = ??? - else: sig = ??? - v = ??? - u = ??? - H = ??? + if a[0] >= 0: sig = unknown + else: sig = unknown + v = unknown + u = unknown + H = unknown Qi = np.eye(n) - Qi[j:,j:] = ??? - R = ??? - Q = ??? + Qi[j:,j:] = unknown + R = unknown + Q = unknown return(Q,R) +if __name__ == '__main__': + A = np.array([ + [1, -2, 3], + [-5, 4, 1], + [2, -1, 3] + ]) + b = np.array([ + [1], + [9], + [5] + ]) +Serie8_Aufg2(A) \ No newline at end of file diff --git a/Schenk_Brandenberger_S8_Aufg3.pdf b/Schenk_Brandenberger_S8_Aufg3.pdf new file mode 100644 index 0000000..34ed092 Binary files /dev/null and b/Schenk_Brandenberger_S8_Aufg3.pdf differ