%% Function pivotrowmin( V ) 
%%
%% By: Michael K. Pellegrino
%%
%% input: M = a vector containing pivot ratios
%% output: ret = the row of the entry with the minimum positive value
%%

function [ret] = pivotrowmin( V )
  [nrow,ncol]=size( V );

  %% replace all -1's with the max value
  %% so we can use the "min" function
  for i=1:ncol
    if( V(i) == -1 )
      V(i) = max(V);
    endif
  endfor

  for i=1:ncol
    if( V(i) == min(V) )
      ret=i;
      return;
    endif
  endfor
  ret=-1;
endfunction
