function problem_data;
%   constructs first row and column of the Toeplitz matrix A 
%   and the right hand-side vector rhs from the exact
%   solution sol. It requires the number m of upper diagonals,
%   n of lower diagonals and lnn the logarithm of the number 
%   of blocks.
%
global m n lnn 
global row col 
global rhs sol 
%
m=4; n=32; lnn=8;
nn=2^lnn; dim= n*nn;
%
%  The matrix is defined through its first row and column.
%  In the following a random matrix with diagonal dominance 
%  is costructed. Parameter dd specifies the dominance rate
%
 dd=1.1;
 rand('state',1);       
 col=rand(1,n+1);
 row=rand(1,m+1);
 p=dd*(sum(abs(col(2:n+1)))+sum(abs(row(2:m+1))));
 row(1)=p;
 col(1)=p;
%
firstrow=zeros(1,dim);
firstrow(2:m+1)=row(2:m+1);
firstcol=zeros(1,dim);
firstcol(1:n+1)=col;
sol=sin(linspace(1.3,1.3*dim,dim)); 
%
%  computes rhs as A*sol by using FFT 
%
d2=2*dim;
sd2=sqrt(d2);
fs=ifft(sol,d2)*sd2;        
fw1=ifft(firstcol,d2)*sd2;  
fp1=fw1.*fs;
fl=fliplr(firstrow(2:dim));
te=zeros(1,dim+1);
te(dim+2:d2)=fl;
fw2=ifft(te)*sd2;
fp2=fw2.*fs;
te=fft(fp1+fp2);
rhs=real(te(1:dim));                   
