function [z] = Delta_Score_Total(X,C,A,random_projections,num_trials)
global B;
% clc; clear;

% X = randn(1000, 5);
% C = randn(5,5);
% A = randn(5,5);
% random_projections = randn(200,5);
    % X - (n,k)
    % A - (k,k)
    % t - (1,k)

k = size(A,2);

% if( not( (size(A,1) == k) && (size(A,2) == k) ) )
F = pinv(A);% If A = (d,k) then F = (k,d)
% if( not(size(F,2) == size(X,1)) )
if(0)
    z = inf;
else
    S       = cov(X);
    S_h     = real(sqrtm(S));
    S_h_inv = pinv(S_h);
    X       = X*S_h_inv; 
    A       = S_h_inv*A;
    F = pinv(A);% If A = (d,k) then F = (k,d)
    F = normr(F);
    S = cov(X);
    z_all = zeros(length(random_projections),1);
    for itr=1:length(random_projections)
        t    = random_projections(itr,:);
        L    = mean(exp(sqrt(-1)*t*F*X'))*exp(-t*diag(diag(F*S*F'))*t'/2);
        % L =  mean(exp(sqrt(-1)*t*F*X'));
        R    = 1;
        M    = F*X';
        for j=1:k
            R = R * mean(exp(sqrt(-1)*t(j)*M(j,:)));
        end
        R = R * exp(-t*(F*S*F')*t'/2);
        z_all(itr) = abs(L-R);
    end
    z = mean(z_all);

    % z = 0;
    % for itr=1:k
    %     [score,~,~,~,~] = Delta_incremental(X,C,A(:,itr), ...
    %                                         random_projections, ...
    %                                         num_trials);
    %     z = z + score;
    % end
end

end