| [pgsfresult,x,iz,c,a,bh]=pgsf(x,iz,c,a,bh); |
function [pgsfresult,x,iz,c,a,bh]=pgsf(x,iz,c,a,bh);
pgsfresult=[];
persistent dd fsg hsg j pgsf ;
if isempty(dd), dd=0; end;
if isempty(fsg), fsg=0; end;
if isempty(hsg), hsg=0; end;
if isempty(pgsfresult), pgsfresult=0; end;
if isempty(j), j=0; end;
%***BEGIN PROLOGUE PGSF
%***SUBSIDIARY
%***PURPOSE Subsidiary to CBLKTR
%***LIBRARY SLATEC
%***TYPE SINGLE PRECISION (PGSF-S)
%***AUTHOR (UNKNOWN)
%***SEE ALSO CBLKTR
%***ROUTINES CALLED (NONE)
%***REVISION HISTORY (YYMMDD)
% 801001 DATE WRITTEN
% 891214 Prologue converted to Version 4.0 format. (BAB)
% 900402 Added TYPE section. (WRB)
%***end PROLOGUE PGSF
a_shape=size(a);a=reshape(a,1,[]);
c_shape=size(c);c=reshape(c,1,[]);
bh_shape=size(bh);bh=reshape(bh,1,[]);
%***FIRST EXECUTABLE STATEMENT PGSF
fsg = 1.;
hsg = 1.;
for j = 1 : iz;
dd = 1../(x-bh(j));
fsg = fsg.*a(j).*dd;
hsg = hsg.*c(j).*dd;
end; j = fix(iz+1);
if( rem(iz,2)~=0 )
pgsfresult = 1. + fsg + hsg;
else;
pgsfresult = 1. - fsg - hsg;
a_shape=zeros(a_shape);a_shape(:)=a(1:numel(a_shape));a=a_shape;
c_shape=zeros(c_shape);c_shape(:)=c(1:numel(c_shape));c=c_shape;
bh_shape=zeros(bh_shape);bh_shape(:)=bh(1:numel(bh_shape));bh=bh_shape;
csnil=dbstack(1); csnil=csnil(1).name(1)~='@';
if csnil&&~isempty(inputname(1)), assignin('caller','FUntemp',x); evalin('caller',[inputname(1),'=FUntemp;']); end
if csnil&&~isempty(inputname(2)), assignin('caller','FUntemp',iz); evalin('caller',[inputname(2),'=FUntemp;']); end
if csnil&&~isempty(inputname(3)), assignin('caller','FUntemp',c); evalin('caller',[inputname(3),'=FUntemp;']); end
if csnil&&~isempty(inputname(5)), assignin('caller','FUntemp',bh); evalin('caller',[inputname(5),'=FUntemp;']); end
if csnil&&~isempty(inputname(4)), assignin('caller','FUntemp',a); evalin('caller',[inputname(4),'=FUntemp;']); end
return;
end;
a_shape=zeros(a_shape);a_shape(:)=a(1:numel(a_shape));a=a_shape;
c_shape=zeros(c_shape);c_shape(:)=c(1:numel(c_shape));c=c_shape;
bh_shape=zeros(bh_shape);bh_shape(:)=bh(1:numel(bh_shape));bh=bh_shape;
csnil=dbstack(1); csnil=csnil(1).name(1)~='@';
if csnil&&~isempty(inputname(1)), assignin('caller','FUntemp',x); evalin('caller',[inputname(1),'=FUntemp;']); end
if csnil&&~isempty(inputname(2)), assignin('caller','FUntemp',iz); evalin('caller',[inputname(2),'=FUntemp;']); end
if csnil&&~isempty(inputname(3)), assignin('caller','FUntemp',c); evalin('caller',[inputname(3),'=FUntemp;']); end
if csnil&&~isempty(inputname(5)), assignin('caller','FUntemp',bh); evalin('caller',[inputname(5),'=FUntemp;']); end
if csnil&&~isempty(inputname(4)), assignin('caller','FUntemp',a); evalin('caller',[inputname(4),'=FUntemp;']); end
end
%DECK PIMACH
|
|