Solved Task 1
This commit is contained in:
parent
7cb5f64f56
commit
0fb8b74d99
Binary file not shown.
|
@ -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):
|
||||
unknown = 0
|
||||
|
||||
import numpy as np
|
||||
|
||||
A = np.copy(A) #necessary to prevent changes in the original matrix A_in
|
||||
A = A.astype('float64') #change to float
|
||||
|
@ -31,20 +32,32 @@ def Serie8_Aufg2(A):
|
|||
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)
|
Binary file not shown.
Loading…
Reference in New Issue