# -*- coding: utf-8 -*-
"""
Created on Wed Jan 24 14:04:56 2018

@author: Andreas
"""

#' # Aufgabe 3

# Standard imports
import numpy as np
import numpy.linalg as la
from matplotlib import pyplot as plt

#' Fehlerhafter Quellcode:
'''
def EliminiereSpalte(A):
    m, n = A.shape;
    index = np.argmax(abs[A[:, 0]]);
    A[[0, index], :] = A[[0, index], :];
    l = A[1:, [ 0 ] ] * A[0, 0];
    A[1:, :] = A[1:, :] - l @ A[[ 0 ], :];

    return A, l, index;
'''

#' Ihre korrigierte Version:

def EliminiereSpalte(A):
    m, n = A.shape;
    index = np.argmax(abs[A[:, 0]]);
    A[[0, index], :] = A[[0, index], :];
    l = A[1:, [ 0 ] ] * A[0, 0];
    A[1:, :] = A[1:, :] - l @ A[[ 0 ], :];

    return A, l, index;