clear
%
% Example 03 - Hermitian penta-diagonal system (Minchev&Ivanov)
%
  tic
  m=3
  n=100
  A(:,:,1) = eye(m,m)
  B(:,:,1) = circ([ 1 2 3])   
  C(:,:,1) = circ([22 1 -1])
  D(:,:,1) = B(:,:,1);
  E(:,:,1) = -A(:,:,1);
  F = zeros(m,n);
  X = zeros(m,n);
  R = zeros(m,n);
%
% Form matrices
%
  for k = 2:n
      A(:,:,k) = A(:,:,1);    
      B(:,:,k) = B(:,:,1);
      C(:,:,k) = C(:,:,1);
      D(:,:,k) = D(:,:,1);
      E(:,:,k) = E(:,:,1);
  end
%
% Run example
%
  Xe = ones(m,n);
  F = ResCBPS(A,B,C,D,E,R,Xe);
  toc
  tic
  X = CBPS(A,B,C,D,E,F,[0.1,-0.1,0.1,-0.1]);
  toc
  R = ResCBPS(A,B,C,D,E,F,X);
  err_abs = max(max(abs(X-Xe)))  
  err_rel = err_abs/max(max(Xe))