Code covered by the BSD License  

Highlights from
slatec

from slatec by Ben Barrowes
The slatec library converted into matlab functions.

[hvnrmresult,v,ncomp]=hvnrm(v,ncomp);
function [hvnrmresult,v,ncomp]=hvnrm(v,ncomp);
hvnrmresult=[];
persistent hvnrm k ; 

if isempty(hvnrmresult), hvnrmresult=0; end;
if isempty(k), k=0; end;
%***BEGIN PROLOGUE  HVNRM
%***SUBSIDIARY
%***PURPOSE  Subsidiary to DEABM, DEBDF and DERKF
%***LIBRARY   SLATEC
%***TYPE      SINGLE PRECISION (HVNRM-S, DHVNRM-D)
%***AUTHOR  Watts, H. A., (SNLA)
%***DESCRIPTION
%
%     Compute the maximum norm of the vector V(*) of length NCOMP and
%     return the result as HVNRM.
%
%***SEE ALSO  DEABM, DEBDF, DERKF
%***ROUTINES CALLED  (NONE)
%***REVISION HISTORY  (YYMMDD)
%   800501  DATE WRITTEN
%   890531  Changed all specific intrinsics to generic.  (WRB)
%   890831  Modified array declarations.  (WRB)
%   891024  Changed routine name from VNORM to HVNRM.  (WRB)
%   891214  Prologue converted to Version 4.0 format.  (BAB)
%   900328  Added TYPE section.  (WRB)
%   910722  Updated AUTHOR section.  (ALS)
%***end PROLOGUE  HVNRM
v_shape=size(v);v=reshape(v,1,[]);
%***FIRST EXECUTABLE STATEMENT  HVNRM
hvnrmresult = 0.;
for k = 1 : ncomp;
hvnrmresult = max(hvnrmresult,abs(v(k)));
end; k = fix(ncomp+1);
v_shape=zeros(v_shape);v_shape(:)=v(1:numel(v_shape));v=v_shape;
csnil=dbstack(1); csnil=csnil(1).name(1)~='@';
if csnil&&~isempty(inputname(1)), assignin('caller','FUntemp',v); evalin('caller',[inputname(1),'=FUntemp;']); end
if csnil&&~isempty(inputname(2)), assignin('caller','FUntemp',ncomp); evalin('caller',[inputname(2),'=FUntemp;']); end
end
%DECK HW3CRT

Contact us