function[RPCMTX,ppvec] = pceye(A,pcoptions,DM,DG,varargin);
%PCEYE Precondition based on DM and DG.
%
%
% PRODUCE DIAGONAL PRECONDITIONER (FACTOR) FOR
%
%       M = DM*(A'*A)*DM + DG
%
% WHERE DM AND DG ARE NON-NEGATIVE SPARSE DIAGONAL MATRICES,
% AND `A' IS UNKNOWN (empty input argument)
%
%
% Initialization

%   Copyright 1990-2000 The MathWorks, Inc.
%   $Revision: 1.3 $  $Date: 2000/06/16 22:25:22 $

  if nargin <2, error('pceye requires at least 2 arguments'), end
  n = length(DM);
  ppvec = (1:n)';
  d1 = full(diag(DM)); 
  d2 = full(diag(DG)); 
  dd = sqrt(d1.*d1 + abs(d2));
  RPCMTX = sparse(1:n,1:n,dd);
