function [ residual ] = evaluate_residual( x, lambda, c, A, b, t )
%EVALUATE_RESIDUAL Summary of this function goes here
%   Detailed explanation goes here

constraint_num = size(A, 2);

residual_dual = x+c;

for i = 1:constraint_num
    ai = A(:, i);
    residual_dual = residual_dual - lambda(i) * ai;
end

residual_primal = diag(lambda) * (A' * x - b) - 1/t*ones(constraint_num, 1);

residual = [residual_dual; residual_primal];

end

