function D = eye( varargin )
%DISTRIBUTED.EYE Identity distributed matrix
%   D = DISTRIBUTED.EYE(N) is the N-by-N distributed matrix with ones on
%   the diagonal and zeros elsewhere.
%   
%   D = DISTRIBUTED.EYE(M,N) or DISTRIBUTED.EYE([M,N]) is the M-by-N 
%   distributed matrix with ones on the diagonal and zeros elsewhere.
%   
%   D = DISTRIBUTED.EYE() is the distributed scalar 1.
%   
%   D = DISTRIBUTED.EYE(M,N,CLASSNAME) or DISTRIBUTED.EYE([M,N],CLASSNAME)
%   is the M-by-N distributed identity matrix with underlying data of 
%   class CLASSNAME.
%   
%   D = EYE(...,'like',P) for a DISTRIBUTED argument P returns a DISTRIBUTED identity matrix of the 
%   same complexity as P and the requested size. If CLASSNAME is not specified then D has the
%   same underlying class as P. P must be of numeric or logical underlying class.
%   
%   Example:
%       N = 1000;
%       % Create a 1000-by-1000 distributed array with underlying class 'int32'.
%       D1 = distributed.eye(N,'int32');
%       % D2 is a 2000-by-2000 distributed array with the same underlying class
%       D2 = eye(2000,'like',D1); 
%   
%   See also EYE, DISTRIBUTED.
%   


%   Copyright 2008-2020 The MathWorks, Inc.

% static method of distributed

D = distributed.sBuild( @codistributed.eye, 'eye', varargin{:} );
end
