function varargout = union(varargin)
%UNION Set union.
%   C = union(A,B)    
%   [C,IA,IB] = union(A,B)    
%   [C,IA,IB] = union(A,B,'rows')    
%   [C,IA,IB] = union(A,B,'stable') 
%   [C,IA,IB] = union(A,B,'rows','stable') 
%   [C,IA,IB] = union(A,B,'sorted') 
%   [C,IA,IB] = union(A,B,'rows','sorted') 
%   
%   The 'legacy' flag is not supported.
%   64-bit integers are not supported.
%    
%   Examples:
%    
%      a = gpuArray([9 9 9 9 9 9 8 8 8 8 7 7 7 6 6 6 5 5 4 2 1])
%      b = gpuArray([1 1 1 3 3 3 3 3 4 4 4 4 4 10 10 10])
%   
%      [c1,ia1,ib1] = union(a,b)
%      % returns
%      c1 = [1 2 3 4 5 6 7 8 9 10]
%      ia1 = [21 20 19 17 14 11 7 1]'
%      ib1 = [4 14]'
%   
%      [c2,ia2,ib2] = union(a,b,'stable')
%      % returns
%      c2 = [9 8 7 6 5 4 2 1 3 10]
%      ia2 = [1 7 11 14 17 19 20 21]'
%      ib2 = [4 14]'
%   
%      c = union(gpuArray([1 NaN]),gpuArray([NaN 2]))
%      % NaNs compare as not equal, so this returns
%      c = [1 2 NaN NaN]
%    See also union, gpuArray.


%   Copyright 2015 The MathWorks, Inc.

% try...catch prevents error being reported by internal
try
    [varargout{1:nargout}] = parallel.internal.flowthrough.union(varargin{:});
catch ME
    throw(ME);
end
