clear
%
% Example 03 - Hermitian penta-diagonal system (Minchev&Ivanov)
%
  tic
  m=7
  n=500
  b = zeros(m,1);
  b(1) = -7.2;
  b(2:m) = 1.8;
  c = ones(m,1);
  c(1) = 22;
  c(2) = -8;
  c(m) = -8;
  A(:,:,1) = eye(m,m)
  B(:,:,1) = circ(b)   
  C(:,:,1) = circ(c)
  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);
  toc
  R = ResCBPS(A,B,C,D,E,F,X);
  err_abs = max(max(abs(X-Xe)))  
  err_rel = err_abs/max(max(Xe))