CP3 Aljabar Linear
Kelompok: Afrian Riznaldhy (04218113) M David Ridwan (04218033) M Andika Lucky P (04218105) Sri Caka Arethusa (04218062) import numpy as np def GENP(A, b): ''' Gaussian elimination with no pivoting. % input: A is an n x n nonsingular matrix % b is an n x 1 vector % output: x is the solution of Ax=b. % post-condition: A and b have been modified. ''' n = len(A) if b.size != n: raise ValueError("Invalid argument: incompatible sizes between A & b.", b.size, n) for pivot_row in xrange(n-1): for row in xrange(pivot_row+1, n): multiplier = A[row][pivot_row]/A[pivot_row][pivot_row] #the only one in this column since the rest are zero ...