function [ H_q ] = EntropyOfSet( c,cbar )
% Hassan Nahas
%This function calculates the entropy of a set given the number of corners
%and non-corners in it.

    cfactor = c.*log2(c);
    cfactor(isnan(cfactor))=0;
    cbarfactor = cbar.*log2(cbar);
    cbarfactor(isnan(cbarfactor))=0;
    ccbarfactor = (c+cbar).*log2(c + cbar);
    ccbarfactor(isnan(ccbarfactor))=0;
    H_q = ccbarfactor -cfactor -cbarfactor;
    
end

