%% Function pivotcol( M ) 
%%
%% By: Michael K. Pellegrino
%%
%% input: M = any KxN matrix 
%% output: ret = the 1st col with a negative value in the greatest row
%%

function [ret] = pivotcol( M )
  [nrow,ncol]=size( M );
  ret=-1;
  for i=1:ncol
    if( M(nrow,i) < 0 ) 
      ret=i;
      return;
    endif
  endfor
endfunction
