| [lceresresult,type,uplo,m,n,aa,as,lda]=lceres(type,uplo,m,n,aa,as,lda); |
function [lceresresult,type,uplo,m,n,aa,as,lda]=lceres(type,uplo,m,n,aa,as,lda);
lceresresult=[];
persistent i ibeg iend j uppermlv ;
;
aa_shape=size(aa);aa=reshape([aa(:).',zeros(1,ceil(numel(aa)./prod([lda])).*prod([lda])-numel(aa))],lda,[]);
as_shape=size(as);as=reshape([as(:).',zeros(1,ceil(numel(as)./prod([lda])).*prod([lda])-numel(as))],lda,[]);
if isempty(i), i=0; end;
if isempty(ibeg), ibeg=0; end;
if isempty(iend), iend=0; end;
if isempty(j), j=0; end;
if isempty(uppermlv), uppermlv=false; end;
uppermlv = strcmp(deblank(uplo),deblank('U'));
if( strcmp(deblank(type),deblank('GE')) )
for j = 1 : n;
for i = m + 1 : lda;
if( aa(i,j)~=as(i,j) )
lceresresult = false;
aa_shape=zeros(aa_shape);aa_shape(:)=aa(1:numel(aa_shape));aa=aa_shape;
as_shape=zeros(as_shape);as_shape(:)=as(1:numel(as_shape));as=as_shape;
csnil=dbstack(1); csnil=csnil(1).name(1)~='@';
if csnil&&~isempty(inputname(2)), assignin('caller','FUntemp',uplo); evalin('caller',[inputname(2),'=FUntemp;']); end
if csnil&&~isempty(inputname(1)), assignin('caller','FUntemp',type); evalin('caller',[inputname(1),'=FUntemp;']); end
if csnil&&~isempty(inputname(4)), assignin('caller','FUntemp',n); evalin('caller',[inputname(4),'=FUntemp;']); end
if csnil&&~isempty(inputname(3)), assignin('caller','FUntemp',m); evalin('caller',[inputname(3),'=FUntemp;']); end
if csnil&&~isempty(inputname(7)), assignin('caller','FUntemp',lda); evalin('caller',[inputname(7),'=FUntemp;']); end
if csnil&&~isempty(inputname(6)), assignin('caller','FUntemp',as); evalin('caller',[inputname(6),'=FUntemp;']); end
if csnil&&~isempty(inputname(5)), assignin('caller','FUntemp',aa); evalin('caller',[inputname(5),'=FUntemp;']); end
return;
end;
end; i = fix(lda+1);
end; j = fix(n+1);
elseif ( strcmp(deblank(type),deblank('HE')) ) ;
for j = 1 : n;
if( uppermlv )
ibeg = 1;
iend = fix(j);
else;
ibeg = fix(j);
iend = fix(n);
end;
for i = 1 : ibeg - 1;
if( aa(i,j)~=as(i,j) )
lceresresult = false;
aa_shape=zeros(aa_shape);aa_shape(:)=aa(1:numel(aa_shape));aa=aa_shape;
as_shape=zeros(as_shape);as_shape(:)=as(1:numel(as_shape));as=as_shape;
csnil=dbstack(1); csnil=csnil(1).name(1)~='@';
if csnil&&~isempty(inputname(2)), assignin('caller','FUntemp',uplo); evalin('caller',[inputname(2),'=FUntemp;']); end
if csnil&&~isempty(inputname(1)), assignin('caller','FUntemp',type); evalin('caller',[inputname(1),'=FUntemp;']); end
if csnil&&~isempty(inputname(4)), assignin('caller','FUntemp',n); evalin('caller',[inputname(4),'=FUntemp;']); end
if csnil&&~isempty(inputname(3)), assignin('caller','FUntemp',m); evalin('caller',[inputname(3),'=FUntemp;']); end
if csnil&&~isempty(inputname(7)), assignin('caller','FUntemp',lda); evalin('caller',[inputname(7),'=FUntemp;']); end
if csnil&&~isempty(inputname(6)), assignin('caller','FUntemp',as); evalin('caller',[inputname(6),'=FUntemp;']); end
if csnil&&~isempty(inputname(5)), assignin('caller','FUntemp',aa); evalin('caller',[inputname(5),'=FUntemp;']); end
return;
end;
end; i = fix(ibeg - 1+1);
for i = iend + 1 : lda;
if( aa(i,j)~=as(i,j) )
lceresresult = false;
aa_shape=zeros(aa_shape);aa_shape(:)=aa(1:numel(aa_shape));aa=aa_shape;
as_shape=zeros(as_shape);as_shape(:)=as(1:numel(as_shape));as=as_shape;
csnil=dbstack(1); csnil=csnil(1).name(1)~='@';
if csnil&&~isempty(inputname(2)), assignin('caller','FUntemp',uplo); evalin('caller',[inputname(2),'=FUntemp;']); end
if csnil&&~isempty(inputname(1)), assignin('caller','FUntemp',type); evalin('caller',[inputname(1),'=FUntemp;']); end
if csnil&&~isempty(inputname(4)), assignin('caller','FUntemp',n); evalin('caller',[inputname(4),'=FUntemp;']); end
if csnil&&~isempty(inputname(3)), assignin('caller','FUntemp',m); evalin('caller',[inputname(3),'=FUntemp;']); end
if csnil&&~isempty(inputname(7)), assignin('caller','FUntemp',lda); evalin('caller',[inputname(7),'=FUntemp;']); end
if csnil&&~isempty(inputname(6)), assignin('caller','FUntemp',as); evalin('caller',[inputname(6),'=FUntemp;']); end
if csnil&&~isempty(inputname(5)), assignin('caller','FUntemp',aa); evalin('caller',[inputname(5),'=FUntemp;']); end
return;
end;
end; i = fix(lda+1);
end; j = fix(n+1);
end;
lceresresult = true;
aa_shape=zeros(aa_shape);aa_shape(:)=aa(1:numel(aa_shape));aa=aa_shape;
as_shape=zeros(as_shape);as_shape(:)=as(1:numel(as_shape));as=as_shape;
csnil=dbstack(1); csnil=csnil(1).name(1)~='@';
if csnil&&~isempty(inputname(2)), assignin('caller','FUntemp',uplo); evalin('caller',[inputname(2),'=FUntemp;']); end
if csnil&&~isempty(inputname(1)), assignin('caller','FUntemp',type); evalin('caller',[inputname(1),'=FUntemp;']); end
if csnil&&~isempty(inputname(4)), assignin('caller','FUntemp',n); evalin('caller',[inputname(4),'=FUntemp;']); end
if csnil&&~isempty(inputname(3)), assignin('caller','FUntemp',m); evalin('caller',[inputname(3),'=FUntemp;']); end
if csnil&&~isempty(inputname(7)), assignin('caller','FUntemp',lda); evalin('caller',[inputname(7),'=FUntemp;']); end
if csnil&&~isempty(inputname(6)), assignin('caller','FUntemp',as); evalin('caller',[inputname(6),'=FUntemp;']); end
if csnil&&~isempty(inputname(5)), assignin('caller','FUntemp',aa); evalin('caller',[inputname(5),'=FUntemp;']); end
end %function lceres
|
|