% Test a matrix to find out if it is 
% the sum of a Toeplitz matrix and a Hankel matrix.
% Returns 1 if A = T+H, and zero otherwise.
function pass_test = TplusHtest(A)
N = size(A,1);
tol=1e-8;
pass_test = true;
for i = 2:N-1
    for j = 2:N-1
        r = A(i,j+1) + A(i,j-1);  % same row
        c = A(i+1,j)  + A(i-1,j); % same column
        if abs(r-c)>tol
            pass_test = false;
            %i,j, r-c
            break
        end
    end
end
