function [ out_far, out_frr, out_hter ] = far_frr_wrapper( result, gt )

% FUNCTION [ FAR, FRR, HTER ] = FAR_FRR_WRAPPER( RESULT, GT )
%
% RESULT and GT are vectors of binary values

  
  
  % Check input arguments
  
  if nargin < 2
    error( [ mfilename ' needs 2 input arguments.' ] );
  end

  if sum( size( result ) > 1 ) > 1
    error( [ mfilename ' needs a vector for "result".' ] );
  end
    
  if sum( size( gt ) > 1 ) > 1
    error( [ mfilename ' needs a vector for "gt".' ] );
  end

  if nargout < 1
    warning( [ mfilename ': no output argument -> nothing to do!' ] );
    return
  end

  % Compute FAR, FRR, HTER
  
  tp = sum( result & gt );
  fp = sum( result & (~gt) );
  tn = sum( (~result) & (~gt) );
  fn = sum( (~result) & gt );
  
  [ far, frr ] = far_frr( tp, fp, tn, fn );
    
  hter = ( far + frr ) / 2;
  
  
  % Return results
  
  if nargout > 0
    out_far = far;
  end
  
  
  if nargout > 1
    out_frr = frr;
  end
  
  if nargout > 2
    out_hter = hter;
  end
  