function [ energy, error ] = evaluate_energy( x, c, A, b, t )
%EVALUATE_ENERGY Summary of this function goes here
%   Detailed explanation goes here

error = 0;
constraint_num = size(A, 2);
energy = 0.5*x'*x + c'*x;

for i = 1:constraint_num
    ai = A(:, i);
    aixmb = ai'*x-b(i);
    if (aixmb <= 0)
        error = 1;
        break;
    end
    energy = energy - 1/t * log(aixmb);
end

end

