function [a ll]  = mygauss2(a)
%This function accepts a square matrix a and returns a
%sqaure matrix which contains the result of elimination in 
%the upper right triangle and on the diagonal and the multipliers
%used in elimination below the diagonal. 
%
%Skeleton file for homework 9. v. 2
%Russell Brown, November 18 2004. 

%Check that sizes of the arguments are compatible. 
[rowa, cola] = size(a);

if (rowa ~= cola) 
	error('Argument should be a square matrix.')
end

n = rowa;

%Set up the index vector. 

ll = [1:1:n];

%Set up scale vector to contain maximum element of each row. 
%You will find the matlab function max useful. Use help max
%or doc max to learn more about this function. 

s = zeros(n,1);

for i = 1:n
        %%Next line corrected, RMB, 11/24/04. 
	s(i,1) = max(abs(a(i, [1:n])));
 	if (s(i,1) == 0)
		error('Matrix contains a row of zeroes.');
	end
end	

%Begin elimination phase. 
for i = 1:(n-1)
    
%Select pivot row. 


%switch ll(i) with ll(pivot)


%Carry out elimination of a(ll([i+1,n],1),i) using a(ll(i,1),i) 
%as pivot element. 





