| [dvnrmsresult,n,v,w]=dvnrms(n,v,w); |
function [dvnrmsresult,n,v,w]=dvnrms(n,v,w);
dvnrmsresult=[];
persistent i summlv ;
;
%***BEGIN PROLOGUE DVNRMS
%***SUBSIDIARY
%***PURPOSE Subsidiary to DDEBDF
%***LIBRARY SLATEC
%***TYPE doubleprecision (VNWRMS-S, DVNRMS-D)
%***AUTHOR (UNKNOWN)
%***DESCRIPTION
%
% DVNRMS computes a weighted root-mean-square vector norm for the
% integrator package DDEBDF.
%
%***SEE ALSO DDEBDF
%***ROUTINES CALLED (NONE)
%***REVISION HISTORY (YYMMDD)
% 820301 DATE WRITTEN
% 890531 Changed all specific intrinsics to generic. (WRB)
% 890831 Modified array declarations. (WRB)
% 890911 Removed unnecessary intrinsics. (WRB)
% 891214 Prologue converted to Version 4.0 format. (BAB)
% 900328 Added TYPE section. (WRB)
%***end PROLOGUE DVNRMS
if isempty(i), i=0; end;
if isempty(summlv), summlv=0; end;
v_shape=size(v);v=reshape(v,1,[]);
w_shape=size(w);w=reshape(w,1,[]);
%***FIRST EXECUTABLE STATEMENT DVNRMS
summlv = 0.0d0;
for i = 1 : n;
summlv = summlv +(v(i)./w(i)).^2;
end; i = fix(n+1);
dvnrmsresult = sqrt(summlv./n);
% ----------------------- end OF FUNCTION DVNRMS
% ------------------------
v_shape=zeros(v_shape);v_shape(:)=v(1:numel(v_shape));v=v_shape;
w_shape=zeros(w_shape);w_shape(:)=w(1:numel(w_shape));w=w_shape;
csnil=dbstack(1); csnil=csnil(1).name(1)~='@';
if csnil&&~isempty(inputname(3)), assignin('caller','FUntemp',w); evalin('caller',[inputname(3),'=FUntemp;']); end
if csnil&&~isempty(inputname(2)), assignin('caller','FUntemp',v); evalin('caller',[inputname(2),'=FUntemp;']); end
if csnil&&~isempty(inputname(1)), assignin('caller','FUntemp',n); evalin('caller',[inputname(1),'=FUntemp;']); end
end
%DECK DVOUT
|
|