function [lun,kprint,ipass]=dbocqx(lun,kprint,ipass);
persistent bl bl1 bu bu1 c d firstCall i ib ind iopt irhs itest_v iw j mcon mdw mode mpass mrows msg ncols rhs rnorm rnormc rw sr w x xtrue ; if isempty(firstCall),firstCall=1;end;
if isempty(rnorm), rnorm=0; end;
if isempty(rnormc), rnormc=0; end;
if isempty(sr), sr=0; end;
if isempty(i), i=0; end;
if isempty(ib), ib=0; end;
if isempty(irhs), irhs=0; end;
if isempty(itest_v), itest_v=0; end;
if isempty(j), j=0; end;
if isempty(mcon), mcon=0; end;
if isempty(mdw), mdw=0; end;
if isempty(mode), mode=0; end;
if isempty(mpass), mpass=0; end;
if isempty(mrows), mrows=0; end;
if isempty(ncols), ncols=0; end;
if isempty(d), d=zeros(6,5); end;
if isempty(w), w=zeros(11,11); end;
if isempty(bl), bl=zeros(5,2); end;
if isempty(bu), bu=zeros(5,2); end;
if isempty(x), x=zeros(1,30); end;
if isempty(rw), rw=zeros(1,55); end;
if isempty(xtrue), xtrue=zeros(1,9); end;
if isempty(c), c=zeros(5,5); end;
if isempty(bl1), bl1=zeros(1,10); end;
if isempty(bu1), bu1=zeros(1,10); end;
if isempty(ind), ind=zeros(1,10); end;
if isempty(iw), iw=zeros(1,20); end;
if isempty(iopt), iopt=zeros(1,40); end;
if isempty(rhs), rhs=zeros(6,2); end;
if isempty(msg), msg=repmat(' ',1,4); end;
if firstCall, c=[1.0d0,10.0d0,4.0d0,8.0d0,1.0d0,1.0d0,10.0d0,2.0d0,-1.0d0,1.0d0,1.0d0,-3.0d0,-3.0d0,2.0d0,1.0d0,1.0d0,5.0d0,5.0d0,5.0d0,1.0d0,1.0d0,4.0d0,-1.0d0,-3.0d0,1.0d0]; end;
if firstCall, d=[-74.0d0,14.0d0,66.0d0,-12.0d0,3.0d0,4.0d0,80.0d0,-69.0d0,-72.0d0,66.0d0,8.0d0,-12.0d0,18.0d0,21.0d0,-5.0d0,-30.0d0,-7.0d0,4.0d0,-11.0d0,28.0d0,7.0d0,-23.0d0,-4.0d0,4.0d0,-4.0d0,0.0d0,1.0d0,3.0d0,1.0d0,0.0d0]; end;
if firstCall, bl=[1.0d0,0.0d0,-1.0d0,1.0d0,-4.0d0,-1.0d0,0.0d0,-3.0d0,1.0d0,-6.0d0]; end;
if firstCall, bu=[3.0d0,2.0d0,1.0d0,3.0d0,-2.0d0,3.0d0,4.0d0,1.0d0,5.0d0,-2.0d0]; end;
if firstCall, rhs=[51.0d0,-61.0d0,-56.0d0,69.0d0,10.0d0,-12.0d0,-5.0d0,-9.0d0,708.0d0,4165.0d0,-13266.0d0,8409.0d0]; end;
if firstCall, xtrue=[1.0d0,2.0d0,-1.0d0,3.0d0,-4.0d0,1.0d0,32.0d0,30.0d0,31.0d0]; end;bl=reshape(bl,[5,2]);bu=reshape(bu,[5,2]);c=reshape(c,[5,5]);d=reshape(d,[6,5]);rhs=reshape(rhs,[6,2]);
firstCall=0;
mdw = 11;
mrows = 6;
ncols = 5;
mcon = 4;
iopt(1) = 99;
ipass = 1;
itest_v = 0;
if( kprint>=2 )
writef(lun,[' TEST IB IRHS SR' ' \n']);
end;
%format (' TEST IB IRHS SR');
for ib = 1 : 2;
for irhs = 1 : 2;
for j = 1 : ncols;
[mrows,d(sub2ind(size(d),1,j):end),dumvar3,w(sub2ind(size(w),1,j):end)]=dcopy(mrows,d(sub2ind(size(d),1,j):end),1,w(sub2ind(size(w),1,j):end),1);
end; j = fix(ncols+1);
[mrows,rhs(sub2ind(size(rhs),1,irhs):end),dumvar3,w(sub2ind(size(w),1,ncols+1):end)]=dcopy(mrows,rhs(sub2ind(size(rhs),1,irhs):end),1,w(sub2ind(size(w),1,ncols+1):end),1);
for j = 1 : ncols;
ind(j) = 3;
end; j = fix(ncols+1);
[w,mdw,mrows,ncols,bl(sub2ind(size(bl),1,ib):end),bu(sub2ind(size(bu),1,ib):end),ind,iopt,x,rnorm,mode,rw,iw]=dbols(w,mdw,mrows,ncols,bl(sub2ind(size(bl),1,ib):end),bu(sub2ind(size(bu),1,ib):end),ind,iopt,x,rnorm,mode,rw,iw);
for j = 1 : ncols;
x(j) = x(j) - xtrue(j);
end; j = fix(ncols+1);
[sr ,ncols,x]=dnrm2(ncols,x,1);
mpass = 1;
if( sr>10.0d2.*sqrt(d1mach(4)) )
mpass = 0;
end;
ipass = fix(ipass.*mpass);
if( kprint>=2 )
msg = 'PASS';
if( mpass==0 )
msg = 'FAIL';
end;
itest_v = fix(itest_v + 1);
writef(lun,[repmat('%5i',1,3),repmat('%f',1,1),'%20.6f',' TEST ','%s','ED.' ' \n'], itest_v , ib , irhs , sr , msg);
end;
end; irhs = fix(2+1);
end; ib = fix(2+1);
for ib = 1 : 2;
for irhs = 1 : 2;
[dumvar1,dumvar2,dumvar3,w]=dcopy(11.*10,0.0d0,0,w,1);
[ncols,bl(sub2ind(size(bl),1,ib):end),dumvar3,bl1]=dcopy(ncols,bl(sub2ind(size(bl),1,ib):end),1,bl1,1);
[ncols,bu(sub2ind(size(bu),1,ib):end),dumvar3,bu1]=dcopy(ncols,bu(sub2ind(size(bu),1,ib):end),1,bu1,1);
ind(ncols+1) = 2;
ind(ncols+2) = 1;
ind(ncols+3) = 2;
ind(ncols+4) = 3;
bu1(ncols+1) = 5.;
bl1(ncols+2) = 20.;
bu1(ncols+3) = 30.;
bl1(ncols+4) = 11.;
bu1(ncols+4) = 40.;
for j = 1 : ncols;
[mcon,c(sub2ind(size(c),1,j):end),dumvar3,w(sub2ind(size(w),1,j):end)]=dcopy(mcon,c(sub2ind(size(c),1,j):end),1,w(sub2ind(size(w),1,j):end),1);
[mrows,d(sub2ind(size(d),1,j):end),dumvar3,w(sub2ind(size(w),mcon+1,j):end)]=dcopy(mrows,d(sub2ind(size(d),1,j):end),1,w(sub2ind(size(w),mcon+1,j):end),1);
end; j = fix(ncols+1);
[mrows,rhs(sub2ind(size(rhs),1,irhs):end),dumvar3,w(sub2ind(size(w),mcon+1,ncols+1):end)]=dcopy(mrows,rhs(sub2ind(size(rhs),1,irhs):end),1,w(sub2ind(size(w),mcon+1,ncols+1):end),1);
iopt(01) = 2;
iopt(02) = 11;
iopt(03) = 11;
iopt(04) = 10;
iopt(05) = 30;
iopt(06) = 55;
iopt(07) = 20;
iopt(08) = 40;
iopt(09) = 99;
[w,mdw,mcon,mrows,ncols,bl1,bu1,ind,iopt,x,rnormc,rnorm,mode,rw,iw]=dbocls(w,mdw,mcon,mrows,ncols,bl1,bu1,ind,iopt,x,rnormc,rnorm,mode,rw,iw);
for j = 1 : ncols + mcon;
x(j) = x(j) - xtrue(j);
end; j = fix(ncols + mcon+1);
[sr ,dumvar2,x]=dnrm2(ncols+mcon,x,1);
mpass = 1;
if( sr>10.0d2.*sqrt(d1mach(4)) )
mpass = 0;
end;
ipass = fix(ipass.*mpass);
if( kprint>=2 )
msg = 'PASS';
if( mpass==0 )
msg = 'FAIL';
end;
itest_v = fix(itest_v + 1);
writef(lun,[repmat('%5i',1,3),repmat('%f',1,1),'%20.6f',' TEST ','%s','ED.' ' \n'], itest_v , ib , irhs , sr , msg);
end;
end; irhs = fix(2+1);
end; ib = fix(2+1);
if( kprint>=3 )
writef(lun,[' ipass VALUE. (A 1 IS GOOD, 0 IS BAD.)','%4i'], ipass);
end;
if( kprint>=2 && ipass==0 )
writef(lun,[' ERROR IN DBOCLS OR DBOLS' ' \n']);
end;
%format (' ERROR IN DBOCLS OR DBOLS');
return;
%format (3I5,1P,e20.6,' TEST ',a,'ED.');
end %subroutine dbocqx