clear all
%
% Example 01
%
  tic
  m=2
  n=5
  A = zeros(m,m,n);
  B = zeros(m,m,n);   
  C = zeros(m,m,n);
  D = zeros(m,m,n);
  E = zeros(m,m,n);
  F = zeros(m,n);
  X = zeros(m,n);
  R = zeros(m,n);
%
% Form matrices
%
  A(:,:,1) = [  1  1;  1 -1];
  B(:,:,1) = [ -1  1;  1  1];
  C(:,:,1) = [  1  5;  5  1];
  D(:,:,1) = [  1 -1;  1  1];
  E(:,:,1) = [  1  1; -1  1];
  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,[1 1 1 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))