%===========Generation of linear-quadratic bilevel programs with equality constraints=============

n=20;     %Dimension of the upper-level variable x
l=25;     %Number of upper-level inequality constraints
m=30;     %Dimension of the lower-level variable y
p=20;     %Number of lower-level inequality constraints
q=10;     %Number of lower-level equality constraints

d=0.5;   
lb_y=-10*ones(m,1);   %lower bound for variable y
ub_y=10*ones(m,1);    %upper bound for variable y


c_1= sprand(n,1,d)-sprand(n,1,d); 
c_2= sprand(m,1,d)-sprand(m,1,d); 
A_1= sprand(l,n,d)-sprand(l,n,d); 
b_1= sprand(l,1,d)-sprand(l,1,d); 
H=sprand(m,1,d); H=H*H';
d_2= sprand(m,1,d)-sprand(m,1,d);  
A_2= sprand(p,n,d)-sprand(p,n,d);  
B_2= sprand(p,m,d)-sprand(p,m,d);  
b_2= sprand(p,1,d)-sprand(p,1,d); 
A_3= sprand(q,n,d)-sprand(q,n,d);  
B_3= sprand(q,m,d)-sprand(q,m,d);  
b_3= sprand(q,1,d)-sprand(q,1,d); 

