Code covered by the BSD License  

Highlights from
slatec

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

[lenmlv,dcomp,dtrue,dsize,dfac,kprint]=dtest(lenmlv,dcomp,dtrue,dsize,dfac,kprint);
function [lenmlv,dcomp,dtrue,dsize,dfac,kprint]=dtest(lenmlv,dcomp,dtrue,dsize,dfac,kprint);
persistent dd firstCall i releps ; if isempty(firstCall),firstCall=1;end; 

if isempty(i), i=0; end;
global combla_2; if isempty(combla_2), combla_2=0; end;
global combla_4; if isempty(combla_4), combla_4=0; end;
global combla_5; if isempty(combla_5), combla_5=0; end;
global combla_6; if isempty(combla_6), combla_6=0; end;
global combla_3; if isempty(combla_3), combla_3=0; end;
global combla_1; if isempty(combla_1), combla_1=0; end;
dcomp_shape=size(dcomp);dcomp=reshape(dcomp,1,[]);
dtrue_shape=size(dtrue);dtrue=reshape(dtrue,1,[]);
dsize_shape=size(dsize);dsize=reshape(dsize,1,[]);
if isempty(dd), dd=0; end;
if isempty(releps), releps=0; end;
global combla_7; if isempty(combla_7), combla_7=false; end;
% common :: ;
%% common /combla/ nprint , icase , n , incx , incy , mode , pass;
%% common /combla/ combla_1 , combla_2 , combla_3 , combla_4 , combla_5 , combla_6 , combla_7;
if firstCall,   releps=[0.0d0];  end;
firstCall=0;
if( releps==0.0d0 )
[ releps ]=d1mach(4);
end;
for i = 1 : lenmlv;
dd = abs(dcomp(i)-dtrue(i));
if( dfac.*dd>abs(dsize(i)).*releps )
if( combla_7 )
combla_7 = false;
if( kprint>=3 )
writef(combla_1,['+',repmat(' ',1,39),'FAIL' ' \n']);
%format ('+',39X,'FAIL');
writef(combla_1,['0CASE  N INCX INCY MODE  I',repmat(' ',1,29),'COMP(I)',repmat(' ',1,29),'truemlv(I)',repmat(' ',1,2),'DIFFERENCE',repmat(' ',1,5),'SIZE(I)', '\n ' ,repmat(' ',1,1) ' \n']);
%format ('0CASE  N INCX INCY MODE  I',29X,'COMP(I)',29X,'truemlv(I)',2X,'DIFFERENCE',5X,'SIZE(I)'/1X);
end;
end;
if( kprint>=3 )
writef(combla_1,[repmat(' ',1,1),'%4i','%3i',repmat('%5i',1,3),'%3i',repmat('%36.18f',1,2),repmat('%12.4f',1,2) ' \n'], combla_2 , combla_3 , combla_4 , combla_5 ,combla_6 , i , dcomp(i) , dtrue(i) , dd ,dsize(i));
end;
%format(1x,i4,i3,3i5,i3,2d36.18,2d12.4);
end;
end; i = fix(lenmlv+1);
dcomp_shape=zeros(dcomp_shape);dcomp_shape(:)=dcomp(1:numel(dcomp_shape));dcomp=dcomp_shape;
dtrue_shape=zeros(dtrue_shape);dtrue_shape(:)=dtrue(1:numel(dtrue_shape));dtrue=dtrue_shape;
dsize_shape=zeros(dsize_shape);dsize_shape(:)=dsize(1:numel(dsize_shape));dsize=dsize_shape;
return;
end %subroutine dtest

Contact us at files@mathworks.com